[15454] in Perl-Users-Digest
Perl-Users Digest, Issue: 2864 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 25 21:05:20 2000
Date: Tue, 25 Apr 2000 18:05:09 -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: <956711109-v9-i2864@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 25 Apr 2000 Volume: 9 Number: 2864
Today's topics:
Re: Any Free Web Site That Allows Running Perl CGI? <bowman@montana.com>
Re: AS/400 and Packed Data chris_muller@my-deja.com
Re: Converting Macintosh files to UNIX (Bart Lateur)
Re: Converting Macintosh files to UNIX <iltzu@sci.invalid>
Encryption with perl. <groman@thehelm.com>
Re: Encryption with perl. <makarand_kulkarni@My-Deja.com>
help with matching.... <johndoyle33@hotmail.com>
how to measure processing time by millisecond unit <ackman@following.com>
Re: how to measure processing time by millisecond unit <alice@dogcat.com>
Re: how to measure processing time by millisecond unit <alexandria_sarkut@my-deja.com>
Is there a way to create a Perl executable. <aahopper@mailbox.ucdavis.edu>
Re: mysql <john@princenaseem.com>
Opening /var/spool/mail/username <ppi@searchy.net>
Re: Opening /var/spool/mail/username <makarand_kulkarni@My-Deja.com>
Perl compiler <ravikum@cisco.com>
Re: Perl compiler <lr@hpl.hp.com>
PERL Interpreter <do.not.mail.me@null.net>
Re: problems with spaces in filenames (Bart Lateur)
Re: problems with spaces in filenames <lr@hpl.hp.com>
Redirection with Perl and NT <spyatt@selectica.com>
Re: Redirection with Perl and NT <spyatt@selectica.com>
Re: Redirection with Perl and NT <lr@hpl.hp.com>
Re: Redirection with Perl and NT <Jonathan.L.Ericson@jpl.nasa.gov>
Re: REGEX tutorials ? <vette_2000@my-deja.com>
Re: script help! <makarand_kulkarni@My-Deja.com>
SNMP module examples? <do.not.mail.me@null.net>
The final release? <lauren_smith13@hotmail.com>
Variable Caching 0wn3d@my-deja.com
Re: Win98 Pipe problem <Jonathan.L.Ericson@jpl.nasa.gov>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 23 Apr 2000 17:58:53 -0600
From: "bowman" <bowman@montana.com>
Subject: Re: Any Free Web Site That Allows Running Perl CGI?
Message-Id: <x_qN4.366$Oa7.1870@newsfeed.slurp.net>
Randal L. Schwartz <merlyn@stonehenge.com> wrote in message
>
> if there are more, please tell me.
http://www.tripod.lycos.com/
tripod is set up a little differently, but appears to support most
functionality.
They also have a brief tutorial, and several canned scripts for counters and
so forth.
------------------------------
Date: Tue, 25 Apr 2000 22:34:22 GMT
From: chris_muller@my-deja.com
Subject: Re: AS/400 and Packed Data
Message-Id: <8e56he$693$1@nnrp1.deja.com>
If you don't mind using a PC as an intermediary, we have an easy to use
and FAST package called GenScript/RunScript at the "download" page of
our website. You can try it out for free, (but only does your first
ten recs) and license it if you like it.
Chris Muller
www.mullermedia.com
In article <kDCJ4.13$xk.52@news.uswest.net>,
"Doug Thomas" <dougtho@geocities.com> wrote:
> Does anyone know of an/the algorithm to unpack packed data from an
AS/400
> file? I am ftping files from an AS/400 to a Sun UNIX box. The EBCDIC
to
> ASCII translation is happening with the ftp. But, packed fields
> (alphanumeric) aren't being unpacked. Worst case I'll have the admins
on the
> AS/400 save the files unpacked which will greatly increase my ftp
times.
>
> Any help is appreciated.
>
> Thanks,
>
> Doug
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 25 Apr 2000 23:35:32 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Converting Macintosh files to UNIX
Message-Id: <39082b9f.2269555@news.skynet.be>
siva_ayyar@my-deja.com wrote:
>Macintosh files have a carriage return [ \r ] at the end of each line.
>
>UNIX has only [ \n ] terminating each line.
That's not the only difference. Well, maybe for Americans, it is.
--
Bart.
------------------------------
Date: 26 Apr 2000 00:09:44 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: Converting Macintosh files to UNIX
Message-Id: <956707311.28676@itz.pp.sci.fi>
In article <8e4tn2$spp$1@nnrp1.deja.com>, siva_ayyar@my-deja.com wrote:
>I'd like to translate each \r into a \n.
You've already had more than enough answers to choose from. May I
suggest one more:
s/\r\n?/\n/g;
This isn't the fastest way, but has the advantage that both CR _and_
CR/LF are changed to LF, and existing lone LFs are left alone. So you
can feed it a file with any kind of newlines, and trust the result to
be in unix format.
--
Ilmari Karonen - http://www.sci.fi/~iltzu/
Please ignore Godzilla and its pseudonyms - do not feed the troll.
------------------------------
Date: Tue, 25 Apr 2000 17:24:41 -0700
From: "Groman" <groman@thehelm.com>
Subject: Encryption with perl.
Message-Id: <yFqN4.1002$Pi2.33502@news.pacbell.net>
I am looking for a freeware source code/library/anything, that would
allow me to use PGP style(or something similiar) encryption in my CGI
script.
My problem is the following:
1) Data arrives through a secure HTTP connection to my script.
btw - is there anything special I need to do? Or will normal "POST"
style reading
of data will do?
2) My script, encrypts it with my 1024 bit public key(or something as
secure), and sends
it to me by e-mail(the data, not the key). My Delphi program, decrypts it,
and creates an HTML report, using the data.
Ok, I know how do this without any encryption/security. But how do I use
SSL, and where do I get (preferably freeware) perl encryption?(any RSA style
encryption will do)
--
-----------------------
I am not naive, just open-minded.
------------------------------
Date: Tue, 25 Apr 2000 17:31:36 -0700
From: Makarand Kulkarni <makarand_kulkarni@My-Deja.com>
Subject: Re: Encryption with perl.
Message-Id: <390638E8.65FC9FD@My-Deja.com>
> But how do I use SSL
SSL is totally handles by your webserver. The documentation
for your webserver will tell you how to enable SSL (using
the certificates etc ) or maybe it is already SSL enabled.
You just need to add https:// instead of http:// to access
your CGI script.
> , and where do I get (preferably freeware) perl encryption?(any RSA style
> encryption will do)
A quick search on all CPAN modules showed me that
there are some modules available for PGP style
encryption
eg.
Mail::IspMailGate::Filter::PGP - Encrypt and decrypt mails with PGP
MIME::Decoder::PGP - decode a "radix-64" PGP stream
etc
etc
You might find one that closely matches your requirements.
------------------------------
Date: Tue, 25 Apr 2000 22:26:28 GMT
From: Chovy <johndoyle33@hotmail.com>
Subject: help with matching....
Message-Id: <8e5624$5mj$1@nnrp1.deja.com>
I want to parse a file and extract the contents between a beginning and
ending identifier.
ie -
<!-- LIBRARY_SECT: test -->
I'm opening a filehandle for this file, which has comment tags...here
is my perl matching line:
if (m/[^\n]*<!-- LIBRARY_SECT:(.*)<*-->/) {
$library_sect = $1;
}
This works if the comment tag in my text file is on it's own line...but
if there is stuff after the ending comment tag "-->" it grabs that as
well.
How can I use "<!-- LIBRARY_SECT:" as the beginning identifier and the
very next "-->" as the ending identifier, grabbing everything
inbetween, resulting with $library_sect = " test " ??
Thanks
--
Thanks,
Chovy
johndoyle33@hotmail.com
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 26 Apr 2000 04:04:16 +0900
From: "ackman" <ackman@following.com>
Subject: how to measure processing time by millisecond unit
Message-Id: <8e5826$249l$1@news1.md.xaxon.ne.jp>
Hi,
I want to measure the following processing time by millisecond unit(e.g
1.50s=1500ms)
for ($a = 1;$a <=10;$a++){
...
}
By time function,I can get time *second unit* but now I want to get
*millisecond(1/1000sec)* or 1/10 second unit.
How should I solve it?
----------------------
ackman
------------------------------
Date: Wed, 26 Apr 2000 07:20:35 +0900
From: "alice" <alice@dogcat.com>
Subject: Re: how to measure processing time by millisecond unit
Message-Id: <8e55nk$18b$1@news01.iij4u.or.jp>
I see.I'll read the FAQ.
thank you very much to all!
----------------
alice,Japanese.
------------------------------
Date: Tue, 25 Apr 2000 22:33:50 GMT
From: Andrea Alexandria Sarkut <alexandria_sarkut@my-deja.com>
Subject: Re: how to measure processing time by millisecond unit
Message-Id: <8e56ge$68s$1@nnrp1.deja.com>
In article <8e4qb4$ot6$1@news01.iij4u.or.jp>,
"alice" <alice@dogcat.com> wrote:
> I want to measure the following processing time
> by millisecond unit(e.g 1.50s=1500ms)
> for ($a = 1;$a <=10;$a++){
> ...
> }
> By time function,I can get time *second unit* but now I want to get
> *millisecond(1/1000sec)* or 1/10 second unit.
> How should I solve it?
Your most logical approach is to remove your decimal
point and append a zero or zeroes as needed. You will
quickly discover measurements in milliseconds will cost
you a great amount of time, a great amount of effort and
will consume a significant amount of both your hard drive
space and RAM memory. This effort is not equal to your
end results. There are many reasons for this thinking.
Many will simply suggest you use the The Time..HiRes
module or the Benchmark module but, neglect to inform
you of serious disadvantages. Foremost among these
disadvantages is this statement at CPAN:
"How can I measure time under a second?
In general, you may not be able to. The Time [..] HiRes module
(available from CPAN) provides this functionality for some
systems.
If your system supports both the syscall() function in Perl as
well as a system call like gettimeofday(2), then you may be
able to do something like this...."
The Time..HiRes module has significant constraints and bugs
which will most likely make it unusuable on your system:
http://www.perl.com/CPAN-local/modules/by-module/Time/Time-HiRes-01.20.r
eadme
I would think twice on taking this simple advice of a
reference to a module by some. They are not alluding
to how many problems you will encounter. At least look
into problems you will encounter from start to finish
then assess the value of your intent in comparison to
how much effort you will invest in this project. Give
this thought, the Benchmark module is in excess of
five megabytes and does very little in exchange for
the amount of hard drive and RAM consumed.
Measurements down to hundreds or tens of milliseconds
are basically useless unless you are involved in some
exacting scientific research using computer technology.
It is safe to say you do not have the type of hardware
needed to ensure accuracy on any time measurement less
than thousands of milliseconds, or what we know as common
day seconds. You need expensive laboratory equipment to
realize exacting accuracy of any time measurement less
than one-thousand milliseconds. At best, using a typical
Personal Computer, your accuracy would be plus or minus
five seconds for reiteration tests, in a final analysis.
These type of measurements, milliseconds, are highly
quesionable for realistic concerns as well. Recently
a person here compared benchmarks for a hand written
read/parse routine and the equal using cgi.pm module.
After one-hundred-thousand iterations, a time difference
of two seconds was illogically reported. I say illogical
because no consideration is given to margin of error.
Two seconds falls well within margin of error factors.
In this case, given two seconds is accurate, an average
internet site, using a form action with five input variables
experiencing twenty-thousand hits per year, would realize
a CPU time savings of two seconds per year or, a one minute
savings in CPU time over the course of thirty years.
Obviously this type of thinking, shaving off two seconds
over the course of a year, it most illogical and quite
impractical if not ludicrous.
Do you truly need to worry about an amount of time
less than it takes you to blink your eyes?
Consider removing the decimal point, appending zeroes
as needed and be pleased with how little effort it takes
to do this with no more than ten minutes time invested
in writing simple Perl coding.
Andrea Alexandria Sarkut
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 25 Apr 2000 17:57:24 -0700
From: Alan Hopper <aahopper@mailbox.ucdavis.edu>
Subject: Is there a way to create a Perl executable.
Message-Id: <Pine.GSO.4.10.10004251754500.22115-100000@logan.ucdavis.edu>
As I understand it Perl gets compiled just before each execution. Is there
a way to create Perl object code (i.e. an .exe ) program that does not
need to be compiled every time it is run?
------------------------------
Date: Tue, 25 Apr 2000 22:15:10 GMT
From: "JohnShep" <john@princenaseem.com>
Subject: Re: mysql
Message-Id: <39062743.0@news2.cluster1.telinco.net>
Problem fixed, much obliged, JohnShep
Larry Rosler <lr@hpl.hp.com> wrote in message
news:MPG.136e3ab5b5b436998a96c@nntp.hpl.hp.com...
> In article <3904a014.0@news2.cluster1.telinco.net> on Mon, 24 Apr 2000
> 18:23:19 GMT, JohnShep <john@princenaseem.com> says...
> > I have a delimeter problem with the sub below. It works fine except if
one
> > of the name vars contains an apostraphe eg. "O'Brien" when it falls over
> > quite nicely. Is there a simple way around this ?
>
> There are two ways around this.
>
> > sub get_biog {
> > local $query="select * from biogs where (
> > first_name='$_[0]' ) and (
> > last_name='$_[1]' )";
> > local $sth=$dbh->prepare($query);
> > $sth->execute or die "failed in get biog $sth->errstr\n";
> >
> > @vals=$sth->fetchrow;
> > $sth->finish;
> > return @vals;
> > }
>
> Use 'my', not 'local'. perlfaq7: "What's the difference between dynamic
> and lexical (static) scoping? Between local() and my()?"
>
> Way 1: Before inserting the arguments into the SQL statement, use the
> $dbh->quote() method to protect apostrophes and backslashes.
>
> Way 2 (better by far, IMO): Use placeholders for the parameters, and
> supply them with the call to execute(). UNTESTED:
>
> my $query = # Note my style choice to capitalize SQL keywords.
> 'SELECT * FROM biogs WHERE first_name = ? AND last_name = ?';
> my $sth = $dbh->prepare($query);
> $sth->execute(@_) or die "failed in get biog $sth->errstr\n";
>
> Your diagnostic won't print the error string, because that is a method
> call, which doesn't get expanded within doble-quotes. Use DBI::errstr
> instead.
>
> --
> (Just Another Larry) Rosler
> Hewlett-Packard Laboratories
> http://www.hpl.hp.com/personal/Larry_Rosler/
> lr@hpl.hp.com
------------------------------
Date: Wed, 26 Apr 2000 02:05:58 +0200
From: Penpal International <ppi@searchy.net>
Subject: Opening /var/spool/mail/username
Message-Id: <390632E6.D9E3D185@searchy.net>
I have a little problem with opening /var/spool/mail/username . The
permission of it is -rw------ and it the owner of it is 'username'. But
how can I open this file via the HTTPDeamon? Is it possible anyway? If
it is possible it could save me a lot of trouble with all kind of
strange modules (I'm not realy a big fan of those modules).
Thanks,
Frank de Bot
--
Penpal International
http://ppi.searchy.net/
ppi@searchy.net
------------------------------
Date: Tue, 25 Apr 2000 17:18:06 -0700
From: Makarand Kulkarni <makarand_kulkarni@My-Deja.com>
Subject: Re: Opening /var/spool/mail/username
Message-Id: <390635BE.FF55A289@My-Deja.com>
> I have a little problem with opening /var/spool/mail/username . The
> permission of it is -rw------ and it the owner of it is 'username'. But
> how can I open this file via the HTTPDeamon? Is it possible anyway?
Assuming that it is a CGI script you are writing, this script
will be unable to read this file unless permissions were
altered. If the CGI script runs as user X then the CGI
script can read this file if and only if X was 'username'
and not otherwise.
> If
> it is possible it could save me a lot of trouble with all kind of
> strange modules (I'm not realy a big fan of those modules).
This has nothing to do with Modules. Modules
cannot override the Unix file system permissions.
------------------------------
Date: Tue, 25 Apr 2000 16:03:09 -0700
From: Ravinder Kumar <ravikum@cisco.com>
Subject: Perl compiler
Message-Id: <3906242D.F129DC6F@cisco.com>
How effective it is, can someone share his/her experience.
Where can I find "perlcc" ?.
Thanks
Ravi
------------------------------
Date: Tue, 25 Apr 2000 17:24:23 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Perl compiler
Message-Id: <MPG.136fd712409ced1998a981@nntp.hpl.hp.com>
In article <3906242D.F129DC6F@cisco.com> on Tue, 25 Apr 2000 16:03:09 -
0700, Ravinder Kumar <ravikum@cisco.com> says...
> How effective it is, can someone share his/her experience.
> Where can I find "perlcc" ?.
perlfaq3: "How can I compile my Perl program into byte code or C?"
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Tue, 25 Apr 2000 15:58:07 -0700
From: Mike Ayers <do.not.mail.me@null.net>
Subject: PERL Interpreter
Message-Id: <390622FF.971C2172@null.net>
I'm looking for a PERL interpreter. I'm aware of `perl -de 42`, but
that is a little too limited. I'm looking for a little more
sophistication in the command line editing and history department.
Suggestions? CPAN doesn't seem to have anything...
/|/|ike
------------------------------
Date: Tue, 25 Apr 2000 23:36:08 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: problems with spaces in filenames
Message-Id: <39062706.1093282@news.skynet.be>
Paul Spitalny wrote:
>I can't seem to get this type of statement to work:
>
>system("c:/program files/fred.exe $arg1 $arg2");
>
>It seems that the space in the directory name is the problem. How can I
>get around this problem (WITHOUT re-naming the directory, too late for
>that, I'm in too deep).
Put double quotes around the whole path. BTW apparently, spaces are
legal in Unix paths as well, although rather uncommon. Even the solution
is very similar (apart from the quote character).
system(qq["c:/program files/fred.exe" $arg1 $arg2]);
--
Bart.
------------------------------
Date: Tue, 25 Apr 2000 17:15:32 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: problems with spaces in filenames
Message-Id: <MPG.136fd5038322b32b98a980@nntp.hpl.hp.com>
In article <39062706.1093282@news.skynet.be> on Tue, 25 Apr 2000
23:36:08 GMT, Bart Lateur <bart.lateur@skynet.be> says...
> Paul Spitalny wrote:
>
> >I can't seem to get this type of statement to work:
> >
> >system("c:/program files/fred.exe $arg1 $arg2");
> >
> >It seems that the space in the directory name is the problem. How can I
> >get around this problem (WITHOUT re-naming the directory, too late for
> >that, I'm in too deep).
>
> Put double quotes around the whole path. BTW apparently, spaces are
> legal in Unix paths as well, although rather uncommon. Even the solution
> is very similar (apart from the quote character).
But the quote character could be the same also, as long as the path has
no dollar signs in it. Perl's rules for the behavior of single and
double quotes are very much like those of the Unix shell. I wonder why?
:-)
Think portably, command interpreter as well as Perl!
> system(qq["c:/program files/fred.exe" $arg1 $arg2]);
system(qq["/home/user/program files/fred" $arg1 $arg2]);
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Tue, 25 Apr 2000 15:29:57 -0700
From: Scott Pyatt <spyatt@selectica.com>
Subject: Redirection with Perl and NT
Message-Id: <39061C65.4CBC714A@selectica.com>
I've recently loaded Active Perl on a pair of NT systems. All appears
to be working fine until I attempt to redirect or pipe ouput from a
Perl program. For instance I create a simple hello.pl script with the
following line.
print("Hello\n");
I then run it.
C:\hello.pl
Hello
It works. Now I redirect the output to a file.
C:\hello.pl > howdy.txt
As you would expect, no output is sent to the screen . However, the
"howdy.txt" which gets created is empty! I've also tried the
following without any luck.
C:\hello.pl | sort
No output is sent to the screen. I've also tried things like this,
but it still does not work.
print(STDOUT "Hello\n");
Anyone have any thoughts other than opening a file in Perl or throwing
NT out the window (pun intended).
Thanks,
-Scott
------------------------------
Date: Tue, 25 Apr 2000 15:48:55 -0700
From: Scott Pyatt <spyatt@selectica.com>
Subject: Re: Redirection with Perl and NT
Message-Id: <390620D7.4F8291CF@selectica.com>
Sorry, but shortly after I posted my question, I found the following info
from the
ActivePerl docs:
>You may get unexpected results when you try to redirect the output of
files that use >Windows NT's file association feature. You can use pl2exe
or pl2bat to convert a >Perl script to an executable or a batch file. This
should solve any problems you may >have with redirection.
I'd consider this a bug. Anyone know if there is a fix on the way?
-Scott
Scott Pyatt wrote:
> I've recently loaded Active Perl on a pair of NT systems. All appears
> to be working fine until I attempt to redirect or pipe ouput from a
> Perl program. For instance I create a simple hello.pl script with the
> following line.
>
> print("Hello\n");
>
> I then run it.
>
> C:\hello.pl
> Hello
>
> It works. Now I redirect the output to a file.
>
> C:\hello.pl > howdy.txt
>
> As you would expect, no output is sent to the screen . However, the
> "howdy.txt" which gets created is empty! I've also tried the
> following without any luck.
>
> C:\hello.pl | sort
>
> No output is sent to the screen. I've also tried things like this,
> but it still does not work.
>
> print(STDOUT "Hello\n");
>
> Anyone have any thoughts other than opening a file in Perl or throwing
> NT out the window (pun intended).
>
> Thanks,
> -Scott
------------------------------
Date: Tue, 25 Apr 2000 16:19:12 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Redirection with Perl and NT
Message-Id: <MPG.136fc7c13edba4d198a97f@nntp.hpl.hp.com>
[Please, even if you are responding to yourself, post in the normal
order of discourse (comment after that being commented on), and don't
just quote the entire previous post.
Also, your line lengths are greater than 72 characters, causing mildly
weird line wraps. I have cleaned up some of the artifacts.]
In article <390620D7.4F8291CF@selectica.com> on Tue, 25 Apr 2000
15:48:55 -0700, Scott Pyatt <spyatt@selectica.com> says...
> Sorry, but shortly after I posted my question, I found the following info
> from the ActivePerl docs:
>
> >You may get unexpected results when you try to redirect the output of
> files that use Windows NT's file association feature. You can use pl2exe
> or pl2bat to convert a Perl script to an executable or a batch file. This
> should solve any problems you may have with redirection.
>
> I'd consider this a bug. Anyone know if there is a fix on the way?
Clearly it is a bug. I don't know about a fix. But here's a simple
workaround:
C:\> perl hello.pl >howdy.txt
^^^^
And now the name of the program file can be anything you want, as the
suffix is irrelevant. I always use '.txt' because it makes it easier to
get into my preferred text editor by double-clicking on the filename.
*That* association works fine!
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Tue, 25 Apr 2000 16:05:55 -0700
From: Jon Ericson <Jonathan.L.Ericson@jpl.nasa.gov>
Subject: Re: Redirection with Perl and NT
Message-Id: <390624D3.E2C4DB70@jpl.nasa.gov>
Scott Pyatt wrote:
> I've recently loaded Active Perl on a pair of NT systems. All appears
> to be working fine until I attempt to redirect or pipe ouput from a
> Perl program.
From ActiveState's Windows FAQ
(http://www.ActiveState.com/ActivePerl/docs/faq/ActivePerlfaq.html):
STDIN and STDOUT, and Piping don't always work on NT.
You may get unexpected results when you try to redirect the output of
files that use Windows NT's file association feature. You can use pl2exe
or pl2bat to convert a Perl script to an executable or a batch file.
This should solve any problems you may have with redirection.
Jon
--
Knowledge is that which remains when what is
learned is forgotten. - Mr. King
------------------------------
Date: Tue, 25 Apr 2000 22:12:17 GMT
From: Stumpy <vette_2000@my-deja.com>
Subject: Re: REGEX tutorials ?
Message-Id: <8e557l$4nh$1@nnrp1.deja.com>
Thanks Mark & Bart for the URLs !
Mike
In article <8e45p5$cmp$1@monet.op.net>,
mjd@op.net (Mark-Jason Dominus) wrote:
> In article <3904b496.180868@news.skynet.be>,
> Bart Lateur <bart.lateur@skynet.be> wrote:
> >Inner workings: Mark Jason Dominus' intro is really nice. "How
Regexes
> >Work", URL: <http://www.plover.com/~mjd/perl/Regex/>. But currentl,
the
> >site seems do be down. This has already been mentioned about a week
ago.
>
> http://old.plover.com/~mjd/perl/Regex/ will still work. And Bell
> tells me that their snail-like efforts to restore my service will
> probably be completed by Friday.
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 25 Apr 2000 15:58:02 -0700
From: Makarand Kulkarni <makarand_kulkarni@My-Deja.com>
Subject: Re: script help!
Message-Id: <390622FA.E65F46E7@My-Deja.com>
> $rows = $sth->dump_results( 80, "\n", ";", \*FILE1);
This function was provided for testing and prototyping
purposes only. Do not use this in live code.
> $words=~s/ ' / /g;
What does this statement do ?
> while (<FILE>) {
> @mymatch = /\b(_\d+_)\b/;
> }
These three statements are the source of your problem.
You have to push() or unshift () the items you find
on each line into @mymatch. You should shift into
@mymatch ( or unshift ) $1 ( which is what gets
matched using the regexp. Check the perl docs for
doing this and more info on regexp matching.
> sub dodynamic {
> system "/usr/bin/lynx -dump
> http://webstats3.rnci.com/ss?setsite=$login >lynx.statbeth2";
> return;
> }
Perl provides you with LWP::UserAgent modules for
these kind of tasks (instead of using lynx -dump )
> #Subroutine for makeing the html template
> #
> sub makereport {
Rewriting this func using CGI.pm might be a good idea.
==
------------------------------
Date: Tue, 25 Apr 2000 16:29:59 -0700
From: Mike Ayers <do.not.mail.me@null.net>
Subject: SNMP module examples?
Message-Id: <39062A77.BFAE889C@null.net>
I have UCD-SNMP installed, and the SNMP module for it as well. However
'perldoc SNMP' is a bit obtuse. Can anyone point me to some elementary
code that uses the SNMP module? I just need to see some sets typed out,
etc. so that I can grasp the format, since I couldn't quite interpret
what the doc said.
Thanks,
/|/|ike
------------------------------
Date: Tue, 25 Apr 2000 16:20:06 -0700
From: "Lauren Smith" <lauren_smith13@hotmail.com>
Subject: The final release?
Message-Id: <8e597v$c99$1@brokaw.wa.com>
Did anyone else catch this on Segfault?
http://www.segfault.org/story.phtml?mode=2&id=3905b40e-05c0a760
:-)
Lauren
------------------------------
Date: Wed, 26 Apr 2000 00:38:13 GMT
From: 0wn3d@my-deja.com
Subject: Variable Caching
Message-Id: <8e5dpj$e8b$1@nnrp1.deja.com>
I have been having a problem with some cgi scripts that I have been
writing over the past month. I have it set up so that one script will
perform several operations (For example, if you have a news editing
script it will both add news and edit news for you), the only problem
is that some variables are cached after running the script, so that if
I have a variable called $task and the task that the script does is
dependant upon the value of that variable, a value from before will be
existant, instead of obliterating the variable to start a new
operation. I do have each variable initialized with my in front of
them, but it continues to behave in this manner. Does anybody have
suggestions on how to eliminate a variable's value after it is used, or
has anybody had this same problem before?
Thanks,
0wn3d
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 25 Apr 2000 15:58:33 -0700
From: Jon Ericson <Jonathan.L.Ericson@jpl.nasa.gov>
Subject: Re: Win98 Pipe problem
Message-Id: <39062319.A422B70A@jpl.nasa.gov>
bennyboy00@my-deja.com wrote:
> #!/usr/local/bin/perl
#!/usr/local/bin/perl -w
use strict;
Not strictly necessary, but sets off warnings in my mind when I don't
see it.
> open (Reader, "dir|");
open (Reader, 'dir|') or die "can't open pipe from dir: $!";
Why not let Perl help you out - it knows more about this problem than I
do.
> while (<Reader>){
> print $_."\n";
print;
Unless you like the double spacing:
print "$_\n";
> }
Or just:
print <Reader>;
Jon
--
Knowledge is that which remains when what is
learned is forgotten. - Mr. King
------------------------------
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 2864
**************************************