[9023] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 2641 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue May 19 15:07:34 1998

Date: Tue, 19 May 98 12:00:30 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 19 May 1998     Volume: 8 Number: 2641

Today's topics:
    Re: "Out of Memory!" on DecAlpha/WinNT/IIS3 (Andrew Williams)
        C compiler for NT and perl <erich@orator.usma.edu>
    Re: COM and CPAN (actually, a semi-rant on survivable s <tchrist@mox.perl.com>
    Re: Compiling perl with static libc (Tom Hukins)
        Creating HTML tables? djones@everest.walcoff.com
    Re: DBD:Oracle: Bad free() ignored during global destru (Todd Hivnor)
        dbm and perl <rstagner@atcreation.com>
    Re: Does Perl have a IDE?I don't like command line. (Michael J Gebis)
    Re: Does Perl have a IDE?I don't like command line. <shimpei+usenet+.mil+.gov@BOFH.patnet.caltech.edu>
    Re: Does Perl have a IDE?I don't like command line. (Leslie Mikesell)
    Re: Does Perl have a IDE?I don't like command line. lvirden@cas.org
    Re: Does Perl have a IDE?I don't like command line. lvirden@cas.org
    Re: Does Perl have a IDE?I don't like command line. <upsetter@shore.net>
    Re: Dowload Script Problem <boink@montana.com>
    Re: Dowload Script Problem <boink@montana.com>
        Exiting chunk mode. <john_hong@Non-HP-USA-om42.om.hp.com>
    Re: Exiting chunk mode. <lr@hpl.hp.com>
    Re: Exiting chunk mode. (Craig Berry)
        Finding wnt drives <seger@hydra.mro.dec.com>
    Re: how to call SmallEiffel classes from Perl? (Dominique Colnet)
    Re: Is this WEB-BASED mail script good? (John Klassa)
    Re: New Math Modules (Craig Berry)
    Re: New Math Modules (brian d foy)
    Re: Non-static private variables (John Porter)
    Re: ODBC/DBI on WIN32 host <Jacqui.Caren@ig.co.uk>
    Re: Perl Not Showing Errors gwebb@reedtech.com
    Re: Perl terminology <prophet@skepticult.org>
    Re: Perl terminology <tchrist@mox.perl.com>
    Re: Perl terminology <david.x.corcoran@boeing.com>
    Re: reading file into an array of hash <aqumsieh@matrox.com>
    Re: regexp: replacing new line followed by "+" (Craig Berry)
    Re: TIMTOWTDI - regex vs. if (function) <aqumsieh@matrox.com>
        unpacking signed network ints <rlcarro@escher.ppco.com>
    Re: while, each & assoc array (John Moreno)
        WIN32 - Minimizing the shell window <steve.cantrell@sematech.org>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Tue, 19 May 1998 17:56:02 GMT
From: andrew@edoc.com (Andrew Williams)
Subject: Re: "Out of Memory!" on DecAlpha/WinNT/IIS3
Message-Id: <3562c718.702772781@news.clark.net>

On Tue, 19 May 1998 11:30:14 -0500, Raymond Simmons
<raymond@terraincognita.com> wrote:

>I'm having trouble getting a Perl CGI script to read a 2 meg text file
>into an array.  The script produces an "Out of memory!" error during the
>following code segment:
>
>open(LOGFILE,"$logfile");
>@LINES = <LOGFILE>;
>close(LOGFILE);


try processing each line of the file one at a time instead of pulling
everthing into the array.


ie
open(file)
while(<file>)
{
   do stuff
}
close(file)


(yes I do know this is not valid syntax, but you get the idea)



------------------------------

Date: Tue, 19 May 1998 13:23:38 -0400
From: "Erich L. Markert" <erich@orator.usma.edu>
Subject: C compiler for NT and perl
Message-Id: <3561C01A.8AC6BC8C@orator.usma.edu>

I'm migrating from a UNIX box over to NT and have to port all my perl scripts over as
well.  I will be developing all my perl scripts on an NT based platform from now on.

I know that some perl modules on UNIX required C in order to be properly installed.  What
I'm wondering is whether or not I will require a C compiler for NT in order to install
some perl modules and what is the best C compiler for this task.
--
__________________________________________________________
Mr. Erich L. Markert                  markert@www.usma.edu
USMA Webmaster                           TEL (914)938-6463
Directorate of Information Management    FAX (914)938-7308
United States Military Academy
West Point, NY 10996

"If you put three drops of poison into a 100 percent pure Java, 
you get ... Windows. If you put a few drops of Java into Windows, 
you still have Windows."
		-- Sun Microsystems CEO, Scott McNealy


------------------------------

Date: 19 May 1998 17:02:44 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: COM and CPAN (actually, a semi-rant on survivable software design)
Message-Id: <6jsdvk$qe0$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, Bruce Howells <bruce_howells@i2.com> writes:
:Well...  CPAN.pm doesn't work well on this NT machine. Why not?   

[...]

:Just a reminder that a little bit of fragile design can really effect a lot of
			effect as a verb: to cause, to bring about
			affect as a verb: to alter, to change
:functionality.

I assume you're talking about NT's fragile design here, not Perl's or the
CPAN ftp archive's.  If so, you're right on the money.

--tom
-- 
"C is not a big language, and it's not well served by a big book." (Brian W.
Kernighan and Dennis M. Ritchie, in "The C programming Language", Prentice
Hall 1988)


------------------------------

Date: Tue, 19 May 1998 17:34:48 GMT
From: tom@NOSPAMeborcom.com (Tom Hukins)
Subject: Re: Compiling perl with static libc
Message-Id: <3561bfba.105604@nntp.netcom.net.uk>

On 13 May 1998 23:27:26 GMT, mgjv@comdyn.com.au (Martien
Verbruggen) wrote:

>You don't mention trying Configure -Uusedl as documented in INSTALL
>(at the first mention of the string 'static').

I might have known I'd miss something out! Yes, I've tried this,
with and without trying "-static" in ccflags and ccpflags and
"-Bstatic" in ldflags.

I found out why "./perl -V" in the build directory was giving me
strange results though. It was reading the Config.pm of an
already-installed Perl in "/usr/local/lib/perl5/Config.pm". It
assumed this was its own Config.pm.

>The -S option to Configure does something totally different.
>
># ./Configure -h
>[snip]
>  -S : perform variable substitutions on all .SH files (can mix with -f)
>[snip]

Yes, I was trying this after manually editing config.sh, rather
than having to do the whole ./Configure all over again.

>PS. I don't _know_ wether doing this will statically link libc. It
>does compile perl to be static though.

It seems to not statically link anything. As the Perl executable
is considerably larger, I assume everything is compiled
statically. However, ldd reports dynamic links are still there,
and ktrace suggests these are being looked for every time Perl is
run. I guess performace would be better if the whole thing was a
static executable.

Anyway, thanks for your help, Martien.

Tom

If you want to e-mail me remove 'NOSPAM' from my address

-- 
       Learn how to create amazing web sites

     Visit eBORcOM's Web Development Resources
          http://www.eborcom.com/webmaker/


------------------------------

Date: Tue, 19 May 1998 18:21:05 GMT
From: djones@everest.walcoff.com
Subject: Creating HTML tables?
Message-Id: <6jsiih$ajb$1@nnrp1.dejanews.com>

what I'm trying to do is write a perl script that takes an ascii file that
contains a table template like the on below and convert it into an HTML table.

----------------------------------------------------
         |         |           |
         |         |           ---------------------
         |         |           |      |      |
----------------------------------------------------

The ultimate goal is to come up with an algorithem that would work an any
template.  Any ideas?

-David

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


------------------------------

Date: 19 May 1998 13:24:17 -0400
From: hivnor@shore.net (Todd Hivnor)
Subject: Re: DBD:Oracle: Bad free() ignored during global destruction
Message-Id: <6jsf81$2m8@shell2.shore.net>

 I found out that I can say:

$SIG{__WARN__} = sub { $_[0] =~ /^Bad free/ ? dump : warn $_[0] };

 to supress the bad free() warnings. I still don't know what 
the problem is, but it's doesn't seem to be serious. So I
guess I'll just supress those warnings for now.

  - Todd



------------------------------

Date: Tue, 19 May 1998 10:53:31 -0700
From: Robert Stagner <rstagner@atcreation.com>
Subject: dbm and perl
Message-Id: <3561C716.3FBB@atcreation.com>

I'm interested in using Perl's Database functionality (specifically
'dbmopen' and 'dbmclose') to read from an associative array.  The array
will contain fields associated with restaurants and other catering
services (e.g. business name, address, phone number, etc.).  What I'd
like to do is somehow use 'dbmopen' to read from the array, but I'm not
sure as to how I should approach this?? Is it even possible to use
'dbmopen' to read from an associative array? Any assistance would be
greatly appreciated.

Thanks,
Rob Stagner
Web Publisher/System Adminstrator


------------------------------

Date: 19 May 1998 17:26:26 GMT
From: gebis@albrecht.ecn.purdue.edu (Michael J Gebis)
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <6jsfc2$7co@mozo.cc.purdue.edu>

gbacon@cs.uah.edu (Greg Bacon) writes:

}: I think you mean, "What of SpecTCL, the tool that allows you to do Tk
}: GUI design, since Tk itself does nothing to alleviate the problem
}: mentioned."

}Unless SpecTCL will generate Perl code, no, I most certainly didn't mean
}SpecTCL.

Sweet lord, I wish that some people would read the documentation and
stop cluttering the newsgroup with FAQs and half-truths.  (Insert half
a smiley here)

# This file contains the Perl backend for SpecTcl.
#
# This file has been modified by Mark Kvale (Apr 1997) to work with 
# perl 5.003 and Tk400.202. It was downloaded by the SpecTcl team from
# http://www.keck.ucsf.edu/~kvale/specperl.html and incorporated into
# SpecTcl 1.1 as an experimental/unsupported package. More info about
# SpecTcl/perl can be found at the above web page.

-- 
Mike Gebis  gebis@ecn.purdue.edu  mgebis@eternal.net


------------------------------

Date: 19 May 1998 17:52:44 GMT
From: Shimpei Yamashita <shimpei+usenet+.mil+.gov@BOFH.patnet.caltech.edu>
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <6jsgtc$3d0@gap.cco.caltech.edu>

? the platypus {aka David Formosa}  <dformosa@st.nepean.uws.edu.au> writes:
>
>Beg parden?  GCC seems to me to produce some of the fastest code I've come
>across.

gcc *is* uniformly slower at compiling code than vendor compilers on
every platform I've tried it on. Of course, this is becoming
increasingly less relevant thanks to the astonishingly fast
microprocessors of today.  As for generated code, it depends. I
understand it does a good job with 486 code, but UltraSparc
optimization leaves a lot to be desired wrt Sun's compiler, and ditto
for PowerPC. I understand the Alpha backend also could use some
improvement. gcc's *real* advantages are the cross-platform support
(try getting another compiler that has the exact same features on
umpteen different platforms), excellent debugging messages (haven't
yet seen a compiler that gives more helpful messages than -Wall on
gcc), and the fact that it comes with source code.

-- 
Shimpei Yamashita               <http://www.patnet.caltech.edu/%7Eshimpei/>
perl -w -e '$_="not a perl hacker\n";$q=qq;(.);x9;$qq=qq;345123h896789,;;;$s=
pack(qq;H6;,q;6a7573;);$qq=qq;s,^$q,$s$qq;;$qq=~s;(\d);\$$1;g;eval$qq;print;'


------------------------------

Date: 19 May 1998 13:02:36 -0500
From: les@MCS.COM (Leslie Mikesell)
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <6jshfs$5h3$1@Jupiter.Mcs.Net>

In article <3561b53c.0@news.one.net>, Mike Heins <mikeh@minivend.com> wrote:
>Leslie Mikesell <les@MCS.COM> wrote:
>
>PostgreSQL has major speed/scalability problems, in my opinion. It is more
>than an order of magnitude slower than I would expect a database to be.

Is this still true for the 6.3.x version?  Are you measuring start-up
time for cgi hits, large joins, or what?

>I like MySQL. Fast, free, support available, source available, and
>getting better all of the time. It is moving nicely toward the point
>where I would use it for mission-critical systems.

Does it support transactions yet?  Sub-selects?

  Les Mikesell
   les@mcs.com


------------------------------

Date: 19 May 1998 17:18:16 GMT
From: lvirden@cas.org
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <6jseso$mj2$1@srv38s4u.cas.org>


According to Michael J Gebis <gebis@albrecht.ecn.purdue.edu>:
:(a noisy newsgroup) but won't address the karmic damage being done by
:the ugly, uninformed code being written.  That isn't good for anybody.

Particularly bad is the fact that if there continues to be increasing larger
caches of karmically bad perl source code written and distributed via books,
web sites, etc., then those folk trying to follow the advice on newsgroups,
etc. to 'use the source, Luke' will increasingly be following the "dark side"
of bad perl code rather than following the "bright side" of the source...

-- 
<URL:mailto:lvirden@cas.org> Quote: In heaven, there is no panic,
<*> O- <URL:http://www.teraform.com/%7Elvirden/> only planning.
Unless explicitly stated to the contrary, nothing in this posting
should be construed as representing my employer's opinions.


------------------------------

Date: 19 May 1998 17:35:08 GMT
From: lvirden@cas.org
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <6jsfsc$oq1$1@srv38s4u.cas.org>


According to Michael J Gebis <gebis@albrecht.ecn.purdue.edu>:
:gbacon@cs.uah.edu (Greg Bacon) writes:
:
:}I wonder whether Ken or Larry or Rob or dmr or bwk use IDEs.  I would be
:}shocked to learn that they do.
:
:So if everyone was as good a programmer as Ken or Larry or Rob or dmr
:or bwk, we would have no problem.  I agree with you on this.

I heard a talk last summer by bwk - here's some pointers to some of
the work that was mentioned - from
<URL:http://www.teraform.com/%7Elvirden/tcl-faq/part2.html>

220. Benchmarks of Tcl and other scripting languages by BWK and Chris Van Wyk
can be found at <URL:http://cm.bell-labs.com/cm/cs/who/bwk/interps/pap.html>.
 
221. The paper "Experience with Tcl/Tk for Scientific and Engineering
Visualization" by BWK can be found at
<URL:http://cm.bell-labs.com/cm/cs/who/bwk/workshop.ps.gz>
(gzipped Postcript (152 kB)).



-- 
<URL:mailto:lvirden@cas.org> Quote: In heaven, there is no panic,
<*> O- <URL:http://www.teraform.com/%7Elvirden/> only planning.
Unless explicitly stated to the contrary, nothing in this posting
should be construed as representing my employer's opinions.


------------------------------

Date: 19 May 1998 18:16:07 GMT
From: Art Cohen <upsetter@shore.net>
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <6jsi97$qc7@fridge.shore.net>

Russ Allbery <rra@stanford.edu> wrote:
: Greg Bacon <gbacon@cs.uah.edu> writes:

:> Using an editor that claims to do syntax highlighting is like riding a
:> bicycle with training wheels so rickety they're bound to break at any
:> moment.  Parsing Perl is no small problem, and any editor that claims to
:> do more than a half-ass job is lying.

: You use your tools, I'll use mine.  :)  Ilya's cperl-mode does a good
: enough job for my coding style, and the syntax highlighting has caught a
: lot of bugs for me.  So has the indentation.

Ditto for BBEdit, in my case. I don't need it to parse every conceiveable
JAPH one-liner, but it's nice to have a visual cue when I've misspelled a
keyword (e.g. "Print"). 

--Art

--------------------------------------------------------------------------
                    National Ska & Reggae Calendar
            http://www.ziplink.net/~upsetter/ska/calendar.html
--------------------------------------------------------------------------


------------------------------

Date: Tue, 19 May 1998 11:51:24 -0600
From: Drew Kearns <boink@montana.com>
Subject: Re: Dowload Script Problem
Message-Id: <3561C69C.7AFA@montana.com>

Alan K'necht wrote:
> 
> I'm trying to setup up a page that will allow a user to download files
> based on their selection from a pull down menu. The problem that I'm
>...
>$selection = $in{'selection'};
>print "Location: $selection\n\n";

You might try to send the file back manually:
$selection = $in{'selection'};
open RETFILE, $selection) or die "Can't open file";
	
print "Content-type: application/octet-stream\n";
print "Content-Disposition: attachment; filename=$selection\n";
print "Content-Length: " . 

-- 
*********************************
**         Drew Kearns         **
**        boink@imt.net        **
** http://dforest.freemail.com **
*********************************


------------------------------

Date: Tue, 19 May 1998 11:59:37 -0600
From: Drew Kearns <boink@montana.com>
Subject: Re: Dowload Script Problem
Message-Id: <3561C889.616E@montana.com>

Whoops - sorry about that.  Finished example:

$selection = $in{'selection'};
$buffer = "";
open RETFILE, $selection) or die "Can't open file";
$buffer .= $_ while defined($_ = <RETFILE>);
close RETFILE;
print "Content-type: application/octet-stream\n";
print "Content-Disposition: attachment; filename=$selection\n";
print "Content-Length: " . length($buffer) . "\n\n";
print $buffer;

You could replace 'application/octet-stream' with other MIME types
if you want, but octet-stream should always bring up the
'save-as' dialog.


------------------------------

Date: Tue, 19 May 1998 11:01:20 -0700
From: John Hong <john_hong@Non-HP-USA-om42.om.hp.com>
Subject: Exiting chunk mode.
Message-Id: <3561C8F0.FC338335@Non-HP-USA-om42.om.hp.com>

I can turn on chunk mode with:  $/ = ".\n";
But how do I turn it off?

I want it On during the subroutine (fileCreation), but off in the main
while loop.



------------------------------------------------------------------------------

$inputfiles = "temp3.txt";                #file containing filenames to
work on

open(THATFILE, "$inputfiles") ||  #opens local file for input
  die "cannot open $inputfiles";

while (<THATFILE>)   #loops down file line by line until eof.
{
##########   INSERT CHUNK MODE OFF HERE! ##############
 $file = "$_";   #Assigns line to $filename.
 chop $file;
 $new = "x_"."$file";
   &fileCreation;   #Calls function to create output file.
   #rename ("$new", "$file");
 #print "$file";
}
close(THATFILE);


sub fileCreation
{
 $/ = ".\n";                       #chunk mode ON
   open (IN, "$file") || die "cannot open $file for reading";
   open (OUT, ">$new") || "cannot create outfile";

 while (<IN>)   #loops down file line by line until eof.
 {
  s/<SCRIPT>.*?<\/SCRIPT>//igs;
  s/<noscript>.*?<\/noscript>//igs;
  print OUT $_;
 }
   close(IN);
   close(OUT);
}



------------------------------

Date: Tue, 19 May 1998 11:25:37 -0700
From: "Larry Rosler" <lr@hpl.hp.com>
Subject: Re: Exiting chunk mode.
Message-Id: <6jsir4$rvs@hplntx.hpl.hp.com>

[posted and emailed]

John Hong wrote in message
<3561C8F0.FC338335@Non-HP-USA-om42.om.hp.com>...
>I can turn on chunk mode with:  $/ = ".\n";
>But how do I turn it off?
>
>I want it On during the subroutine (fileCreation), but off in the main
>while loop.
 ...
>sub fileCreation
>{
> $/ = ".\n";                       #chunk mode ON


  local $/ = ".\n";                 #chunk mode ON

 ...

--
Larry Rosler
Hewlett-Packard Laboratories
lr@hpl.hp.com





------------------------------

Date: 19 May 1998 18:36:31 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Exiting chunk mode.
Message-Id: <6jsjff$ofq$1@marina.cinenet.net>

John Hong (john_hong@Non-HP-USA-om42.om.hp.com) wrote:
: I can turn on chunk mode with:  $/ = ".\n";
: But how do I turn it off?
: 
: I want it On during the subroutine (fileCreation), but off in the main
: while loop.

Just localize the change:

  {
    local $/ = ".\n";
    # Do stuff needing this...
  }

  # $/ has reverted to previous value after leaving the block.

You can either localize it inside the subroutine, or in a block around the
subroutine call, depending on the requirements of your design. 

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      Member of The HTML Writers Guild: http://www.hwg.org/   
       "Every man and every woman is a star."


------------------------------

Date: Tue, 19 May 1998 13:44:35 -0400
From: "Mark J. Seger" <seger@hydra.mro.dec.com>
Subject: Finding wnt drives
Message-Id: <3561C502.5DFFD11@hydra.mro.dec.com>

I want to write a scrip that searches ALL my drives.  Is there some
simple mechanism to identify all my drives?  Naturally I want to be able
to identify which are local and which are networked.  Also I want to be
able to exclude the cd-rom and floppies as well.

-mark




------------------------------

Date: 19 May 1998 18:01:11 GMT
From: colnet@loria.fr (Dominique Colnet)
Subject: Re: how to call SmallEiffel classes from Perl?
Message-Id: <6jshd7$fmp$1@muller.loria.fr>

I have just post a hack to do this in our mailing list.

Personal Message for gary@ashton-jones.com.au :
-----------------------------------------------
I am not sure, but your registered e-mail in the mailing
list seems to cause problems :-(
Do you copy the list ?
If not, please send a mail to giese@loria.fr 
-- 
--------------------------------------------------------------
Dominique COLNET -- UHP (Nancy 1) -- LORIA -- INRIA Lorraine
http://www.loria.fr/SmallEiffel -- The  GNU  Eiffel  Compiler
POST: Loria, B.P. 239,54506 Vandoeuvre les Nancy Cedex, FRANCE
EMAIL: colnet@loria.fr Voice:+33 0383593079 Fax:+33 0383413079


------------------------------

Date: 19 May 1998 17:14:09 GMT
From: klassa@aursgh.aur.alcatel.com (John Klassa)
Subject: Re: Is this WEB-BASED mail script good?
Message-Id: <6jsel1$flh$1@aurwww.aur.alcatel.com>

Paul van der Pan <vanderpan@hotmail.com> wrote:
->I found this perl cgi-script for Web based email (should work on Linux) on
->the net,
->can somebody tell me if there are big security holes in this script?

<700+ line script deleted>

Gee, how about we just rewrite it for you while we're at it?  This is akin
to posting a 10-page term paper to the net and asking if we see any holes
in your arguments.

Do your own work.

-- 
John Klassa / Alcatel Telecom / Raleigh, NC, USA <><


------------------------------

Date: 19 May 1998 17:09:47 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: New Math Modules
Message-Id: <6jsecr$i91$2@marina.cinenet.net>

Ala Qumsieh (aqumsieh@matrox.com) wrote:
: A couple of more functions do symbolic integration and differentiation. So:
: 
:         $expr = '3x^2 - 5x';
:         $result1 = deriv($expr);      # $result1 will now contain '6x^1 -
: 5x^0'
:         $result2 = integ($expr);      # $result2 will now contain 'x^3 -
: 2.5x^2'

Looks potentially useful and interesting.  I might suggest adding a
parameter to both deriv() and integ() naming the variable to
integrate/differentiate with respect to.

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      Member of The HTML Writers Guild: http://www.hwg.org/   
       "Every man and every woman is a star."


------------------------------

Date: Tue, 19 May 1998 15:00:47 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: New Math Modules
Message-Id: <comdog-ya02408000R1905981500470001@news.panix.com>
Keywords: from just another new york perl hacker

In article <6jsecr$i91$2@marina.cinenet.net>, cberry@cinenet.net (Craig Berry) posted:

>Ala Qumsieh (aqumsieh@matrox.com) wrote:
>: A couple of more functions do symbolic integration and differentiation. So:
>: 
>:         $expr = '3x^2 - 5x';
>:         $result1 = deriv($expr);      # $result1 will now contain '6x^1 -
>: 5x^0'
>:         $result2 = integ($expr);      # $result2 will now contain 'x^3 -
>: 2.5x^2'
>
>Looks potentially useful and interesting.  I might suggest adding a
>parameter to both deriv() and integ() naming the variable to
>integrate/differentiate with respect to.

and what about definite vs. indefinate integration and derivatives
evaluated at a point?  perhaps even more parameters.

just out of curiosity, what happens with expressions like:

   x^x          # does it parse this correctly?
   cos(sin(x))  # does it do any trig?

what's the backend for this?  are you hooking this up to the Mathematica
engine or something?

just curious :)

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers T-shirts! <URL:http://www.pm.org/tshirts.html>


------------------------------

Date: Tue, 19 May 1998 15:36:02 GMT
From: jdporter@min.net (John Porter)
Subject: Re: Non-static private variables
Message-Id: <MPG.fcb7265222513149896d1@news.min.net>

On 18 May 1998 23:40:19 GMT,
in article <6jqgt3$ml4$1@news.nyu.edu>,
gyl8384@omicron.acf.nyu.edu (George Y. Lembersky) wrote:
> I was wondering if anyone knew how to create a non-static (instance) 
> private variable in a Perl class. 
> 
> As I understand Perl classes are just packages, which are just name
> spaces.  And instances of these classes are references to thingies which
> are scalars, hashes or arrays. 

But what makes an object (instance) different from any other reference?
A.: it has been specially tagged as being an instance of a class, by
    the action of the 'bless' operator, q.v.

> If this is all there is to an instance of a class...

But it's not...

> then all of its variables must be stored in the arrays or hashes
> and these are visible by the package that instantiated this class.  

No, an object (blessed reference variable) can be in any namespace,
or even a lexical ('my') variable.  It does *NOT* live in the
package's namespace (unless you put it there, of course).  So, the
visibility of an object follows the same rules as any other variable.

> Is there any way to have instantiated variables that are private? 

As surely as there is a way to have any other kind of variable to
be private.  (By that I assume you mean lexically scoped.)

> The variables inside the package are static - they are the same
> across all instances. 

Such variables are called "package" variables, or sometimes "global"
variables, since they are visible globally.  "Static" is not a word
in the Perl lexicon.

Note that namespaces, like variables, spring into existence on
first use.  That means you can create and use a package without
ever mentioning the word "package".  Notice:

$Alpha::foo = 1;
# Wow, just created a namespace named 'Alpha'.

sub Beta::new {
  my $p = shift;
  bless { @_ }, $p;
}
# And now package 'Beta' exists...

my $obj = bless \%args, 'Gamma';
# Hmmm, $obj is now an object of class 'Gamma'!


Here's a short example:

package Foo;
  sub new {
    my $p = shift;
    bless { @_ }, $p;
  }

package main;
  sub bar {
    my $obj_1 = new Foo;
    $obj_2 = new Foo;
  }

Here, $obj_1 is a lexically scoped variable (object reference),
which dies at the end of sub 'bar'. (More precisely, its
reference count gets decremented, etc.)
$obj_2 is a global (package) variable, in the package 'main'.
Even though they're both objects of class 'Foo', neither one
is a variable in the 'Foo' namespace.

Now, go read perlref and perlobj for the full scoop.

hth,
John Porter






------------------------------

Date: Tue, 19 May 1998 18:32:15 GMT
From: Jacqui Caren <Jacqui.Caren@ig.co.uk>
Subject: Re: ODBC/DBI on WIN32 host
Message-Id: <Et7vHr.FrB@ig.co.uk>

In article <353FAC94.4B0E@daytonoh.ncr.com>,
Dennis Kowalski  <dennis.kowalski@daytonoh.ncr.com> wrote:
>2nd try.  My 1st posting disappeared.
>
>I am running on a NT 4.0 host.
>
>Can anyone tell me what version of Perl of modules I need to have in
>order to use the ODBC or DBI interfaces to acces an ORACLE database from
>a perl program ??
>
>I am currently using build 316 from ActiveWare.

This is your problem. - You will need Dave ROths Win32::ODBC
if you wish to use the ActiveState perl with oracle.

DBD::Oracle and DBD::ODBC will not work with the ActiveState perl,
but both work with the "standard" perl under both UNIXen and NT.

the hermetica link is th ebest place to start with DBI...

>Thanks (again)

All the best,
	Jacqui
-- 
Email: Jacqui.Caren@ig.co.uk  http://www.ig.co.uk/
Fax  : +44 1483 419 419       http://www.perlclinic.com/
Phone: +44 1483 424 424       http://www.perl.co.uk/
Paul Ingram Group Ltd,140A High Street,Godalming GU7 1AB United Kingdom



------------------------------

Date: Tue, 19 May 1998 17:42:49 GMT
From: gwebb@reedtech.com
Subject: Re: Perl Not Showing Errors
Message-Id: <6jsgaq$65c$1@nnrp1.dejanews.com>

 > I think I have seen it with quite recent Perls.  Some $@-overwrite
> is possible still.  If some object is DESTROYed before the error
> message has a chance to be shown, $@ may be overwritten.

You were right.  I checked out my code and it turns out that a module I was
"use"-ing had a BEGIN block in it that was assigning a function to handle WARN
signals.  This function was then dumping the error message.  Because "perl -c"
still executes BEGIN blocks it was installing this handler that was throwing
away my error messages.


thanks,
Garth

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


------------------------------

Date: Tue, 19 May 1998 17:00:38 GMT
From: Jon Walsh <prophet@skepticult.org>
Subject: Re: Perl terminology
Message-Id: <m3yavy8aca.fsf@localhost.localdomain>

Liz Castro <Liznet@cookwood.com> writes:

<snip>
> Is there a book that starts at the _very_ beginning? (I have the camel and
> llama and a bunch of others, but they all assume the reader is already a
> programmer) Maybe I need a beginning programming book? Any suggestions?

The Waite Group's Perl 5 book assumes no prior knowledge and is written 
really well for a beginner. It does skimp on a few important areas, but
you'll be able to get the info from the man pages and your other books
once you know what to look for.

HTH.

-- 
Sir Dr. Jon "Big Dave" Walsh, Bsd.     | Email : <prophet@skepticult.org>
Certified Psychic and Healtheologist   | WWW   :  http://www.skepticult.org
True/False Prophet and Fearless Leader | IRC   :  Undernet #skepticult
SKEP-TI-CULT. Worldwide Cabal          | Usenet:  alt.fan.bruce-kettler


------------------------------

Date: 19 May 1998 17:15:41 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Perl terminology
Message-Id: <6jsent$qe0$2@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    Jon Walsh <prophet@skepticult.org> writes:
:The Waite Group's Perl 5 book assumes no prior knowledge 

I think that's misrepresentative.  

--tom
-- 
Steinbach's Guideline for Systems Programming
        Never test for an error condition you don't know how to
        handle.


------------------------------

Date: Tue, 19 May 1998 17:52:33 GMT
From: David Corcoran <david.x.corcoran@boeing.com>
To: Liznet@cookwood.com
Subject: Re: Perl terminology
Message-Id: <3561C6E1.24A7@boeing.com>

Liz Castro wrote:
> 
> If scripts are written in Perl, the programming language, what's the Perl that
> you _install_ called--that is the MacPerl, or whatever local version you have
> to compile (?), interpret (?), run (?) your scripts. Is it the "Perl
> interpreter", the "Perl compiler" or the "Perl program"? Am I being too picky
> wanting a word for this? Do you all (e.g., seasoned programmers...) just call
> it "Perl"? What if you wanted to describe it in more detail?
> 
> Is there a book that starts at the _very_ beginning? (I have the camel and
> llama and a bunch of others, but they all assume the reader is already a
> programmer) Maybe I need a beginning programming book? Any suggestions?
> 
> Thanks.

TINAE (this is not an endorsement)

But I came across this site once in the distant past (3 mos)

http://www.webdesigns1.com/perl


------------------------------

Date: Tue, 19 May 1998 12:13:28 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: reading file into an array of hash
Message-Id: <3561AFA8.7B2260EB@matrox.com>

brian d foy wrote:

> >Could've saidmy ($textBlock, $i);
>
> isn't it a bit ridiculous to get this picky?  i sometimes prefer
> that style because it's easy to comment out the one line then
> modify another.  still  good comments get drowned out in a sea
> of stylistic and pedantic nits...
>

I wasn't trying to be picky .. sorry for the confusion. I was simply trying to show him
another way to do things. I wasn't very much aware of the difference between:

my $var1, $var2;
and
my ($var1, $var2);

(and I still make this mistake!) .. but personally I like to know of little hacks that
will eventually cause my programs to grow smaller in size.  (someone else might share
the same interest!)
Also note that I said " Could've" .. not "Should've" !!

--
Ala Qumsieh             |  No .. not just another
ASIC Design Engineer    |  Perl Hacker!!!!!
Matrox Graphics Inc.    |
Montreal, Quebec        |  (Not yet!)





------------------------------

Date: 19 May 1998 17:13:22 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: regexp: replacing new line followed by "+"
Message-Id: <6jseji$i91$3@marina.cinenet.net>

Mark-Jason Dominus (mjd@op.net) wrote:
: You should try to avoid this.  The line-by-line reading and the `join'
: are slow if all you want is t oget the data into a single scalar.
: 
: { local $/ = undef; $File = <FH> }
: 
: is always a lot faster.

And since localizing a variable leaves it undefined by definition, you can
even abbreviate the above as

  { local $/; $File = <FH> }

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      Member of The HTML Writers Guild: http://www.hwg.org/   
       "Every man and every woman is a star."


------------------------------

Date: Tue, 19 May 1998 11:59:07 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: TIMTOWTDI - regex vs. if (function)
Message-Id: <3561AC4A.6A2FBCFC@matrox.com>

brian d foy wrote:

> In article <355C5C10.97247F07@matrox.com>, Ala Qumsieh <aqumsieh@matrox.com> posted:
>
> >Ward Kaatz wrote:
> >
> >> I considered but avoided use of (s)printf based on the camel book
> >> observation (pg 200, 2nd ed.).
> >
> >I don't see any considerations about using sprintf on that page of the
> >camelbook .. or on any other page for that matter!!!
>
> it's in the text for the printf function.  i beleive he refers to the
> last sentence on the page.  sometimes, if things are immediately
> apparent, a closer reading is warranted.

I still don't see any mentioning of *sprintf* ;-)

They talk about using print instead of printf .. but

not using print instead of sprintf (which is not very useful!)

--
Ala Qumsieh             |  No .. not just another
ASIC Design Engineer    |  Perl Hacker!!!!!
Matrox Graphics Inc.    |
Montreal, Quebec        |  (Not yet!)





------------------------------

Date: Tue, 19 May 1998 13:54:57 -0500
From: Bob Carroll <rlcarro@escher.ppco.com>
Subject: unpacking signed network ints
Message-Id: <3561D580.E114F634@escher.ppco.com>

"unpack" provides two useful format characters for network
order integers:  "n" for shorts, and "N" for longs.  The
problem is that "unpack" implements them only as unsigned.
The same is true for "V" and "v".

Two problems...

The documentation could be more specific and state that
these produce unsigned results.

----and----

It would be helpful to have format characters that will produce
signed results.

Here is an example of the problem.
$ perl -w
$buf = pack ( "N", -1 ) ;
$val = unpack ( "N", $buf ) ;
print "$val\n" ;
^D
4294967295


Bob Carroll





------------------------------

Date: Tue, 19 May 1998 17:23:23 GMT
From: phenix@interpath.com (John Moreno)
Subject: Re: while, each & assoc array
Message-Id: <1d9a243.hqd3bxkt8zv6N@roxboro0-041.dyn.interpath.net>

John Porter <jdporter@min.net> wrote:

> phenix@interpath.com (John Moreno) wrote:
> > 
> > Yeah, I don't know who should be given the credit for it, but perls
> > alternative for the single statement  (statement condition;) is much
> > better.
> 
> What, you're thinking it might be someone other than Larry?

I wasn't there and am a relative newcomer to perl, but I doubt he worked
on it in total isolation - so I was assuming it was Larry but was CMA in
case somebody else suggested it to him.

-- 
John Moreno


------------------------------

Date: Tue, 19 May 1998 09:40:12 -0500
From: "Steve Cantrell" <steve.cantrell@sematech.org>
Subject: WIN32 - Minimizing the shell window
Message-Id: <6js5ke$e67@pulitzer.eng.sematech.org>

Hello,

Forgive me if this question is documented, but I didn't see it in the FAQ.

When executing a script in the WIN32 environment, my scripts run in a DOS
shell. Is there a way to have that window automatically minimize when the
script starts, as part of the Perl script?

Thanks!

Steve Cantrell
steve.cantrell@sematech.org




------------------------------

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 2641
**************************************

home help back first fref pref prev next nref lref last post