[7395] in Perl-Users-Digest
Perl-Users Digest, Issue: 1020 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Sep 13 11:17:14 1997
Date: Sat, 13 Sep 97 08:00:25 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sat, 13 Sep 1997 Volume: 8 Number: 1020
Today's topics:
5.004 and suidperl patch? <ptrainor@aura.title14.com>
Re: A simpler perl question. <merlyn@stonehenge.com>
Re: An array of a list ??? (Jason Gloudon)
Behaviour of chomp( "$/" ) Fred@no.spam.leeds.ac.uk
Re: Behaviour of chomp( "$/" ) (Bart Lateur)
Re: binary distribution of perl for NT4.0 <tlawallANTISPAM@concentric.net>
can Perl create secure shell sessions? <ptrainor@aura.title14.com>
Re: Comparing dates?? (Steffen Beyer)
Re: Declaring dynamically named lexical variables <rootbeer@teleport.com>
Re: Detecting NFS outage while <> <rootbeer@teleport.com>
Re: Globbing does not work on HP-UX 10.20 with perl 5.0 <rootbeer@teleport.com>
Help! Need a Perl pro to stop the crashes! (Jason Hazzard)
HELP! Please perl gurus! What is crashing the server in (Jason Hazzard)
How can I tell which modules are installed ? <jerryp.usenet@SPAMconnected.demon.co.uk>
Re: Howto Parse data in spaced columns??? <merlyn@stonehenge.com>
Re: Is there a more efficient way to interweave 2 array <rootbeer@teleport.com>
Re: Newbie File Locking <petri.backstrom@icl.fi>
Re: perl and IIS <petri.backstrom@icl.fi>
perl book for sale: <jimlewis@telerama.lm.com>
Perl conference (Hal Wigoda )
Re: perl NT and fork (Neil Briscoe)
Re: Reading Binary Files (Jason Gloudon)
Re: reg expression help! (Jason Gloudon)
Re: send values from form, read html result, not displa (Eric Bohlman)
Re: some simple help (Martin Str|mberg)
Stripping excessive characters (Martin Rheumer)
Re: what's the case (Jason Gloudon)
Re: Why don't my <<HERE documents work? <flavell@mail.cern.ch>
Re: WWW & Password Access <rootbeer@teleport.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 12 Sep 1997 22:23:26 -0400
From: Pat Trainor <ptrainor@aura.title14.com>
Subject: 5.004 and suidperl patch?
Message-Id: <Pine.LNX.3.95.970912222215.25730C-100000@aura>
I currently have:
ptrainor[/home/ptrainor]> perl -version
This is perl, version 5.003 with EMBED
built under linux at Jun 27 1996 21:52:16
+ suidperl security patch
Copyright 1987-1996, Larry Wall
Perl may be copied only under the terms of either the Artistic License or
the
GNU General Public License, which may be found in the Perl 5.0 source kit.
...
Does 5.004* have the suidperl security patch already installed in
the distribution version?
pat
:)
# ptrainor@aura.title14.com (PT46) ptrainor@bbnplanet.net
# Perl, PHP/FI, *NIX, HTML, CGI, SQL, RDBMS, NT*, Security, Admin, ...
# "I've got LOTS of experience doing practically nothing!" -Heffer Wolfe
------------------------------
Date: 13 Sep 1997 06:33:42 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: smonson@tri.sbc.com (Steve Monson)
Subject: Re: A simpler perl question.
Message-Id: <8cu3fp5oeh.fsf@gadget.cscaper.com>
>>>>> "Steve" == Steve Monson <smonson@tri.sbc.com> writes:
Steve> Well, aside from
Steve> system("ls -R $dir")
Steve> you might try something like this, which prints all the files in a
Steve> directory before descending to the next one below. You are of course
Steve> free to modify it to act in some other order, and include suitable
Steve> error checking, following symbolic links, etc.
[code deleted]
Or, instead of waiting until it gets all that, you can avoid
reinventing the wheel and use File::Find, shipped with every version
of Perl in the last few years. "perldoc File::Find" for more info.
*Read* "perldoc perlmod" (or "perldoc perlmodlib" if it's 5.004)!
Don't waste time reinventing a (possibly inferior) wheel!
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 353 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: 13 Sep 1997 08:05:42 GMT
From: jgloudon@bbn.com (Jason Gloudon)
Subject: Re: An array of a list ???
Message-Id: <5vdhgm$fpk$1@daily.bbnplanet.com>
In article <34199950.5FB1@nortel.ca>,
Sylvain St.Germain <sgermain@nortel.ca> wrote:
>Hi,
>
> I have a function that behave like this:
>
> @Stuff = [qw/a b c d/];
> Func(@Stuff) ## This is OK
>
> but:
> @Stuff = (qw/a b c d/);
> Func(@Stuff) ## Bad...
>
> The thing is that I am using push to fill @Stuff
> and it seems that @Stuff become more like a list
> than an array albeit I've defined it as an array.
>
> Is there a way to have push resulting an array
> not a list...???
>
>
> FYI: This is in CGI.pm, I want to do
> ...->popup_menu(-values=>@Stuff, ...)
>
> Many Regards,
> Sylvain.
You need to read the perlref manpage to understand how references
are created and used to do what you are attempting here.
Jason Gloudon
------------------------------
Date: Sat, 13 Sep 1997 11:25:38 +0100 (BST)
From: Fred@no.spam.leeds.ac.uk
Subject: Behaviour of chomp( "$/" )
Message-Id: <341ADA3B.994@no.spam>
I am reading line oriented data from a socket, whose
INPUT_RECORD_SEPARATOR I have set to the network "\012\015".
Input of interest consists of a number of lines followed by
a blank line. Calling chomp() on the input data gives the expected
result except for the blank line which remains "\012\015".
Is this what should happen? Am I doing something wrong?
The code that I am using can be represented as:
while( <S> ) {
chomp;
# do something
last
if( /^$/$/ );
}
# use the data collected in the preceding code
(All perl typed anew rather than pasted).
Grateful for any advice or pointers.
Ben.
------------------------------
Date: Sat, 13 Sep 1997 13:36:42 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Behaviour of chomp( "$/" )
Message-Id: <34219651.14859299@news.tornado.be>
Fred@leeds.ac.uk wrote:
>I am reading line oriented data from a socket, whose
>INPUT_RECORD_SEPARATOR I have set to the network "\012\015".
>
>Input of interest consists of a number of lines followed by
>a blank line. Calling chomp() on the input data gives the expected
>result except for the blank line which remains "\012\015".
>
>Is this what should happen? Am I doing something wrong?
If that really happens, it must be a bug. (I haven't tested it).
Anyway, if you replace the chomp statement chomp by the next statement:
tr/\012\015//d;
It will always do what you want, no matter what you set $/ to.
HTH,
Bart.
------------------------------
Date: Fri, 12 Sep 1997 23:30:44 -0600
From: "T. LaWall" <tlawallANTISPAM@concentric.net>
To: Jim McKinney <jmck@elmo.ece.cmu.edu>
Subject: Re: binary distribution of perl for NT4.0
Message-Id: <341A2504.377B@concentric.net>
FYI everyone who is interested, here are the URLs for
two distributions:
ActiveState's distribution,
http://www.activestate.com
Standard Distribution,
http://www.perl.com/CPAN/authors/Gurusamy_Sarathy
Regards,
Todd
--
-------------------------------------------------
T. LaWall
To reply, remove ANTISPAM from my address
-------------------------------------------------
Where do I want to go today?
With Linux, Anywhere I want, TOLL FREE!
-------------------------------------------------
------------------------------
Date: Fri, 12 Sep 1997 22:21:19 -0400
From: Pat Trainor <ptrainor@aura.title14.com>
Subject: can Perl create secure shell sessions?
Message-Id: <Pine.LNX.3.95.970912221741.25730B-100000@aura>
Here's an interesting question:
How can I run a perl script to create a secure shell for user at
logon, and basically exec it so that a ^C or such will cause logoff, and
not dump them into the parent shell?
The reasons for this are various, but mainly, I should be able to
selectively give these shells to select users for select directories and
not have to copy all executables that they will need into those dirs (or
soft link). AND I want to be able to monitor the commands enterred and
restrict certain commands.
Any ideas? I'd feel more comfortable with a Perl script that I can
work with than a c-compiled rsh/ssh..
Anyone?
pat
:)
# ptrainor@aura.title14.com (PT46) ptrainor@bbnplanet.net
# Perl, PHP/FI, *NIX, HTML, CGI, SQL, RDBMS, NT*, Security, Admin, ...
# "I've got LOTS of experience doing practically nothing!" -Heffer Wolfe
------------------------------
Date: 13 Sep 1997 11:06:13 GMT
From: sb@en.muc.de (Steffen Beyer)
Subject: Re: Comparing dates??
Message-Id: <5vds35$9ae$1@en1.engelschall.com>
Burt Lewis <burt@ici.net> wrote:
> I hope this is simple.
> I'm capturing birth dates via a form, something like:
> 09101981 (mmddyyyy)
> I need to determine if the age of this person is greater than 18.
> Anyone have any routines or ideas on the best and easisest way to do this?
That's relatively easy:
-------------------- cut here -------------------- cut here --------------------
#!/sw/bin/perl
use Date::DateCalc qw(:all);
use Date::DateCalcLib qw(:all);
print "\n";
$ok = 0;
while (! $ok)
{
print "Please enter the date of your birthday (month-day-year): ";
$date = <STDIN>;
print "\n";
if (($yy1,$mm1,$dd1) = decode_date_us($date))
{
$datestr = date_to_short($yy1,$mm1,$dd1);
print "Your birthday is: $datestr\n";
print "\n";
print "Is that correct? (yes/no) ";
$response = <STDIN>;
print "\n";
$ok = ($response =~ /^Y/i);
}
}
print "Your birthday is: $datestr\n\n";
($yy2,$mm2,$dd2) = parse_date(`/bin/date`); # get today's date
if (($mm1 == 2) && ($dd1 == 29) && !check_date($yy2,$mm1,$dd1)) { $dd1--; }
if ( (($yy2 - $yy1) > 18) ||
( (($yy2 - $yy1) == 18) &&
(dates_difference($yy2,$mm1,$dd1,$yy2,$mm2,$dd2) >= 0) ) )
{
print "Ok - you are over 18.\n";
}
else
{
print "Sorry - you aren't 18 yet!\n";
}
print "\n";
-------------------- cut here -------------------- cut here --------------------
Note that you can enter the date in almost any format this way as long as
the order of the three items is month - day - year!
For instance you can use numbers for the month or an abbreviation of the
month's name (like "jan", "feb" etc.) - that's up to the user!
You can find this module ("DateCalc-3.2.tar.gz") on any CPAN ftp server
or on my web site at
http://www.engelschall.com/u/sb/download/
Hope this helps.
Yours,
--
Steffen Beyer <sb@sdm.de> http://www.engelschall.com/u/sb/
"There is enough for the need of everyone in this world,
but not for the greed of everyone." - Mahatma Gandhi
>> Unsolicited commercial email goes directly to /dev/null <<
------------------------------
Date: Sat, 13 Sep 1997 07:40:13 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Dan Sumption <dan@gulch.demon.co.uk>
Subject: Re: Declaring dynamically named lexical variables
Message-Id: <Pine.GSO.3.96.970913073742.12359L-100000@julie.teleport.com>
On Fri, 12 Sep 1997, Dan Sumption wrote:
> Can someone tell me how I would declare a lexical variable whose name
> is determined by another variable.
You should probably use a hard reference instead. Otherwise, if you use
eval, your lexical variable's name will be confined to the eval itself!
Or, you could probably do what you want with a hash. The "name" of each
created "variable" becomes a key of the hash, of course.
Good luck!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Sat, 13 Sep 1997 07:44:43 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: "Bradley K. Sherman" <bks@netcom.com>
Subject: Re: Detecting NFS outage while <>
Message-Id: <Pine.GSO.3.96.970913074158.12359M-100000@julie.teleport.com>
On Fri, 12 Sep 1997, Bradley K. Sherman wrote:
> If I am reading a file from an NFS mounted disk and
> the plug is pulled on the remote machine, can I tell
> the difference between this error condition and EOF?
Contrary to some of the posted opinions about this, I believe that you
should be able to tell this, unless there's a bug in your OS or in Perl.
close FILE or warn "File read error: $!";
(If the NFS volume is hard mounted, of course, your code would simply hang
upon trying to read. If you're actually reading from the diamond operator,
you may need to be trickier.) Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Sat, 13 Sep 1997 07:36:56 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Bjoern Nordmann <bjoern_nordmann@hp.com>
Subject: Re: Globbing does not work on HP-UX 10.20 with perl 5.003
Message-Id: <Pine.GSO.3.96.970913071824.12359K-100000@julie.teleport.com>
On Fri, 12 Sep 1997, Bjoern Nordmann wrote:
> Execution of below mentioned code does not work when called as normal
> user, however produces useful output when called as user root.
> @filenames =<$dir/.*> ;
Globbing like that is done by calling csh (or tcsh or sh or something
else, under certain circumstances). Could your csh have permissions set so
that a non-root user can't execute it? If I'm not mistaken (and I
certainly may be mistaken on this) you can find out which program Perl
uses to do the globbing by using this command.
perl -V:full_csh
Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Sat, 13 Sep 1997 09:53:32 GMT
From: hazzard@usa.net (Jason Hazzard)
Subject: Help! Need a Perl pro to stop the crashes!
Message-Id: <5vdns9$lm1$1@brie.direct.ca>
I am right in the middle of programming right now, and having a real fun time!
:(
Anyway, I have a CGI script that uses tie() to a GDBM file, since I heard it
has locking. Well, here's the problem.....
If I run the script, it works fine, accesses the DBM and prints the proper
data. However there is a long 3-4 second pause before the browser actually
finishes trying to download. I expect that this is when the CGI script is
doing the Untie() etc.
Well, if I press the back button before the script has completed, and re-run
it, the whole system may crash for 20 minutes! I can't even access a web page
for 20 mins if it does, and it DOES seem to be DIRECTLY related to my scripts.
What could be going on here? Some kind of wait for a lock? I am very
confused about what is happening. The server will be available after about 20
mins, but I want to stop these crashes!
Any help is GREATLY appreciated!
Jay
(ps. is there a way to shut the browser down, and continue the script?)
------------------------------
Date: Sat, 13 Sep 1997 08:58:21 GMT
From: hazzard@usa.net (Jason Hazzard)
Subject: HELP! Please perl gurus! What is crashing the server in a simple script?
Message-Id: <5vdkkq$j77$1@brie.direct.ca>
Hi Perlers!
I am having real trouble with scripts I am writing, which use tie() to access
an NDBM file. Basically, a script ties to the file, modifies it, then unties.
Now the problem is that there are different scripts using tie() on the same
DBM file. They usually will work ok, but It seems that if the server gets a
bit of multiple usage, the whole server will go down for 20 mins or so before
you can even access a web page! I seem to think its my scripts too! Always
happens when I am testing, on either server, otherwise the servers work great.
I'd blame it on the machines, but its been the same result at 2 different
sites!
Is a sysop rebooting my crashes? Or is there some timeout mechanism? ANY ideas
at all? I'm very confused.
Thanks a MILLION for any replies,
Jay
------------------------------
Date: Sat, 13 Sep 1997 13:16:01 +0100
From: Jerry Pank <jerryp.usenet@SPAMconnected.demon.co.uk>
Subject: How can I tell which modules are installed ?
Message-Id: <davYDAABQoG0Ewb4@connected.demon.co.uk>
My ISP gives me a very limited shell, (only the safest /bin commands are
available) and for security? will not allow perl to be run from the
command line.
This has not caused me problems so far but I can't seem to find which
perl modules are already installed on the server by snooping about.
Is there an easy way to find exactly which module are already installed?
--
This post in every-way totally reflects the views of my employer...
I am he.
Jerry jerryp dot usenet at connected dot demon dot co dot uk
Warning - Wash out the spam filter.
------------------------------
Date: 13 Sep 1997 06:37:14 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: "Raymond K. Bush" <rbush@up.net>
Subject: Re: Howto Parse data in spaced columns???
Message-Id: <8craat5o8l.fsf@gadget.cscaper.com>
>>>>> "Raymond" == Raymond K Bush <rbush@up.net> writes:
Raymond> open (file,("cat somefile|));
I'm sorry, I don't normally hand out "Useless Use of Cat Awards" in
comp.lang.perl.misc as I do in comp.unix.{questions,shell}, but this
one was too good to pass up.
Why fire off a cat process, when:
open file, "<somefile" or die "Bad open: $!";
would have done it?
I'm still puzzled why people use all these cats. :-)
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 353 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: Sat, 13 Sep 1997 07:15:42 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Nim Chu <nimchu@hal-pc.org>
Subject: Re: Is there a more efficient way to interweave 2 arrays?
Message-Id: <Pine.GSO.3.96.970913070542.12359J-100000@julie.teleport.com>
On Fri, 12 Sep 1997, Nim Chu wrote:
> Is there a more efficient way (less cpu, and/or no need to generate a
> third array) to do the equivalent of following code:
>
> @odd=(1,3,5,7);
> @even=(2,4,6,8);
> foreach $i (0..$#even) {
> push @all, $odd[$i], $even[$i];
> }
That's not too bad. I'd also try this.
@all = map { $odd[$_], $even[$_] } 0..$#even;
But I don't know whether it's any faster. It does eliminate the need for
the third array, since you could do something else with the generated
list, such as print it. And, of course, you don't have the global $i
running around anymore, so that should make it faster. (Both suffer from
the assumption that the lists are of the same length.)
But if you really want efficiency, consider making a module to do what you
want with a simple C routine. It shouldn't be too hard, especially if you
get Joseph Hall's book (out soon) which has a section on making such
modules.
http://www.aw.com/devpress/titles/41975.html
http://www.5sigma.com/perl/book.html
Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Sat, 13 Sep 1997 12:21:12 +0300
From: Petri Backstrom <petri.backstrom@icl.fi>
Subject: Re: Newbie File Locking
Message-Id: <341A5B08.5541@icl.fi>
Stephen Hill wrote:
>
> I need to lock a file....I have tried the FAQ and can't get the info I
> need (broken link on page).
>
> Any help on file locking would be appreciated, Please don't tell me to
> use a module, I want the source code :-) Any info on flock too...
Here's "the source code" (well, if not "the" code, at least
one example of the use of flock() ;-)
my $filename = 'myfile.name';
open( FH, ">$filename" ) or die "open of $filename failed ($!)\n";
flock( FH, 2 ) or die "flock failed ($!)\n";
# do whatever you want with the locked file here
# this program is not doing anything, just waiting...
print "sleeping...\n";
sleep( 100 );
close( FH ) or die "close failed ($!)\n";
As to the details, start with the free on-line Perl documentation
that comes with every proper Perl distribution kit; flock() is
documented in the perlfunc part.
If you need more, start with all the good things you can find
through http://www.perl.com
regards,
...petri.backstrom@icl.fi
ICL Data Oy
Finland
------------------------------
Date: Sat, 13 Sep 1997 12:28:03 +0300
From: Petri Backstrom <petri.backstrom@icl.fi>
Subject: Re: perl and IIS
Message-Id: <341A5CA3.404E@icl.fi>
Rick Silverstein wrote:
>
> I have a perl script as a CGI script on NT 4.0 IIS 3.0.
> IIS does not recognize the *.pl as a perl script.
> How do I configure this?
Do as described in the IIS 3.0 online docs section titled
"Associating Interpreters with Applications (Script Mapping)"
or the Perl for Win32 Frequently Asked Questions (FAQ)
list
http://www.endcontsw.com/people/evangelo/Perl_for_Win32_FAQ.html
regards,
...petri.backstrom@icl.fi
ICL Data Oy
Finland
------------------------------
Date: Fri, 12 Sep 1997 15:33:35 -0400
From: "J. Lewis" <jimlewis@telerama.lm.com>
Subject: perl book for sale:
Message-Id: <3419990F.22A@telerama.lm.com>
Using perl 5 for web programming.
includes CD-Rom with 2 complete books on the cd, 1 is using CGI and the
other is using HTML, this book using perl 5 for web programming, covers
CGI SCRIPTING
FORMS PROCESSING
DATA STORAGE
SITE ADMINISTRATION
USER AUTHENTICATION
MODULAR PERL SCRIPTS
CGI SECURITY
HIGH LEVEL CGI,
NOTE: This is a fairly advanced book so you need a fairly good working
knowledge of perl to use it.
cost $25.00 and I pay shipping in the USA.
email if interested.
thanks
------------------------------
Date: 13 Sep 1997 12:04:34 GMT
From: hwigoda@Mcs.Net (Hal Wigoda )
Subject: Perl conference
Message-Id: <199709030359.WAA20216@Venus.mcs.net>
Pictures of larry wall,
randall schwartz,
tom chritiansen,
and others
is at www.wigoda.com/perl.html
------------------------------
Date: 13 Sep 1997 05:19:25 GMT
From: neilb@zetnet.co.uk (Neil Briscoe)
Subject: Re: perl NT and fork
Message-Id: <memo.19970913061925.8613F@skep.compulink.co.uk.cix.co.uk>
In article <3419B49E.B7FD3625@alben.com>, bpollak@alben.com (Benny Pollak)
wrote:
> Is there an implementation of perl5 for NT that implements fork()?
> Benny
>
>
Purportedly, yes. You first need to get cdk.exe from www.cygnus.com -
can't remember the full path. This contains the cygwin32 tools, including
a gcc which works under win32.
Then, you need some patches for perl. Someone posted them hereabouts
recently.
You patch the standard perl source tree with these patches and Configure,
make depend, make, make test and make install as usual.
Fork() is supported.
Regards
Neil
------------------------------
Date: 13 Sep 1997 07:41:45 GMT
From: jgloudon@bbn.com (Jason Gloudon)
Subject: Re: Reading Binary Files
Message-Id: <5vdg3p$dlk$1@daily.bbnplanet.com>
In article <5vbl2f$adq$1@ci.ist.utl.pt>,
The Flash <l42452@alfa.ist.utl.pt> wrote:
>Hello All !
>
> I would like to know how can I read information from a binary file.
>I am making a substitute for finger using perl and I need to know how can I
>access the information on the wtmp and utmp files in a UNIX system.
>
> If anybody could help me I would be very gratefull.
>
> I prefer answers by e-mail.
>
>
> Thanks !
>
>Jorge Tavares
>the.flash@bigfoot.com
For reading binary files you need to know how to use the function read.
And since you want to read utmp entries you'll want to also read up on
unpack, and refer to the header file on your system that documents
the utmp structure.
Jason Gloudon
------------------------------
Date: 13 Sep 1997 06:53:04 GMT
From: jgloudon@bbn.com (Jason Gloudon)
Subject: Re: reg expression help!
Message-Id: <5vdd8g$9cn$1@daily.bbnplanet.com>
In article <3418386b.172810570@news.supernews.com>,
Alex Krohn <alex@gossamer-threads.com> wrote:
>I'm having some problems with reg expression and variable
>substitution. Here's what I have so far:
>
>$search = "\\Qtest\\E";
>$match = ($values[$field] =~ /$search/);
>
>won't produce a match, yet
>
>$match = ($values[$field] =~ /\Qtest\E/);
>
>will! I was under the impression that $search would be expanded to
>'\Qtest\E' and the \Q and \E would be interpreted properly (as meaning
>quote whatever is in between).
What you really want to use is /\Q$search\E/.
The idea here is that Perl looks for \Q,\E pairs when it compiles (or evals)
your code and "remembers" to quote any metacharacters that it finds within the
\Q,\E pair , which is the value of $search in this case.
You could use this quoting to exactly match the string 'Yes...?' where you
didn't want to escape all the .'s and ?'s manually and say
/\QYes...?\E/ instead of /Yes\.\.\.\?/
When you say this:
>$match = ($values[$field] =~ /$search/);
Perl sees no \Q - \E pairs when it compiles it, and evaluates /$search/
as though it were in double quotes, where "\Q" = 'Q' and "\E" = 'E'.
So $search yields "\Qtest\E" which is really 'QtestE'. This is what
your code will match on. Try it.
Jason Gloudon
------------------------------
Date: Sat, 13 Sep 1997 10:01:59 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: send values from form, read html result, not display it?
Message-Id: <ebohlmanEGFyJB.Iur@netcom.com>
Mark Worsdall (jaydee@worsdall.demon.co.uk) wrote:
: There is a certain service that allows one to pass it two values from a
: form, it then generates a html page with the answer.
: Using perl I want to call the script on the server, but instead of the
: html page being displayed, I want to read it into memory, search for the
: parts I want, and build my own page including the values returned from
: the original page, then display them as an html page.
The LWP module, available at finer CPAN sites near you, is what you want
for connecting to the remote server.
------------------------------
Date: 13 Sep 1997 13:12:02 GMT
From: ams@ludd.luth.se (Martin Str|mberg)
Subject: Re: some simple help
Message-Id: <5ve3f2$btd$1@news.luth.se>
D'Andre Ladson (dandre@efficient.com) wrote:
:
:
: I have a script that works fine form the command line but
: fails when posted from the WWW. The error I received is that
: the HOME: Undefined variable.
:
: I think I need the equivalent of setenv HOME /user/home in
: my perl script, but I can't figure out how to call it out
: from perl.
:
: I can print out the HOME env variable with print "$ENV{'HOME'}\n";
: but I just can't figure out how to set the HOME within my perl
: script. I know this simple but I'm having a major brain fart.
:
: Any help is appreciated.
:
: D'Andre
: dandre@efficient.com
Indeed: try $ENV{'HOME'} = /user/home.
Right,
MartinS
------------------------------
Date: 13 Sep 1997 12:04:37 GMT
From: mrheumer@mogwai.hotkey.net.au (Martin Rheumer)
Subject: Stripping excessive characters
Message-Id: <3.0.32.19970907204059.006dc3ec@mogwai.hotkey.net.au>
Newbie Question.
I have currently a shell script like this
#!/bin/sh
echo Content-type: text/plain
echo
/usr/local/bin/snmpwalk -v 1 xx.xx.xx.xx public
.iso.org.dod.internet.private.enterprises.307.3.2.1.1.1.4
which produces this when run as a cgi script.
enterprises.307.3.2.1.1.1.4.1 = "aaa"
enterprises.307.3.2.1.1.1.4.2 = "bbb"
enterprises.307.3.2.1.1.1.4.3 = "ccc"
I want to use a perl script ( To increase my knowledge )
and turn this into just the aaa and bbb and ccc in a list.
Hope someone can assist me.
Martin
------------------------------
Date: 13 Sep 1997 07:51:40 GMT
From: jgloudon@bbn.com (Jason Gloudon)
Subject: Re: what's the case
Message-Id: <5vdgmc$ehu$1@daily.bbnplanet.com>
In article <n8pcv5.u74.ln@localhost>, Tad McClellan <tadmc@flash.net> wrote:
>Edwin Bishop (edbishop@hotmail.com) wrote:
>
>: It is working fine, except, I want it
>: to ignore case (upper/lower)....
>
>: if ($database_row =~ "$username") {
>: print (@input);
>: }
>
>
> if ($database_row =~ /$username/i) {
Some might like to say : /(?i)$username/, but it's doesn't gain much here
>
>
>Quotes are for strings.
>
>Pattern matches are what you want there, not a string...
>
>
>--
> Tad McClellan SGML Consulting
> tadmc@flash.net Perl programming
> Fort Worth, Texas
Jason Gloudon
------------------------------
Date: Sat, 13 Sep 1997 10:38:58 GMT
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Why don't my <<HERE documents work?
Message-Id: <Pine.A41.3.95a.970913122755.78606C-100000@sp072>
On Fri, 12 Sep 1997, Faust Gertz wrote:
> On 12 Sep 1997 08:28:55 +0200, Ronald Fischer <rovf@earthling.net>
babbled:
> >Try this:
> >
> >print <<EOF;
> >This is a test!
> >EOF; # <------ !!!!!
> >exit;
>
> No luck.
Of course not.
..
> But thanks.
That wouldn't be my reaction to having my time wasted by bogus answers.
> If I resolve this problem, I will post the solution in case
> others are having these kinds of problems.
Please do: AFAICS you've had all the suggestions that could be based
on what's in your source code, so if you've eliminated those then it
seems to point to a bug in the version you're using.
I've no idea about the situation at your provider, but there's nothing
magic about perl, it can perfectly well be installed and run as a user
program.
It's been my experience that when a usenaut says "try this:" then it's
almost always followed by a bogus answer. Along with excessive quoting
(and especially quoted sigs), it seems to be a pretty reliable indicator
of answers that need to be taken with a very large pinch of salt. HTH.
------------------------------
Date: Sat, 13 Sep 1997 07:53:39 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Toni Makela <makela@riksu.hamkk.fi>
Subject: Re: WWW & Password Access
Message-Id: <Pine.GSO.3.96.970913074810.12359N-100000@julie.teleport.com>
On Fri, 12 Sep 1997, Toni Makela wrote:
> Is it possible to create system that ask validation for every one of my
> HTML-pages when they are accessed!
Yes, it's possible, and it'll be a real nuisance that will help to keep
your hit counters from reaching high numbers. :-)
If your server doesn't offer this popular feature, simply change to one
which does. Because this answer and question have no Perl in them, this
isn't really on-topic for this Perl-related newsgroup; it's really a
server question. If you have more server questions that aren't answered in
docs and FAQs, please post them in a newsgroup about servers. Thanks!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 1020
**************************************