[16974] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4386 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Sep 20 14:05:35 2000

Date: Wed, 20 Sep 2000 11:05:16 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <969473116-v9-i4386@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Wed, 20 Sep 2000     Volume: 9 Number: 4386

Today's topics:
        [help] Large datasets in Perl (anyone implemented bit f <asher@zedxinc.com>
    Re: [help] Large datasets in Perl (anyone implemented b (Abigail)
        Any tree building algorithm in Perl? <jong@ebi.ac.uk>
    Re: Candidate for the top ten perl mistakes list <sb@muccpu1.muc.sdm.de>
    Re: Candidate for the top ten perl mistakes list <jeffp@crusoe.net>
    Re: Candidate for the top ten perl mistakes list (Abigail)
    Re: Candidate for the top ten perl mistakes list <russ_jones@rac.ray.com>
    Re: Candidate for the top ten perl mistakes list (Rafael Garcia-Suarez)
    Re: Candidate for the top ten perl mistakes list (Abigail)
    Re: Candidate for the top ten perl mistakes list <camerond@mail.uca.edu>
    Re: Candidate for the top ten perl mistakes list <uri@sysarch.com>
    Re: Candidate for the top ten perl mistakes list <russ_jones@rac.ray.com>
    Re: Candidate for the top ten perl mistakes list <anmcguire@ce.mediaone.net>
    Re: Candidate for the top ten perl mistakes list <godzilla@stomp.stomp.tokyo>
        Content-type willyboyweb@my-deja.com
    Re: Cygwin Perl failing - please help <mayers@bmc.com>
        DBI and MS Access <umrigas@cc.umanitoba.ca>
    Re: Email.pm and file attachments <mcc1312@yahoo.com>
    Re: File Parsing, Skipping lines (Helgi Briem)
    Re: Help, need to compair PC date with a date in a vari <ren.maddox@tivoli.com>
    Re: How do I shut down an oracle database from perl scr <anmcguire@ce.mediaone.net>
        How to call a Perlscript ( SSI ) within a Javascript ? <whofer@dplanet.ch>
    Re: How to call a Perlscript ( SSI ) within a Javascrip <jaap@stack.nl>
        How to Capture Specific Whitespace? beach9000@hotmail.com
    Re: I need help with arrays. (Gwyn Judd)
    Re: I need help with arrays. (Abigail)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Wed, 20 Sep 2000 12:18:45 -0400
From: "David Christopher Asher" <asher@zedxinc.com>
Subject: [help] Large datasets in Perl (anyone implemented bit fields?)
Message-Id: <Cp5y5.15$bx3.596@client>

Hi!

I need to work with some large 2D arrays at pretty high resolution, and I am
having trouble because of memory issues.  (like wanting to allocate 4GB of
memory).  It's only a boolean value, but Perl's typeless data makes it hard
to economize.

Has anyone written a class or something that handles boolean arrays?  Any
advice on how I can get around this problem?  I am considering rewriting it
in C, but I don't want to do that until I've exhausted the possibilities
with Perl.

Thanks!

--
David Christopher Asher





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

Date: 20 Sep 2000 16:26:15 GMT
From: abigail@foad.org (Abigail)
Subject: Re: [help] Large datasets in Perl (anyone implemented bit fields?)
Message-Id: <slrn8shp70.5fq.abigail@alexandra.foad.org>

David Christopher Asher (asher@zedxinc.com) wrote on MMDLXXVII September
MCMXCIII in <URL:news:Cp5y5.15$bx3.596@client>:
,, Hi!
,, 
,, I need to work with some large 2D arrays at pretty high resolution, and I am
,, having trouble because of memory issues.  (like wanting to allocate 4GB of
,, memory).  It's only a boolean value, but Perl's typeless data makes it hard
,, to economize.
,, 
,, Has anyone written a class or something that handles boolean arrays?  Any
,, advice on how I can get around this problem?  I am considering rewriting it
,, in C, but I don't want to do that until I've exhausted the possibilities
,, with Perl.


You might want to use into the PDL module, or just use vec().




Abigail
-- 
$"=$,;*{;qq{@{[(A..Z)[qq[0020191411140003]=~m[..]g]]}}}=*_=sub{print/::(.*)/};
$\=$/;q<Just another Perl Hacker>->();


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

Date: Wed, 20 Sep 2000 18:23:01 +0100
From: "J. H. Park" <jong@ebi.ac.uk>
Subject: Any tree building algorithm in Perl?
Message-Id: <39C8F275.87AB3234@ebi.ac.uk>

Hi

I wonder if there is any tree building algorithm in Perl
to show trees which have this kind of data:



1.1.1
1.1.2
1.2.3
2.1.1
2.1.3


The result should be something like:


1--1--1
|  |
|  1--2
|
|--2--3  

2--1--1
   |
   1--3


Preferably the result can be in graphics format so that
it looks more beautiful.

Thanks a lot


Cheers,

Jong





--
"It is easier to fight for principles than to live up to them."
-- Alfred Adler


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

Date: 20 Sep 2000 15:13:40 GMT
From: Steffen Beyer <sb@muccpu1.muc.sdm.de>
Subject: Re: Candidate for the top ten perl mistakes list
Message-Id: <8qak74$a47$1@solti3.sdm.de>

In article <39C8C38F.249B821B@rac.ray.com>, Russ Jones <russ_jones@rac.ray.com> wrote:

> 1: didn't use -w
> 2: didn't use strict
> 3: didn't test the results of an "open"
> 4: listened to anything godzilla said

  5: didn't read perldoc -f localtime

and wonders why his month is off by one, or why his year is 19100... :-(

Cheers,
-- 
    Steffen Beyer <sb@engelschall.com>
    http://www.engelschall.com/u/sb/whoami/ (Who am I)
    http://www.engelschall.com/u/sb/gallery/ (Fotos Brasil, USA, ...)
    http://www.engelschall.com/u/sb/download/ (Free Perl and C Software)


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

Date: Wed, 20 Sep 2000 11:32:33 -0400
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: Re: Candidate for the top ten perl mistakes list
Message-Id: <Pine.GSO.4.21.0009201131470.15465-100000@crusoe.crusoe.net>

>> 1: didn't use -w
>> 2: didn't use strict
>> 3: didn't test the results of an "open"
>> 4: listened to anything godzilla said
>  5: didn't read perldoc -f localtime
   6: uses @array[$index] where $array[$index] should be used

-- 
Jeff "japhy" Pinyan     japhy@pobox.com     http://www.pobox.com/~japhy/
PerlMonth - An Online Perl Magazine            http://www.perlmonth.com/
The Perl Archive - Articles, Forums, etc.    http://www.perlarchive.com/
CPAN - #1 Perl Resource  (my id:  PINYAN)        http://search.cpan.org/



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

Date: 20 Sep 2000 15:40:10 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Candidate for the top ten perl mistakes list
Message-Id: <slrn8shmgj.5fq.abigail@alexandra.foad.org>

Jeff Pinyan (jeffp@crusoe.net) wrote on MMDLXXVII September MCMXCIII in
<URL:news:Pine.GSO.4.21.0009201131470.15465-100000@crusoe.crusoe.net>:
$$ >> 1: didn't use -w
$$ >> 2: didn't use strict
$$ >> 3: didn't test the results of an "open"
$$ >> 4: listened to anything godzilla said
$$ >  5: didn't read perldoc -f localtime
$$    6: uses @array[$index] where $array[$index] should be used


Nah. The latter seldomly leads to an error.



Abigail
-- 
echo "==== ======= ==== ======"|perl -pes/=/J/|perl -pes/==/us/|perl -pes/=/t/\
 |perl -pes/=/A/|perl -pes/=/n/|perl -pes/=/o/|perl -pes/==/th/|perl -pes/=/e/\
 |perl -pes/=/r/|perl -pes/=/P/|perl -pes/=/e/|perl -pes/==/rl/|perl -pes/=/H/\
 |perl -pes/=/a/|perl -pes/=/c/|perl -pes/=/k/|perl -pes/==/er/|perl -pes/=/./;


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

Date: Wed, 20 Sep 2000 10:52:44 -0500
From: Russ Jones <russ_jones@rac.ray.com>
Subject: Re: Candidate for the top ten perl mistakes list
Message-Id: <39C8DD4C.2FD4B394@rac.ray.com>

Abigail wrote:
> 
> Jeff Pinyan (jeffp@crusoe.net) wrote on MMDLXXVII September MCMXCIII in
> <URL:news:Pine.GSO.4.21.0009201131470.15465-100000@crusoe.crusoe.net>:
> $$ >> 1: didn't use -w
> $$ >> 2: didn't use strict
> $$ >> 3: didn't test the results of an "open"
> $$ >> 4: listened to anything godzilla said
> $$ >  5: didn't read perldoc -f localtime
> $$    6: uses @array[$index] where $array[$index] should be used
> 
> Nah. The latter seldomly leads to an error.
> 
> Abigail

And -w would have caught it.



Seldomly?

-- 
Russ Jones - HP OpenView IT/Operatons support
Raytheon Aircraft Company, Wichita KS
russ_jones@rac.ray.com 316-676-0747

Quae narravi, nullo modo negabo. - Catullus


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

Date: Wed, 20 Sep 2000 16:18:14 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: Candidate for the top ten perl mistakes list
Message-Id: <slrn8shp6d.uoc.rgarciasuarez@rafael.kazibao.net>

Abigail wrote in comp.lang.perl.misc:
>$$ >> 1: didn't use -w
>$$ >> 2: didn't use strict
>$$ >> 3: didn't test the results of an "open"
>$$ >> 4: listened to anything godzilla said
>$$ >  5: didn't read perldoc -f localtime
>$$    6: uses @array[$index] where $array[$index] should be used
>
>Nah. The latter seldomly leads to an error.

So it should go in the top ten perl annoying bad style constructs list,
along with:
  1. print "$x";
  2. C-style loops (especially where a map or a join would jave done the
     job)
  3. include library files in the main namespace with "require" where a
     module should have been defined
  4. Lots of backslashes in strings and regexps instead of using the
     quote-like operators
  5. ...

-- 
# Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/
print map substr($_,7).&$_,grep defined &$_,sort values %::;
sub Just {' another '}; sub Perl {" hacker,\n"};


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

Date: 20 Sep 2000 16:21:50 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Candidate for the top ten perl mistakes list
Message-Id: <slrn8shoun.5fq.abigail@alexandra.foad.org>

Russ Jones (russ_jones@rac.ray.com) wrote on MMDLXXVII September MCMXCIII
in <URL:news:39C8DD4C.2FD4B394@rac.ray.com>:
|| Abigail wrote:
|| > 
|| > Jeff Pinyan (jeffp@crusoe.net) wrote on MMDLXXVII September MCMXCIII in
|| > <URL:news:Pine.GSO.4.21.0009201131470.15465-100000@crusoe.crusoe.net>:
|| > $$ >> 1: didn't use -w
|| > $$ >> 2: didn't use strict
|| > $$ >> 3: didn't test the results of an "open"
|| > $$ >> 4: listened to anything godzilla said
|| > $$ >  5: didn't read perldoc -f localtime
|| > $$    6: uses @array[$index] where $array[$index] should be used
|| > 
|| > Nah. The latter seldomly leads to an error.
|| > 
|| > Abigail
|| 
|| And -w would have caught it.
|| 
|| Seldomly?


How often do you see a program here where the cause of something not
working was the use of @array[$index] vs $array[$index]?



Abigail
-- 
sub f{sprintf$_[0],$_[1],$_[2]}print f('%c%s',74,f('%c%s',117,f('%c%s',115,f(
'%c%s',116,f('%c%s',32,f('%c%s',97,f('%c%s',0x6e,f('%c%s',111,f('%c%s',116,f(
'%c%s',104,f('%c%s',0x65,f('%c%s',114,f('%c%s',32,f('%c%s',80,f('%c%s',101,f(
'%c%s',114,f('%c%s',0x6c,f('%c%s',32,f('%c%s',0x48,f('%c%s',97,f('%c%s',99,f(
'%c%s',107,f('%c%s',101,f('%c%s',114,f('%c%s',10,)))))))))))))))))))))))))


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

Date: Wed, 20 Sep 2000 11:32:57 -0500
From: Cameron Dorey <camerond@mail.uca.edu>
Subject: Re: Candidate for the top ten perl mistakes list
Message-Id: <39C8E6B9.78858733@mail.uca.edu>

Abigail wrote:
> 
> Jeff Pinyan (jeffp@crusoe.net) wrote on MMDLXXVII September MCMXCIII in
> <URL:news:Pine.GSO.4.21.0009201131470.15465-100000@crusoe.crusoe.net>:
> $$ >> 1: didn't use -w
> $$ >> 2: didn't use strict
> $$ >> 3: didn't test the results of an "open"
> $$ >> 4: listened to anything godzilla said
> $$ >  5: didn't read perldoc -f localtime
> $$    6: uses @array[$index] where $array[$index] should be used
> 
> Nah. The latter seldomly leads to an error.

OK: 6a: expects to run a perl program using a web browser as environment

Cameron

-- 
Cameron Dorey
Associate Professor of Chemistry
University of Central Arkansas
Phone: 501-450-5938
camerond@mail.uca.edu


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

Date: Wed, 20 Sep 2000 17:07:30 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Candidate for the top ten perl mistakes list
Message-Id: <x7pulzc7ql.fsf@home.sysarch.com>

>>>>> "A" == Abigail  <abigail@foad.org> writes:

  A> Russ Jones (russ_jones@rac.ray.com) wrote on MMDLXXVII September MCMXCIII
  A> in <URL:news:39C8DD4C.2FD4B394@rac.ray.com>:
  A> || Abigail wrote:
  A> || > Nah. The latter seldomly leads to an error.
  A> || 
  A> || Seldomly?


  A> How often do you see a program here where the cause of something not
  A> working was the use of @array[$index] vs $array[$index]?

he was refering to your use of the non-word seldomly. it is just seldom.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: Wed, 20 Sep 2000 12:12:19 -0500
From: Russ Jones <russ_jones@rac.ray.com>
Subject: Re: Candidate for the top ten perl mistakes list
Message-Id: <39C8EFF3.F5FE3BA4@rac.ray.com>

Abigail wrote:
> 
> Russ Jones (russ_jones@rac.ray.com) wrote on MMDLXXVII September MCMXCIII
> in <URL:news:39C8DD4C.2FD4B394@rac.ray.com>:

> || Seldomly?
> 
> How often do you see a program here where the cause of something not
> working was the use of @array[$index] vs $array[$index]?
> 

How often have you seen the word "seldomly?" 
-- 
Russ Jones - HP OpenView IT/Operatons support
Raytheon Aircraft Company, Wichita KS
russ_jones@rac.ray.com 316-676-0747

Quae narravi, nullo modo negabo. - Catullus


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

Date: Wed, 20 Sep 2000 12:24:36 -0500
From: "Andrew N. McGuire " <anmcguire@ce.mediaone.net>
Subject: Re: Candidate for the top ten perl mistakes list
Message-Id: <Pine.LNX.4.21.0009201215470.3125-100000@hawk.ce.mediaone.net>

On 20 Sep 2000, Abigail quoth:

A> Jeff Pinyan (jeffp@crusoe.net) wrote on MMDLXXVII September MCMXCIII in
A> <URL:news:Pine.GSO.4.21.0009201131470.15465-100000@crusoe.crusoe.net>:
A> $$ >> 1: didn't use -w
A> $$ >> 2: didn't use strict
A> $$ >> 3: didn't test the results of an "open"
A> $$ >> 4: listened to anything godzilla said
A> $$ >  5: didn't read perldoc -f localtime
A> $$    6: uses @array[$index] where $array[$index] should be used
A> 
A> 
A> Nah. The latter seldomly leads to an error.

I apologize for following up in this manner, but my nntp
server is ~REALLY~ bad.  Maybe 6 could be replaced with:

  6: Called Perl either perl or PERL (or called perl Perl).

As in the subject of this thread. :-)

anm
-- 
<(@)> ; $/ = q;;; for $" ( map $_ && chr() => split m~[\D+ <(@)>
<(@)> ]~ => <DATA> ) { print "@{ [ '' => '' ] }" } __END__ <(@)>
<(@)>   74 117 115 116 32 97 110 111 116 104 101 114 32    <(@)>
<(@)>      80 101 114 108 32 72 97 99 107 101 114 10       <(@)>



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

Date: Wed, 20 Sep 2000 11:04:04 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Candidate for the top ten perl mistakes list
Message-Id: <39C8FC14.4930DBE4@stomp.stomp.tokyo>

Adrian Pepper wrote:
 
> My candidate for the top ten perl mistakes list



Being a Perl 5 Cargo Cultist Copy & Paste Specialist
and believing yourself to be a programmer.


Godzilla!
-- 
Stereotypical Perl Monger.
  http://la.znet.com/~callgirl/monger.cgi


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

Date: Wed, 20 Sep 2000 17:16:24 GMT
From: willyboyweb@my-deja.com
Subject: Content-type
Message-Id: <8qarcj$2se$1@nnrp1.deja.com>

I am curious what the proper way to change or have two different
content-types outputted from one script, namely image/jpeg and
text/html. I am assigning the jpeg as a scaler taken from a database
and am not sure how to embed it in my normal text/html output.

Is there some way to switch between or combine these two statements.

print "Content-type:text/html\n\n";
print "Content-type:image/jpeg\n\n";

Thanks in advance, Willy


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 20 Sep 2000 11:02:03 -0700
From: Mike Ayers <mayers@bmc.com>
Subject: Re: Cygwin Perl failing - please help
Message-Id: <39C8FB9B.4B989F8E@bmc.com>



Leo Schalkwyk wrote:
> 
> On Tue, 19 Sep 2000 12:52:25 -0700, Mike Ayers <mayers@bmc.com> wrote:
> >
> >       Even better - here is a minimal script to reproduce the failure:
> >
> >====================8<-----------------SNIP-
> >
> >use strict;
> >use FileHandle;
> >use vars qw( $InstallDir );
> >
> >$InstallDir = qx( pwd );
> >print( $InstallDir, "\n" );
> >
> >====================8<-----------------SNIP-
> >
> >       Also, I'm on NT4SP5.  I'm now looking into using IO::File instead of
> >Filehandle, but would still appreciate any info on why the FileHandle
> >lib appears to be so unfriendly.
> 
> -the above doesn't make any use that I can see of FileHandle.

	Yes - you'd agree that this constitutes a problem, wouldn't you?  If I
take out the "use FileHandle;", then all is well.

> -on my system (perl 5.6 under cygwin 1.1 , win 98) the snippet does
> exactly the expected.  Your installation must be broken!

	Maybe - but you're running Win98, which uses a different file handling
system, so my installation may be an unbroken instance of a bad port. 
The README.cygwin for Perl-5.6.0 talks about the need for cygwin1.1,
whereas I have 1.0.  Since RedHat seems to be using Cygnus just to push
their own product, I can't get any decent info.  Do you know if a patch
for 1.0 is available, or do I just need to order 1.1?


/|/|ike

> 
> Leo


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

Date: Wed, 20 Sep 2000 06:46:33 -0500
From: Nektarios Rigas <umrigas@cc.umanitoba.ca>
Subject: DBI and MS Access
Message-Id: <39C8A399.E9F1A885@cc.umanitoba.ca>

Hello Everyone,

I'm new to perl and am about to run out an buy the Perl DCI book by
O'reilly.
But before I do, I figured I'd throw out this question.

I am planning on writing a perl script that queries an MS Access
database.
I know that this is possible on an NT server, but the server that this
script is going to run and reside on is a Linux server.  Is it possible
to store this Access DB on the linux server and have this script run
correctly?

If not, what is required?
--

============================
Thank You

          N. Rigas
          Phone: (204)885-2910
          Office: (204)885-555 ext. 281




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

Date: Wed, 20 Sep 2000 16:19:35 GMT
From: "Camelot" <mcc1312@yahoo.com>
Subject: Re: Email.pm and file attachments
Message-Id: <rs5y5.330992$8u4.3557232@news1.rdc1.bc.home.com>

i used Net::Entity to send email with attachment..............

for uploading, i use a function called read(......) which is embeded in
perl..

Michael.



"Hugo Bouckaert" <hugo@fractalgraphics.com.au> wrote in message
news:39C6CC09.231980E6@fractalgraphics.com.au...
> Hi
>
> I am trying to use the perl Email.pm module to enable me to upload files
> from a html page, then send it as an attachment to a specified email
> address. However, no matter what I try I can't get it to work.
>
> I amended a script that previously used the sendmail command to send the
> contents of forms to an email recipient, and substituted it with the
> Email::send procedure in order to make it possible to have attachments
> as well. What I would like to do is:
>
> Have a html page with form fields (textfields, textareas etc) and an
> upload file button. This html page uses a perl script to send the
> contents of these form fields plus the uploaded file as an email
> attachment to an email recipient.
>
> The amended code is pasted in here. If anyone knows what is wrong with
> it and is able so suggest corrections, that would be great.
> Alternatively, if someone has some code that is better, that would be
> most welcome also.
> Note that one of the problems I haven't been able to resolve also is how
> to put the content starting with <<MESSAGE_TO_USER (which consists of
> the form fields) in the body of the email when using the email::send
> procedure. I am new to this, so any help will be most appreciated.
>
> Thanks
>
> Hugo
>
> #!/usr/sbin/perl
>
>
#---------------------------------------------------------------------------
-
> # User variables
>
#---------------------------------------------------------------------------
-
>
>
> $emailaddress='hugo@fractalgraphics.com.au';
> $thankyoupage='http://www.fractalgraphics.com.au/fracviewer/thanks.html';
>
>
>
#---------------------------------------------------------------------------
-
> # ReadParse
> # Reads in GET or POST data, converts it to unescaped text, and puts
> # one key=value in each member of the list "@in"
> # Also creates key/value pairs in %in, using '\0' to separate multiple
> # selections
> #
> # If a variable-glob parameter (e.g., *cgi_input) is passed to
> ReadParse,
> # information is stored there, rather than in $in, @in, and %in.
>
#---------------------------------------------------------------------------
-
>
> use Email;
>
> sub ReadParse {
>   if (@_) {
>     local (*in) = @_;
>   }
>
>   local ($i, $loc, $key, $val);
>
>   # Read in text
>   if ($ENV{'REQUEST_METHOD'} eq "GET") {
>     $in = $ENV{'QUERY_STRING'};
>   } elsif ($ENV{'REQUEST_METHOD'} eq "POST") {
>     for ($i = 0; $i < $ENV{'CONTENT_LENGTH'}; $i++) {
>       $in .= getc;
>     }
>   }
>
>   @in = split(/&/,$in);
>
>   foreach $i (0 .. $#in) {
>     # Convert plus's to spaces
>     $in[$i] =~ s/\+/ /g;
>
>     # Convert %XX from hex numbers to alphanumeric
>     $in[$i] =~ s/%(..)/pack("c",hex($1))/ge;
>
>     # Split into key and value.
>     $loc = index($in[$i],"=");
>     $key = substr($in[$i],0,$loc);
>     $val = substr($in[$i],$loc+1);
>     $in{$key} .= '\0' if (defined($in{$key})); # \0 is the multiple
> separator
>     $in{$key} .= $val;
>   }
>
>   return 1; # just for fun
> }
>
>
>
#---------------------------------------------------------------------------
-
> #
> # Main procedure
> #
>
>  MAIN:
> {
>     &ReadParse(*in);
>     &ProcessForm;
> }
>
> sub ProcessForm
> {
>
>
#---------------------------------------------------------------------------
-
> #
> # Email response to someone
> #
> use Email;
> Email::send( To=>'"Hugo Bouckaert" <hugo@fractalgraphics.com.au>',
>                   From=>'"FracWeb Script" <>',
>                   Subject=>"File Upload",
>                   Body=>"Here is the file");
>                   Attachment=>["$in{'somefile'}"]);
>
> #open (MAIL, "| /usr/lib/sendmail -bm $emailaddress" );
> #print MAIL <<MESSAGE_TO_USER;
> #From: FracWeb Script
> #Subject: [Fracviewer Info Request]
> #Reply-to: $in{'Email'} ($in{'Name'})
>
>
> ----------------------------------------------------------------------
>           These details were submitted using the WWW Form
>             on the Fractal Graphics FracViewer webpage
> ----------------------------------------------------------------------
>
> Please send information about the requested product to the client's
> email address:
>
> File:          $in{'somefile'}
> Product:       $in{'Product'}
> Name:          $in{'Name'}
> Company:       $in{'Company'}
> Address:       $in{'Address'}
> Phone:         $in{'Phone'}
> Email:         $in{'Email'}
>
> The following information was also obtained from the web browser:
>
> Remote Host: $ENV{'REMOTE_HOST'}
> Remote Address: $ENV{'REMOTE_ADDR'}
>
> ----------------------------------------------------------------------
>
> MESSAGE_TO_USER
> close MAIL;
>
>
#---------------------------------------------------------------------------
-
> #
> # Generate reply for user
> #
>
> # Send the thankyou page to the submitter ...
>
> print "Location: $thankyoupage\n\n";
>
> }
>
>
>
>
>
> --
> Dr Hugo Bouckaert
> R&D Support Engineer, Fractal Graphics
> 39 Fairway, Nedlands Western Australia 6009
> Tel: 9284 8442
> Email:hugo@fractalgraphics.com.au
> Web: http://www.fractalgraphics.com.au




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

Date: Wed, 20 Sep 2000 16:01:23 GMT
From: helgi@NOSPAMdecode.is (Helgi Briem)
Subject: Re: File Parsing, Skipping lines
Message-Id: <39c8dd16.428058205@news.itn.is>

On Tue, 19 Sep 2000 21:11:01 -0700, "Godzilla!"
<godzilla@stomp.stomp.tokyo> wrote:

>Use of 7-11 Slurpie versus Wily Coyote, hmm.. 
>
>Use of slurp versus while should be wisely decided and,
>either should be used, or both, as appropriate for a 
>script. Slurp is faster and more efficient for opening
>smaller files. As you know, use of while is better for
>saving memory when dealing with larger files, although 
>you sacrifice some speed contrasting a sacrifice of
>some memory for a slurp loop construct.

Not so.  I timed both for a 1,278,512 byte file
20 times each and got this output

while took:  
9 wallclock secs ( 8.50 usr +  0.22 sys =  8.72 CPU)
slurp took: 
12 wallclock secs (11.76 usr +  0.24 sys = 12.00 CPU)


<Script pasted below>

#!/usr/bin/perl -w
use strict;
use Benchmark;
my $bigfile = './bigfile.txt';
my $while0 = new Benchmark;
for (1..20)
{
open BIG,$bigfile or die "Cannot open $bigfile:$!\n";
while (<BIG>) {
if ($_ =~ /Great White Whale/i) { print "Moby Dick
sighted\n"; }
}
close BIG,$bigfile or die "Cannot close $bigfile:$!\n";
}
my $while1 = new Benchmark;
my $whiletime = timediff($while1,$while0);
my $slurp0 = new Benchmark;
for (1..20)
{
open BIG,$bigfile or die "Cannot open $bigfile:$!\n";
my @slurp = <BIG>;
for (@slurp)
{
   if ($_ =~ /Great White Whale/i) { print "Moby Dick
sighted\n"; }
}
close BIG,$bigfile or die "Cannot close $bigfile:$!\n";
}
 
my $slurp1 = new Benchmark;
my $slurptime = timediff($slurp1,$slurp0);
print "while took: ",timestr($whiletime), "\n";
print "slurp took: ",timestr($slurptime), "\n";




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

Date: 20 Sep 2000 10:58:53 -0500
From: Ren Maddox <ren.maddox@tivoli.com>
Subject: Re: Help, need to compair PC date with a date in a variable.
Message-Id: <m3g0mvukaq.fsf@dhcp11-177.support.tivoli.com>

"Matt King" <mattking@techie.com> writes:

> Thanks! The first script worked like a charm, however 788 lines into the
> processing (4000+ lines need to be processed), Perl aborts with the
> following error:
> Month -1 out of range 0..11
> And the line with the error is:
> my $elapsed = time - timelocal($sec, $min, $hour, $mday, $mon-1, $year);
> The date on that line is: 10.09.00 12:44:33

Hmm... any chance there is a space at the beginning of that line?
That would certainly mess things up.  If the data format isn't quite
as clean as "DD.MM.YY HH:MM:SS", then you might want to replace the
split with something like:

my($mday, $mon, $year, $hour, $min, $sec) = /\d+/g;

This will be much more forgiving about the data format.

> Also it doesn't apear that the addition is not not correct. For example, on
> line 787 the date is 03.03.00 15:20:35, and the script reports that the
> event happened 200.769699074074 days ago.... The previous line has the same
> strange day count. That one has 05.04.00 08:40:57 with the message the the
> even happened 168.0888888888889 days ago..... and infact all lines have this
> strange day counting......

It sounds like perhaps the format is really "MM.DD.YY HH:MM:SS"
instead of "DD.MM.YY HH:MM:SS".  Otherwise, that math seems fine.  Of
course, for the March 3rd example, this ordering doesn't make a
difference.  March being 6 months ago (~182 days) and the 3rd being 17
days ago, 200 seems like the correct answer.  Why do you not think it
is correct?

-- 
Ren Maddox
ren@tivoli.com


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

Date: Wed, 20 Sep 2000 10:59:23 -0500
From: "Andrew N. McGuire " <anmcguire@ce.mediaone.net>
Subject: Re: How do I shut down an oracle database from perl script
Message-Id: <Pine.LNX.4.21.0009201056500.3095-100000@hawk.ce.mediaone.net>

On Wed, 20 Sep 2000, orassilv quoth:

o> I am trying to shutdown an Oracle database.
o> In unix I would have in my bourne shell script the following:
o> 
o> ORACLE_SID=abcd; export ORACLE_SID
o> svrmgrl <<EOF
o> connect internal
o> @some_sql_script
o> shutdown immediate
o> exit
o> 
o> I have tried this in perl - no good - any ideas how to do this for
o> perl/nt4.0?
o> 

You know, I would be willing to bet that a database administrator
out there somewhere has done this. (hint, hint)

anm
-- 
<(@)> ; $/ = q;;; for $" ( map $_ && chr() => split m~[\D+ <(@)>
<(@)> ]~ => <DATA> ) { print "@{ [ '' => '' ] }" } __END__ <(@)>
<(@)>   74 117 115 116 32 97 110 111 116 104 101 114 32    <(@)>
<(@)>      80 101 114 108 32 72 97 99 107 101 114 10       <(@)>



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

Date: Wed, 20 Sep 2000 20:28:38 +0200
From: "dplanet" <whofer@dplanet.ch>
Subject: How to call a Perlscript ( SSI ) within a Javascript ?
Message-Id: <8qarja$oc$1@duba04h09-0.dplanet.ch>

Hi
can anybody help me ? I would like to call a Perlscript, exactly
a Server Site Include within a Javascript. The Perlscript is
running on a web server. How can i do that. I tried with following code
without success !  What is wrong ?

<html>
<head>
<script language="JavaScript">
function test () {
document.write("<!-- #exec cgi='cgi-bin/test3.pl' -->");
}
</script>
</head>
<body>
<script>
test();
</script>
</body>
</html>

The Perlscript is not called !!  Why  ??

Thanks a lot for your help in advance
Werner




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

Date: Wed, 20 Sep 2000 17:38:01 GMT
From: "Jaap" <jaap@stack.nl>
Subject: Re: How to call a Perlscript ( SSI ) within a Javascript ?
Message-Id: <ZB6y5.245185$LX4.2135026@nlnews00.chello.com>

I don't know why this doesn't work but you could try to call the perl script
like this:
<script src="perlscript.js"></script>

The perlscript.js is then a Perl program that outputs something like this:
document.write("blah blah");

make sure you have the right Content-type in the perl script:
x-application/javascript or something like that i believe (not sure).




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

Date: Wed, 20 Sep 2000 17:47:28 GMT
From: beach9000@hotmail.com
Subject: How to Capture Specific Whitespace?
Message-Id: <8qat78$555$1@nnrp1.deja.com>

I'm looking to 'capture' to amount of white space before a piece of
text.

ie
   garbagetext      markertext
              ^----|
or
   [start of file]           markertext
   ^------------------------|
or
   blah blah blah    blah    markertext
                         ^--|

so that I could reproduce the whitespace, either by simply copying the
space, or know how many characters of whitespace exists.

Can somebody point me to the keyword I should lookup?

Thanks


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 20 Sep 2000 15:49:39 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: I need help with arrays.
Message-Id: <slrn8shn4e.1tk.tjla@thislove.dyndns.org>

I was shocked! How could Abigail <abigail@foad.org>
say such a terrible thing:

>use overload;
>
>(What's next, whining that a sort solution only works on strings?)

sub by_string
{
    die unless (join '', $a, $b) =~ m;^\D*$;;
    $a cmp $b;
};


>:) I love these little poems :) Are these generated by a program? If so,
>:) care to share the code?
>
>use Coy;

[gwyn@thislove:~]$ perl
use Coy;
Modification of a read-only value attempted at
/usr/local/lib/perl5/site_perl/5.6.0/Lingua/EN/Inflect.pm line 140.
Compilation failed in require at
/usr/local/lib/perl5/site_perl/5.6.0/Coy.pm line 19.
BEGIN failed--compilation aborted at
/usr/local/lib/perl5/site_perl/5.6.0/Coy.pm line 19.
Compilation failed in require at - line 1.
BEGIN failed--compilation aborted at - line 1.

ack. I feel so deprived :(

-- 
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
I wish they would only take me as I am.
-Vincent Van Gogh, Dear Theo: Autobiography of Vincent Van Gogh


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

Date: 20 Sep 2000 16:24:17 GMT
From: abigail@foad.org (Abigail)
Subject: Re: I need help with arrays.
Message-Id: <slrn8shp3a.5fq.abigail@alexandra.foad.org>

Gwyn Judd (tjla@guvfybir.qlaqaf.bet) wrote on MMDLXXVII September
MCMXCIII in <URL:news:slrn8shn4e.1tk.tjla@thislove.dyndns.org>:
|| I was shocked! How could Abigail <abigail@foad.org>
|| say such a terrible thing:
|| 
|| >:) I love these little poems :) Are these generated by a program? If so,
|| >:) care to share the code?
|| >
|| >use Coy;
|| 
|| [gwyn@thislove:~]$ perl
|| use Coy;
|| Modification of a read-only value attempted at
|| /usr/local/lib/perl5/site_perl/5.6.0/Lingua/EN/Inflect.pm line 140.
|| Compilation failed in require at
|| /usr/local/lib/perl5/site_perl/5.6.0/Coy.pm line 19.
|| BEGIN failed--compilation aborted at
|| /usr/local/lib/perl5/site_perl/5.6.0/Coy.pm line 19.
|| Compilation failed in require at - line 1.
|| BEGIN failed--compilation aborted at - line 1.
|| 
|| ack. I feel so deprived :(


    $ perl -MCoy -wle 'print $]'
    5.006
    $


Perhaps I should release an updated version. ;-)



Abigail

-- 
map{${+chr}=chr}map{$_=>$_^ord$"}$=+$]..3*$=/2;        
print "$J$u$s$t $a$n$o$t$h$e$r $P$e$r$l $H$a$c$k$e$r\n";


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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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.

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 V9 Issue 4386
**************************************


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