[10665] in Perl-Users-Digest
Perl-Users Digest, Issue: 4257 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Nov 19 16:07:13 1998
Date: Thu, 19 Nov 98 13:00:18 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 19 Nov 1998 Volume: 8 Number: 4257
Today's topics:
Re: Activestate WIN32 Service Pack??? <newspost@morlock.net>
cannot exit CGI process after forking <callahan@pmel.noaa.gov>
File I/O & text processing <amyun@ricochet.net>
Re: how to get `date` in perl for win32 (newbie) <agno3@ionet.net>
Re: how to get `date` in perl for win32 (newbie) (I R A Aggie)
HTTPS - I cannot find a module on CPAN for this. <jdubois@keane.com>
Re: installing ParseLex on NT <sgordon@kenan.com>
Re: installing ParseLex on NT <randy@theory.uwinnipeg.ca>
Lexical var in nested sub <see.address@signature.line>
perl anagram engine <smith.will@epa.gov>
Re: perl anagram engine (Matthew Bafford)
Re: perl anagram engine (Randy Kobes)
Re: perl documentation date <dgris@moiraine.dimensional.com>
Re: Perl script to automatically find dependencies <dgris@moiraine.dimensional.com>
Re: Perl script to automatically find dependencies <arnej@fc.hp.com>
Re: Perl script to automatically find dependencies <uri@fastengines.com>
Re: Perl script to automatically find dependencies <dgris@moiraine.dimensional.com>
Re: pod2man and Y2K <garethr@cre.canon.co.uk>
Re: Problem with using Crypt with Perl on Windows NT <james@MatadorDesign.com>
Re: Problem with using Crypt with Perl on Windows NT <montyt@bestnet.com>
Re: Problem with using Crypt with Perl on Windows NT dturley@pobox.com
Re: programing fun: trees: FlattenAt (David Alan Black)
question on system limit <hui.tang@tus.ssi1.com>
Requesting URLs from a perl script <kontakt@sunsite.ch>
Re: snoop'ing in perl (Bennett Todd)
Re: Tracking Subroutines <hendrik.woerdehoff@sdm.de>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 19 Nov 1998 15:18:35 -0500
From: "Steven Morlock" <newspost@morlock.net>
Subject: Re: Activestate WIN32 Service Pack???
Message-Id: <d3%42.117$Fc1.368094@lwnws01.ne.mediaone.net>
I received the following from the ActiveState folks:
Hello Steven,
I appreciate that you have taken the time to write to us.
ActiveState and its employees are working very hard at getting the service
pack for the PRK released. Currently, the PRK service pack is in the final
stages of Quality Assurance and will be available immediately following
this process.
Sincerely,
Sandy Fleischer
At 08:17 AM 11/19/98 -0500, you wrote:
>
>From the ActivePerl download page:
>
>>>NOTE to Perl Resource Kit -- Win32 Edition users: If you have the Perl
>Resource Kit installed,
>>>then you need the PRK Service Pack 1 to update ActivePerl. Do not
download
>and install the files below.
>>>The PRK Service Pack 1 will be available in a day or two.
>
>This message has been on the site very, very long time.
>Can owners of the 'Perl Resource Kit' expect support on this product?
>
>
>
Sandy Fleischer
ActiveState Tool Corp. -- Professional Tools for Perl Developers
http://www.ActiveState.com
Robert M Bellavance wrote in message <243650014@hpcc01.corp.hp.com>...
>Ok, I took the bait and bought the Perl Resource Kit
>for Win32. The current build of ActivePerl is now
>at 507 an of you bought the PRK they tell you this:
>
>"NOTE to Perl Resource Kit -- Win32 Edition users:
>If you have the Perl Resource Kit installed, then
>you need the PRK Service Pack 1 to update ActivePerl.
>Do not download and install the files below.
>The PRK Service Pack 1 will be available in a day or two."
>
>BULL*HIT!!!
>
>This message has been there for two builds and over a week.
>If you look at http://www.activestate.com/PRK/patches.htm the
>service pack was due in mid October.
>
>My question. Should I just forget about the PRK "rules" and grab the
>507 build? I know this will probably mean I will have to install
>modules, but it will mean that I don't have to just sit on my
>hands and wait for something that may not happen.
>
>You'd think Activestate would give the PRK users priority because
>of the bucks we shelled out, but noooooo!!! What a rip off!
>
------------------------------
Date: Thu, 19 Nov 1998 12:31:36 -0800
From: Jonathan Callahan <callahan@pmel.noaa.gov>
Subject: cannot exit CGI process after forking
Message-Id: <36548028.56E92360@pmel.noaa.gov>
<HTML>
We have a perl cgi script which reads some form input, creates an initialization
file and then execs a program which takes a long time. Unfortunately,
our cgi doesn't return, and our browser waits, until the program is finished.
We've tried forking child processes using all the methods in the camel
book:
<P>i<TT>f ($pid = fork) { #parent</TT>
<BR><TT> exit 0;</TT>
<BR><TT><FONT SIZE=+1>} elsif (defined $pid) { #child</FONT></TT>
<BR><TT><FONT SIZE=+1> exec 'cd subdirectory; run_long_program';</FONT></TT>
<BR><TT><FONT SIZE=+1>} else {</FONT></TT>
<BR><TT><FONT SIZE=+1> die;</FONT></TT>
<BR><TT><FONT SIZE=+1>}</FONT></TT><TT><FONT SIZE=+1></FONT></TT>
<P>-or-
<P><TT><FONT SIZE=+1>fork && exit;</FONT></TT>
<BR><TT><FONT SIZE=+1>exec 'cd subdirectory; run_long_program';</FONT></TT><FONT SIZE=+1></FONT>
<P>-or-
<P><TT><FONT SIZE=+1>unless (fork) { #child</FONT></TT>
<BR><TT><FONT SIZE=+1> unless (fork) { #grandchild</FONT></TT>
<BR><TT><FONT SIZE=+1> sleep 1 until getppid == 1;</FONT></TT>
<BR><TT><FONT SIZE=+1> exec 'cd subdirectory; run_long_program';</FONT></TT>
<BR><TT><FONT SIZE=+1> exit 0;</FONT></TT>
<BR><TT><FONT SIZE=+1> }</FONT></TT>
<BR><TT><FONT SIZE=+1> # first child exits quickly</FONT></TT>
<BR><TT><FONT SIZE=+1> exit 0;</FONT></TT>
<BR><TT><FONT SIZE=+1>}</FONT></TT>
<BR><TT><FONT SIZE=+1>wiat; #parent reaps first child quickly;</FONT></TT><FONT SIZE=+1></FONT>
<P>When we print out the <TT>$pid</TT> in each test section in the first
example it appears that our CGI is indeed forking. And we are running
the long program and getting appropriate output. But <B>none</B>
of these examples allow the cgi process to return before <TT>run_long_program</TT>
is finished executing.
<P>Does anyone understand why we're having this problem?
<P>Does it have to do with our server?
<P>Is it something anyone has done successfully?
<P>Frustrated,
<P>-- Jonathan Callahan</HTML>
------------------------------
Date: Thu, 19 Nov 1998 11:58:28 -0800
From: A Chung <amyun@ricochet.net>
Subject: File I/O & text processing
Message-Id: <36547863.BF@ricochet.net>
Could someone please help me with a file i/o question using PERL?
I would like to open a file and add text or replace text in the same
file.
So far I have figured out that IN and OUT seem to be key words for the
open command for reading/writing. I would have thought that the
filehandle parameter would have a key word like this. Then again I am
new to this.
Andrew
------------------------------
Date: Wed, 18 Nov 1998 11:56:42 -0600
From: "Brett M. Zimmerman" <agno3@ionet.net>
Subject: Re: how to get `date` in perl for win32 (newbie)
Message-Id: <36530A59.225E53B3@ionet.net>
j9feng@my-dejanews.com wrote:
> The following codes work fine under linux,
>
> my $date=`date`;
>
> but it will not work under win95, because the command 'date' under
> win95 will print the current date and then ask for "Enter new
> date(MM/DD/YY): " expecting you input new date or just hit ENTER.
>
> Is there a way to get the current date?
>
the /T option causes the date command to just give the date without
prompting for a change.
--
Brett M. Zimmerman
zim@ou.edu
------------------------------
Date: Thu, 19 Nov 1998 15:22:28 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: how to get `date` in perl for win32 (newbie)
Message-Id: <fl_aggie-1911981522280001@aggie.coaps.fsu.edu>
In article <72rgtf$a6m$1@nnrp1.dejanews.com>, j9feng@my-dejanews.com wrote:
+ date(MM/DD/YY): " expecting you input new date or just hit ENTER.
+
+ Is there a way to get the current date?
Presuming you want MM/DD/YY:
my ($mday,$mon,$year) = (localtime)[3,4,5];
$year=$year % 100; #note: $year=$year+1900; gives the full year
$mon++; # localtime gives months in the range 0-11
print "The date is: $mon\/$mday\/$year\n";
James
------------------------------
Date: Thu, 19 Nov 1998 15:01:58 -0500
From: Joseph DuBois <jdubois@keane.com>
Subject: HTTPS - I cannot find a module on CPAN for this.
Message-Id: <36547936.BB62D616@keane.com>
Well met,
I am looking for a module to work with a HTTPS server. I looked
on CPAN, but could not find either by catagory or module. Am I looking
for the wrong thing, or is there another way to do this.
I need to write a routine to submit files from a AS-400 to a HTTPS
server
out on the web?
Thanks alot!
--
-------------------------------------------------------
Joseph DuBois /Int(er|ra)net Grunt/
mailto:jdubois@keane.com (Work) http://www.keane.com/
------------------------------
Date: Thu, 19 Nov 1998 14:37:54 -0500
From: Seth Gordon <sgordon@kenan.com>
To: Randy Kobes <randy@theory.uwinnipeg.ca>
Subject: Re: installing ParseLex on NT
Message-Id: <36547392.1D9DA3DF@kenan.com>
[posted and e-mailed]
Thanks for the pointers that you e-mailed me.
Unfortunately, the package at GSAR's home page doesn't include a "win32" version of
dmake -- there are some files mentioned in the readme documents that don't seem to
be on the unpacked tarstuff. The company that is maintaining dmake offers *source
code* for free, but if I had a compiler to compile the source code with, I'd already
have a make program ...
If nmake is available for download at Microsoft's ftp site, it's buried somewhere
beneath five levels of directories with unrevealing names. (Going to Microsoft's
Web site and searching for "nmake", or even "nmake and download", brought up a whole
slew of pages that *mentioned* nmake, but....)
Do you (or do any clpm readers) know of any other place (or the exact place in
Microsoft's system) where a make can be downloaded for free? Or is it time for me
to just ask my boss to authorize getting me VC++?
--
perl -le'$m="r 0rJaa.u0cksthe";$c=967150;s/$/substr$m,($i\
+=$c%2?4:1)%=16,1or$i-2?"no":"Perl h"/e while$c>>=1;print'
== seth gordon == sgordon@kenan.com == standard disclaimer ==
== documentation group, kenan systems corp., cambridge, ma ==
------------------------------
Date: Thu, 19 Nov 1998 14:15:36 -0600
From: Randy Kobes <randy@theory.uwinnipeg.ca>
To: Seth Gordon <sgordon@kenan.com>
Subject: Re: installing ParseLex on NT
Message-Id: <Pine.GSO.4.05.9811191403550.18414-100000@theory.uwinnipeg.ca>
On Thu, 19 Nov 1998, Seth Gordon wrote:
> [posted and e-mailed]
>
> Thanks for the pointers that you e-mailed me.
>
> Unfortunately, the package at GSAR's home page doesn't include a
> "win32" version of
> dmake -- there are some files mentioned in the readme documents that
> don't seem to
> be on the unpacked tarstuff. The company that is maintaining dmake
> offers *source
> code* for free, but if I had a compiler to compile the source code with,
> I'd already
> have a make program ...
Hi,
I believe that
http://www-personal.umich.edu/~gsar/dmake-4.1-win32.zip
is a binary version of dmake appropriate for win32 (note that this
url isn't the same as the GSAR author directory on CPAN).
>
> If nmake is available for download at Microsoft's ftp site, it's buried
> somewhere
> beneath five levels of directories with unrevealing names.
> (Going to Microsoft's
> Web site and searching for "nmake", or even "nmake and download", brought
> up a whole
> slew of pages that *mentioned* nmake, but....)
Sorry about that - the address is
ftp://ftp.microsoft.com/SoftLib/MSLFILES/nmake.exe
possibly with a version number. This is a self-extracting archive
containing nmake.exe, nmake.err, and nmake.txt - put nmake.exe and
nmake.err in your path. Then, depending on which make you have, you
may have to alter the make=... line in perl's Config.pm file.
Best regards,
Randy Kobes
Physics Department Phone: (204) 786-9399
University of Winnipeg Fax: (204) 774-4134
Winnipeg, Manitoba R3B 2E9 e-mail: randy@theory.uwinnipeg.ca
Canada http://theory.uwinnipeg.ca/
------------------------------
Date: Thu, 19 Nov 1998 11:22:14 -0800
From: Bret Madhvani <see.address@signature.line>
Subject: Lexical var in nested sub
Message-Id: <36546FE6.9A718E54@signature.line>
Hi all,
I'm trying to understand the scope of a lexical variable in a nested
sub. My two test scripts are:
a.pl
----------------------------
#!/usr/bin/perl -w
use strict;
$a = 'A (global)';
my $b = 'B (lexical)';
my_sub_1();
sub my_sub_1 {
my $c = 'C (lexical)';
print $a . "\n";
print $b . "\n";
print $c . "\n";
require 'b.pl';
my_sub_2();
}
1;
----------------------------
b.pl
----------------------------
sub my_sub_2 {
print $a . "\n";
print $b . "\n";
print $c . "\n";
}
1;
----------------------------
I'm using "require 'b.pl'" because I would eventually like to require
this sub into several other scripts.
The output of a.pl is
A (global)
B (lexical)
C (lexical)
A (global)
Use of uninitialized value at b.pl line 3.
Use of uninitialized value at b.pl line 4.
My (obviously naive) assumption was that $c would retain its value in
my_sub_2, just as $b retains its value in my_sub_1. I'm hoping that
someone can educate me as to why it doesn't. Or, tell me another way to
do this (that is, make variables retain their values inside nested
subs).
TIA,
Bret
BTW, "This is perl, version 5.005_02 built for sun4-solaris"
--
Bret Madhvani
bret at terristech.com
------------------------------
Date: Thu, 19 Nov 1998 14:16:19 -0500
From: "William Smith" <smith.will@epa.gov>
Subject: perl anagram engine
Message-Id: <731qqj$7qm1@valley.rtpnc.epa.gov>
Does anyone know of an anagram engine written in Perl? I know about the GNU
engine written in C.
Thanks
------------------------------
Date: Thu, 19 Nov 1998 14:57:56 -0500
From: dragons@scescape.net (Matthew Bafford)
Subject: Re: perl anagram engine
Message-Id: <MPG.10be425361f4d3698971d@news.scescape.net>
In article <731qqj$7qm1@valley.rtpnc.epa.gov>, William Smith
<smith.will@epa.gov> pounded in the following:
=> Does anyone know of an anagram engine written in Perl? I know about the GNU
=> engine written in C.
Cool! If searching CPAN (www.cpan.org) doesn't turn up anything, I bet
the Perl community would love for you to write a module to do that!
After all, you have the source code, so it shouldn't be too difficult.
=> Thanks
Let us know when it's finished!
--Matthew
------------------------------
Date: 19 Nov 1998 20:21:10 GMT
From: randy@theory.uwinnipeg.ca (Randy Kobes)
Subject: Re: perl anagram engine
Message-Id: <slrn758vuk.i3t.randy@theory.uwinnipeg.ca>
On Thu, 19 Nov 1998 14:57:56 -0500,
Matthew Bafford <dragons@scescape.net> wrote:
>In article <731qqj$7qm1@valley.rtpnc.epa.gov>, William Smith
><smith.will@epa.gov> pounded in the following:
>=> Does anyone know of an anagram engine written in Perl? I know about the GNU
>=> engine written in C.
>
>Cool! If searching CPAN (www.cpan.org) doesn't turn up anything, I bet
>the Perl community would love for you to write a module to do that!
>After all, you have the source code, so it shouldn't be too difficult.
Hi,
You might also try searching comp.lang.perl.* on dejanews - there
was discussion of anagram algorithms in perl a while ago.
--
Best regards,
Randy Kobes
Physics Department Phone: (204) 786-9399
University of Winnipeg Fax: (204) 774-4134
Winnipeg, Manitoba R3B 2E9 e-mail: randy@theory.uwinnipeg.ca
Canada http://theory.uwinnipeg.ca/
------------------------------
Date: 19 Nov 1998 12:33:49 -0700
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: perl documentation date
Message-Id: <m367cblboi.fsf@moiraine.dimensional.com>
gward@thrak.cnri.reston.va.us (Greg Ward) writes:
> I believe Tom Christiansen has a lot to do with maintaining the docs,
> but there must be other people involved -- there's such a huge amount of
> high-quality documentation available that I have a hard time
> believing one guy keeps on top of all of it.
Tom is the primary maintainer of the documentation but patches are
received regularly from several other people (notably Abigail and
Ilya).
> If you're interested in contributing, you might want to join the Perl
> Documentation mailing list.
If you'd like to contribute just follow the guidelines in patching.pod
(available in the Porting subdirectory of your 5.005_0x source
distribution) to create your patches. Send them off to p5p and watch
your name be added to perl contributors file.
One thing that can't be said is that the perl community is adverse to
high quality documentation. Unlike some projects where there is a
tendency towards `Don't document that, it may change', the core perl
community seems to be more interested in documenting how it works
_today_. The attitude is that the if the underlying code is changed
or fixed, the documentation can be as well. I can't recall ever
seeing a documentation patch that wasn't quickly applied to the source
tree and published with the next perl release (discounting, of course,
documentation that contains technical errors or is technically
misleading).
> The list has been pretty quiet since I joined a month or so ago, though.
Yup, I'm kind of curious what the purpose of the list is given the
existence of pod-people and p5p (not that pod-people sees a great deal
of traffic, either). I am guessing that traffic will likely pick up
as we get closer to 5.006.
> (Incidentally, it's usually much nicer to give reasoned criticism rather
> than saying something "sucks big time". Not many people listen to that
> sort of flamage, but some do -- and are likely to bite your head off
> for it. Look out.)
Yup, in fact the original poster got immediately plonked here.
dgris
--
Daniel Grisinger dgris@moiraine.dimensional.com
Supporter of grumpiness where grumpiness is due on clpm.
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'
------------------------------
Date: 19 Nov 1998 12:46:14 -0700
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: Perl script to automatically find dependencies
Message-Id: <m3zp9njwjd.fsf@moiraine.dimensional.com>
lr@hpl.hp.com (Larry Rosler) writes:
> [Posted to comp.lang.perl.misc and a copy mailed.]
>
> In article <731lnj$lro$1@mdnews.btv.ibm.com> on 19 Nov 1998 17:49:39
> GMT, David B. White <dbwhite@btv.ibm.com> says...
> > Copy (or add) the END block shown below
> > END { foreach ( sort keys %INC ) { print "$_\n" } }
> > to your application, then run the application and terminate. It will
> > print the list of modules that have been 'use'd or 'require'd by your
> > application.
>
> @INC is an array, not a hash.
%INC is a hash the names of loaded modules as keys and the absolute
path to the modules as the values.
$ perl -de8
Loading DB routines from perl5db.pl version 1.0401
Emacs support available.
Enter h or `h h' for help.
main::(-e:1): 8
DB<1> X
<snip lots>
@INC = (
0 '/home/dgris/lib/perl5/5.00502/i586-linux-thread'
1 '/home/dgris/lib/perl5/5.00502'
2 '/home/dgris/lib/perl5/site_perl/5.005/i586-linux-thread'
3 '/home/dgris/lib/perl5/site_perl/5.005'
4 '.'
)
%INC = (
'AutoLoader.pm' => '/home/dgris/lib/perl5/5.00502/AutoLoader.pm'
'Carp.pm' => '/home/dgris/lib/perl5/5.00502/Carp.pm'
'DynaLoader.pm' => '/home/dgris/lib/perl5/5.00502/i586-linux-thread/DynaLoader.pm'
'Exporter.pm' => '/home/dgris/lib/perl5/5.00502/Exporter.pm'
'SelfLoader.pm' => '/home/dgris/lib/perl5/5.00502/SelfLoader.pm'
'Term/Cap.pm' => '/home/dgris/lib/perl5/5.00502/Term/Cap.pm'
'Term/ReadKey.pm' => '/home/dgris/lib/perl5/site_perl/5.005/i586-linux-thread/Term/ReadKey.pm'
'Term/ReadLine.pm' => '/home/dgris/lib/perl5/5.00502/Term/ReadLine.pm'
'Term/ReadLine/Perl.pm' => '/home/dgris/lib/perl5/site_perl/5.005/Term/ReadLine/Perl.pm'
'Term/ReadLine/readline.pm' => '/home/dgris/lib/perl5/site_perl/5.005/Term/ReadLine/readline.pm'
'dumpvar.pl' => '/home/dgris/lib/perl5/5.00502/dumpvar.pl'
'perl5db.pl' => '/home/dgris/lib/perl5/5.00502/perl5db.pl'
'vars.pm' => '/home/dgris/lib/perl5/5.00502/vars.pm'
)
$] = 5.00502
<snip lots more>
DB<1> q
$
dgris
--
Daniel Grisinger dgris@moiraine.dimensional.com
Supporter of grumpiness where grumpiness is due on clpm.
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'
------------------------------
Date: Thu, 19 Nov 1998 12:50:53 -0700
From: Arne Jamtgaard <arnej@fc.hp.com>
Subject: Re: Perl script to automatically find dependencies
Message-Id: <3654769D.17B7@fc.hp.com>
Larry Rosler wrote:
> [Posted to comp.lang.perl.misc and a copy mailed.]
> In article <731lnj$lro$1@mdnews.btv.ibm.com> on 19 Nov 1998 17:49:39
> GMT, David B. White <dbwhite@btv.ibm.com> says...
> > Copy (or add) the END block shown below
> > END { foreach ( sort keys %INC ) { print "$_\n" } }
> > to your application, then run the application and terminate. It
> > will print the list of modules that have been 'use'd or 'require'd
> > by your application.
> @INC is an array,
Correct. It holds the list of places to look for Perl scripts to
be evaluated by "require" and "use" constructs.
> not a hash.
Incorrect. %INC is exactly correct for the described behavior
above. Its keys are the filenames of things "required" or
"used", the values are the locations of where those files were
found.
Arne
------------------------------
Date: 19 Nov 1998 15:43:39 -0500
From: Uri Guttman <uri@fastengines.com>
To: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Perl script to automatically find dependencies
Message-Id: <sar90h7ct1g.fsf@camel.fastserv.com>
>>>>> "LR" == Larry Rosler <lr@hpl.hp.com> writes:
LR> [Posted to comp.lang.perl.misc and a copy mailed.]
LR> In article <731lnj$lro$1@mdnews.btv.ibm.com> on 19 Nov 1998 17:49:39
LR> GMT, David B. White <dbwhite@btv.ibm.com> says...
>> Copy (or add) the END block shown below
>> END { foreach ( sort keys %INC ) { print "$_\n" } }
>> to your application, then run the application and terminate. It will
>> print the list of modules that have been 'use'd or 'require'd by your
>> application.
LR> @INC is an array, not a hash.
larry,
you lose this time. it is both a floor wax AND a dessert topping! if
there were no %INC how could require know that a module had been
loaded already?
actually there is a bug in the %INC doc as it calls it an array (see
below) and not a hash. also it says that 'do' uses %INC which the docs
on 'do' say that there is no checking for previously loaded files using
do'. this is still in 5.005_02. someone who is into it
should send a patch to p5p.
uri
from perlvar:
@INC The array @INC contains the list of places to look
for Perl scripts to be evaluated by the do EXPR,
require, or use constructs. It initially consists
of the arguments to any -I command line switches,
followed by the default Perl library, probably
/usr/local/lib/perl, followed by ".", to represent
the current directory. If you need to modify this
at runtime, you should use the use lib pragma to get
the machine-dependent library properly loaded also:
use lib '/mypath/libdir/';
use SomeMod;
%INC The hash %INC contains entries for each filename
that has been included via do or require. The key
^^
is the filename you specified, and the value is the
location of the file actually found. The require
command uses this array to determine whether a given
^^^^^
file has already been included.
no mention of %INC here (perlfunc):
do EXPR Uses the value of EXPR as a filename and executes
the contents of the file as a Perl script. Its
primary use is to include subroutines from a Perl
subroutine library.
do 'stat.pl';
is just like
scalar eval `cat stat.pl`;
except that it's more efficient and concise, keeps
track of the current filename for error messages,
and searches all the -I libraries if the file isn't
in the current directory (see also the @INC array in
the section on Predefined Names in the perlvar
manpage). It is also different in how code
evaluated with do FILENAME doesn't see lexicals in
the enclosing scope like eval STRING does. It's the
same, however, in that it does reparse the file
every time you call it, so you probably don't want
to do this inside a loop.
--
Uri Guttman Fast Engines -- The Leader in Fast CGI Technology
uri@fastengines.com http://www.fastengines.com
------------------------------
Date: 19 Nov 1998 13:56:33 -0700
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: Perl script to automatically find dependencies
Message-Id: <m3ogq3jta6.fsf@moiraine.dimensional.com>
Uri Guttman <uri@fastengines.com> writes:
> actually there is a bug in the %INC doc as it calls it an array (see
> below) and not a hash. also it says that 'do' uses %INC which the docs
> on 'do' say that there is no checking for previously loaded files using
> do'.
Yup, the docs should call it a hash, not an array. But there isn't an
error concerning the interaction of do with %INC. do doesn't check
%INC to see if a file has already been required, but it does update
%INC with the name of any file it loads so that future requires will
not reload it.
dgris
--
Daniel Grisinger dgris@moiraine.dimensional.com
Supporter of grumpiness where grumpiness is due on clpm.
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'
------------------------------
Date: Thu, 19 Nov 1998 18:40:46 GMT
From: Gareth Rees <garethr@cre.canon.co.uk>
To: terra@diku.dk (Morten Welinder)
Subject: Re: pod2man and Y2K
Message-Id: <sipvajr0ep.fsf@cre.canon.co.uk>
Morten Welinder <terra@diku.dk> wrote:
> Is it just me, or is the pod2man converter broken?
>
> my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($secs);
> my $mname = (qw{Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec})[$mon];
> return "$mday/$mname/$year";
It's not just you, this is a year 2000 bug that should be reported to
perlbug@perl.com.
--
Gareth Rees (posted and e-mailed)
------------------------------
Date: 19 Nov 1998 14:11:05 -0500
From: James Cameron <james@MatadorDesign.com>
Subject: Re: Problem with using Crypt with Perl on Windows NT
Message-Id: <x767cblcqe.fsf@server.matadordesign.com>
Thanks for all your assistance. As someone pointed out, the problem
was that they the user had a very old version of Perl. Recent
versions include a crypt and don't rely on the OS to handle it.
Thanks everyone!
-James Cameron
Matador Design, Inc.
http://www.MatadorDesign.com
------------------------------
Date: Thu, 19 Nov 1998 10:39:31 -0800
From: "Monty Taylor" <montyt@bestnet.com>
Subject: Re: Problem with using Crypt with Perl on Windows NT
Message-Id: <731oli$1ev4@roc344.ghc.org>
I don't know for certain, but I can take a guess...
The client is running an export restriction system (no cryptography to be
exported from the US) and their system has no crypt function, as it is
cryptography. As the prevalant opinion amongst sane people is that the
export restriction is hogwash, I could see that error message as a very
likely response to frustration over the lack of standard functions. To get
around it, if they are out of the country, they would have to break the law
and download the crypt libraries. But, of course, you could never _tell_
them to do that...
Monty
--
--------------------------------------------------------------
Monty Taylor
Best Consulting -- Seattle, WA
montyt@bestnet.com
James Cameron <james@MatadorDesign.com> wrote in message
news:x767cb1w0s.fsf@server.matadordesign.com...
>
>Hi,
>
>We've come across an error message we have never seen before. Someone
>installing our web calendar software (WebEvent) had problems when it
>tried to create the username and password. We use the built-in crypt
>function and they received an error message along the lines of:
>
> crypt is not installed due to excessive paranoia
>
>Does anyone know exactly where this error message is coming from and
>the best solution?
>
>Thanks for any and all your help.
>
>-James Cameron
>Matador Design, Inc.
>http://www.MatadorDesign.com
------------------------------
Date: Thu, 19 Nov 1998 19:42:57 GMT
From: dturley@pobox.com
Subject: Re: Problem with using Crypt with Perl on Windows NT
Message-Id: <731sbt$suk$1@nnrp1.dejanews.com>
In article <x767cb1w0s.fsf@server.matadordesign.com>,
James Cameron <james@MatadorDesign.com> wrote:
> We've come across an error message we have never seen before. Someone
> installing our web calendar software (WebEvent) had problems when it
> tried to create the username and password. We use the built-in crypt
> function and they received an error message along the lines of:
>
> crypt is not installed due to excessive paranoia
>
> Does anyone know exactly where this error message is coming from and
> the best solution?
It's coming from your server. :-) You are probably uising the GS build of
perl. Crypt was not compiled into it because of the rediculous US export
laws. You can get the Active State port, which has crypt built in, since AS
is in Canada. Or you can use Martin Vorlaender's Crypt module at
http://www.pdv-systeme.de/users/martinv/Crypt.pm
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 19 Nov 1998 15:04:56 -0500
From: dblack@pilot.njin.net (David Alan Black)
Subject: Re: programing fun: trees: FlattenAt
Message-Id: <731tl8$7p1$1@pilot.njin.net>
Hello -
dblack@pilot.njin.net (David Alan Black) writes:
>"Xah" <xah@best.com> writes:
>>This week's fun on programing trees: Write the function FlattenAt.
>>Here's the specs:
>>#_____ FlattenAt _____ _____ _____ _____
>>=pod
>>B<FlattenAt>
>>FlattenAt(tree, positionIndex) returns a modified version of given tree
>>where the node (subtree) at positionIndex is moved up to its
>>parent generation (flattened).
>>Related: Flatten, Sequence, xxxxx.
>>Example:
>>FlattenAt(['a', ['b']], [1]); # returns ['a', 'b'].
>Well, here's a stab at it - in the hope of flushing out whoever might
>have a really elegant way of doing it:
And here's a way I like better:
#!/usr/local/bin/perl -w
sub FlattenAt {
my ($tree, @levels) = (shift, @{shift()});
my $offset = pop @levels;
my $parent = $tree;
foreach my $l (@levels) {
$parent = $parent->[$l];
}
my $child = $parent->[$offset];
splice @{$parent}, $offset, 1, @{$child};
return $tree;
}
my $tree = [ [8, ['a']], [3, ['b', 4, ['c', 'd'], 5], 6] ];
my $flat = FlattenAt($tree, [1,1,2]);
print @{$flat->[1][1]} # prints b4cd5
__END__
David Black
dblack@pilot.njin.net
------------------------------
Date: Thu, 19 Nov 1998 11:34:34 -0800
From: Hui Tang <hui.tang@tus.ssi1.com>
Subject: question on system limit
Message-Id: <365472CA.1B0A@tus.ssi1.com>
Hi,
In one of my script I want to change the limits set systemwide, for
example the maximum number of files could be opened. At the shell
prompt, command "unlimit" would do it. But if I put it in a "system"
function call in my Perl script, it doeen't work.
Any hints on how to do this?
Thanks.
Hui
------------------------------
Date: Thu, 19 Nov 1998 19:40:57 +0100
From: "Admin Sunsite" <kontakt@sunsite.ch>
Subject: Requesting URLs from a perl script
Message-Id: <731on0$h0o$1@ubnnews.unisource.ch>
Hi
i have a perl script running on a web-server. Depending on user entries i'd
like to send the User to a specific URL. How do I do that?
Please reaply to webmaster@sunsite.ch
Thanks for your help!
------------------------------
Date: Thu, 19 Nov 1998 19:01:50 GMT
From: bet@network.rahul.net (Bennett Todd)
Subject: Re: snoop'ing in perl
Message-Id: <slrn758rar.p4t.bet@ritz.mordor.net>
On 19 Nov 1998 04:23:46 -0500, Dwalu Khasu <dwalu@csa.bu.edu> wrote:
>
>Can anyone point me to perl modules/libraries/programs
>that are used to interpret network packets? I'd like to do
>something 'snoopish' using perl for a network emulation project
Perhaps Net::Pcap, from either of
<URL:http://perl.com/CPAN/authors/id/PLISTER/Net-Pcap-0.01.tar.gz>
<URL:http://perl.org/CPAN/authors/id/PLISTER/Net-Pcap-0.01.tar.gz>
It's a SWIG <URL:http://www.swig.org/> wrapper around libpcap
<URL:ftp://ftp.ee.lbl.gov/libpcap.tar.Z>, which is basically the
OS-independant glue layer underneath tcpdump.
-Bennett
------------------------------
Date: Thu, 19 Nov 1998 18:54:30 +0100
From: Hendrik Woerdehoff <hendrik.woerdehoff@sdm.de>
Subject: Re: Tracking Subroutines
Message-Id: <36545B56.61D5@sdm.de>
Tim Dolezal wrote:
> I would like to know if there is a variable or a module to track or display the
> current subroutine the script is executing.
perldoc -f caller
Yours
Hendrik
Pursuant to US Code, Title 47, Chapter 5, Subchapter II, Sec. 227,
any and all unsolicited commercial E-mail sent to this address
is subject to a download and archival fee in the amount of $500
US (per infraction). E-mailing denotes acceptance of these terms.
--
Hendrik W"ordehoff |s |d &|m | software design & management
| | | | GmbH & Co. KG :
woerdehoff@sdm.de | | | | Thomas-Dehler-Str. 27 >B)
Tel/Fax (089) 63812-337/515 81737 M"unchen :
------------------------------
Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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 4257
**************************************