[8473] in Perl-Users-Digest
Perl-Users Digest, Issue: 2090 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Mar 13 13:08:19 1998
Date: Fri, 13 Mar 98 10:00:27 -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 Fri, 13 Mar 1998 Volume: 8 Number: 2090
Today's topics:
Re: Are There Any Snazzy Perl Editors for Windows? <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
Re: array question <jdporter@min.net>
Re: cgi-lib.pl available on oracle webserver3.0.1.8 ? (Richard Bellavance)
Contents of a file into checkbox's [CGI.pm] (tony)
Date Zeros preservation (Eric A. Mathiasen)
Re: Date Zeros preservation <Tony.Curtis+usenet@vcpc.univie.ac.at>
diagnostics, warn, tie HANDLE <jdporter@min.net>
Re: EEEEEK, trying to work with perl and Microsoft!! (Brian Sawert)
Re: find a word (Mike Wescott)
FULL TIME Perl'er needed in San Diego michael@freedomstarr.com
Re: Good Perl book <upsetter@shore.net>
Re: Good Perl book (User)
Re: Help needed on I/O in CGI written with perl!!! (Andrew M. Langmead)
Re: Is there a "Newsgroup" for Newbies to Perl? <jim.michael@gecm.com>
Re: Is there a "Newsgroup" for Newbies to Perl? <a@b.c.d>
Re: Is there a "Newsgroup" for Newbies to Perl? <jason@primal.ucdavis.edu>
Newbie: stuck in endless loop! <stackhou@elk.cray.com>
Re: Perl equivalent for /bin/which schwern@starmedia.net
Re: perldoc -f question (Richard Bellavance)
Re: Q: Threads (in 5.004_62) and signals <sfarrell+usenet@farrell.org>
Read one line of a file <cook.jeff@usa.net>
Re: Redirecting to a script on another server. <G.S.Cooper@iti.salford.ac.uk>
Run subroutines from another CGI file? <ben@wallroyds.demon.co.uk>
Re: tainted glob confusion <flavell@mail.cern.ch>
Re: Time delayed response <brianm@kodak.com>
Re: Traversing directory trees. schwern@starmedia.net
Two Actions: Print in File AND Sendmail ? <sd@mail.hbi.uni-hamburg.de>
Re: Way of testing whether a variable is blessed <jdporter@min.net>
Re: You have 1 message(s) - how to print plurals? <tchrist@mox.perl.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 13 Mar 1998 09:25:04 -0800
From: "Creede Lambard" <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
Subject: Re: Are There Any Snazzy Perl Editors for Windows?
Message-Id: <6ebq1b$3iq@bgtnsc02.worldnet.att.net>
dk smith wrote in message ...
>In article <3508D591.3546EF56@technologist.com>, Tommy
><tkho@technologist.com> wrote:
>
>> I have seen the question on Win95 Perl Editor many times.
<snip>
>Please include Mac OS editors too.
If you're including Mac editors you have to include Alpha. Not only does it
support keyword and comment coloring but you can run your Perl script
directly from Alpha.
I've missed most of this discussion so I don't know if anyone has mentioned
Programmer's File Editor (PFE) for Windows yet. It doesn't support keyword
coloring but its ability to show line numbers and multiple documents beats
Notepad all hollow (and on Win95 its ability to handle long text files that
Notepad chokes on makes it even better). Plus, it has the best price of all
(free).
--- Creede Lambard
Minister of Irregular Expressions
Programming Republic of Perl
------------------------------
Date: Fri, 13 Mar 1998 11:57:22 -0500
From: John Porter <jdporter@min.net>
Subject: Re: array question
Message-Id: <35096572.2C77@min.net>
Jon Drukman wrote:
>
> John Porter <jdporter@min.net> wrote:
> > > So $VG contains "vg00" and you then want to create @vg00, right?
> > Blargh, just use symbolic refs.
>
> symbolic references have a host of problems. (can only refer to
> global variables being the big one.)
>
> i think for this problem the original poster should use a hash of
> lists. see perldsc and perlref documentation for details.
Oh, no question. I was just "fixing" Hunter's suggestion.
John Porter
------------------------------
Date: 13 Mar 1998 11:08:47 -0500
From: charlot@CAM.ORG (Richard Bellavance)
Subject: Re: cgi-lib.pl available on oracle webserver3.0.1.8 ?
Message-Id: <6eblmf$ap5@ocean.CAM.ORG>
In article <6eajk6$o0t$1@green.kreonet.re.kr>,
Lee Sang Joon <passman@taewool.co.kr> wrote:
>
>cgi-lib.pl available on oracle webserver3.0.1.8 ?
>Plz tell me about that by detail.
>
cgi-lib.pl is obsolete, you should use CGI.pm instead. It will work with
any webserver that correctly implements the CGI.
Richard.
--
Richard Bellavance -- charlot@cam.org -- http://www.cam.org/~charlot/
"All along this path I tread / My heart betrays my weary head
With nothing but my love to save / From the cradle to the grave"
(Eric Clapton, "From the cradle")
------------------------------
Date: Sat, 14 Mar 1998 03:20:41 +1100
From: td@lavalink.com.au (tony)
Subject: Contents of a file into checkbox's [CGI.pm]
Message-Id: <td-1403980320410001@mtterror.lavalink.com.au>
Hi,
I'm trying to get a script to read the contents of a file and produces a
series of checkboxes (html file that is), depending on the contents of a
file.
One checkbox for each item within the file.
The file is space separated and in a single line.
My knowledge of perl doesn't really help me understand why the section
I've commented out (with "#???#" see below) works but when I get my script
to read the contents of a file it doesn't?
Any help and/or pointers would be greatly appreciated.
Thanks!
Tony
This is my scrpit so far:
#############################################################################
#!/usr/bin/perl
use lib '/home/td/bin/';
use CGI qw(:standard);
$query = new CGI;
$input=catlist; # 'catlist' is a space seperated file in a single line
# consisting of: eenie meenie minie
# the actual file might be tab seperated though
# depends on whether I can work it out with spaces first
open (INPUT, $input) ;
@my_file_contents = <INPUT>;
#???# @my_file_contents = qw [eenie meenie minie]; # if uncomment this it works
print $query->header;
print "my_file_contents = ", @my_file_contents , "<BR>\n";
print start_form,"<HR>";
print checkbox_group(-values=>[@my_file_contents]); # should be a list
here
# checkbox for each item
# not a single checkbox and a list
###############################################################################
------------------------------
Date: 13 Mar 1998 16:44:07 GMT
From: emathias@wwa.com (Eric A. Mathiasen)
Subject: Date Zeros preservation
Message-Id: <6ebnon$3h5$1@hirame.wwa.com>
Is there a way to preserve the zeros in a time when putting it into
a variable from the localtime() funtion? What I seem to end up with is
stuff that looks like this:
1998 Mar 13, 10:4:35
Which is supposed to look like this:
1998 Mar 13, 10:04:35
It's not a huge deal since I can still read the time, but it would be
nice if it was in the "normal" format.
Thanks,
-Eric
--
Eric A. Mathiasen | eric@mathiasen.com | www.mathiasen.com
------------------------------
Date: 13 Mar 1998 17:55:27 +0100
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: Date Zeros preservation
Message-Id: <7xd8fqzg1s.fsf@beavis.vcpc.univie.ac.at>
Re: Date Zeros preservation, Eric <emathias@wwa.com> said:
Eric> Is there a way to preserve the zeros in a time when
Eric> putting it into a variable from the localtime()
Eric> funtion? What I seem to end up with is stuff that
Eric> looks like this:
POSIX::strftime
hth
tony
--
Tony Curtis, Systems Manager, VCPC, | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien, AT | http://www.vcpc.univie.ac.at/
"Everything I am, I learned on the back of cereal boxes" ~ RJ, "Over the Hedge"
------------------------------
Date: Fri, 13 Mar 1998 11:06:20 -0500
From: John Porter <jdporter@min.net>
Subject: diagnostics, warn, tie HANDLE
Message-Id: <3509597C.2DBE@min.net>
It looks to me like diagnostics.pm intercepts warning
messages by setting a __WARN__ handler.
Has anyone tried to make a similar thing that instead
intercepts prints to STDERR, by tieing to STDERR?
It would make a nice example of an output postprocessor.
(If no one has done, I guess I'll have to be the one...)
John Porter
------------------------------
Date: Fri, 13 Mar 1998 16:27:51 GMT
From: bas.nospam@dana.ucc.nau.edu (Brian Sawert)
Subject: Re: EEEEEK, trying to work with perl and Microsoft!!
Message-Id: <35095d2d.58695289@usenet.nau.edu>
On Thu, 12 Mar 1998 03:34:38 GMT, hazzard@usa.net (Jason Hazzard)
wrote:
>I have written some scripts in PERL, they are actually CGI scripts which
>use DBM to create and read database files. I have used them sucessfully
>on various systems with NDBM GDBM etc.... But all these systems were
>UNIX servers.
>
>My question is, can these scripts run on a Microsoft IIS server? Are DBM
>routines installed with perl, or are they native to UNIX only? They
>didnt seem to want to work for me! And how do I find out what packages I
>can use... GDBM seems to be the most highly recommended.
I ran into the same predicament. I'm running version 5.003_07
(ActiveWare) on NT4.0/SP3. Of the many varieties of database files,
(NDBM, DB, GDBM, SDBM, ODBM), only SDBM is included in the
distribution. I had no luck finding Win32 ports of GDBM or the others.
If you find another option, I'd like to hear about it. Good luck!
------------------------------------------------------------
Brian Sawert
Information Technology Services
Northern Arizona University
------------------------------
Date: 13 Mar 1998 12:22:45 -0500
From: wescott@cygnus.ColumbiaSC.NCR.COM (Mike Wescott)
To: Francesc Guasch <frankie@etsetb.upc.es>
Subject: Re: find a word
Message-Id: <x4ra46o68q.fsf@cygnus.ColumbiaSC.NCR.COM>
In article <35091FC2.E7DBC8F3@etsetb.upc.es> Francesc Guasch <frankie@etsetb.upc.es> writes:
> I'd appreaciate if someone could give me an example
> of how to find the first word in a string.
> Someone gives me $a="blah "
> spaces
> I want $b="blah" but I've been playing with \W and \w
> unsuccessfully and I'm driving myself crazy 'cause I
> see it must be EASY
> I tried many many things ...
> why didn't that worked ?
> $_="blah ";
> $b=~ /(\W)/g
First, =~is a binding operator and *not* an assignment operator. Second,
I don't why you would use that regexp. Does this make more sense?
$_ = "blah ";
/(\w+)/; # $_=~ is implied
$b = $1;
Or how about
$_ = "blah blah2 blah3 blah4";
@b = split /\W+/;
--
-Mike Wescott
mike.wescott@ColumbiaSC.NCR.COM
------------------------------
Date: Fri, 13 Mar 1998 11:10:17 -0600
From: michael@freedomstarr.com
To: atticus@golddiggers.com
Subject: FULL TIME Perl'er needed in San Diego
Message-Id: <6ebp78$9mn$1@nnrp1.dejanews.com>
Greetings all Perlers!!!
I know there are job boards for these types of posts, so I appreciate your
tollerance whilst I attempt to find a talented perl programmer from the
readers of this newsgroup. :O)
We are a fast-paced, rapidly-growing internet-based telecommunications company
with some very unique services (and many future projects) that are highly
perl/cgi intensive.
We are located here in beautiful North Country San Diego, CA.
The position offers a starting salary of $40,000/year (negotiable depending on
your experience) as well as stock options and health/dental benefits.
We need someone who LOVES perl and cgi work, and has at least a fair
understanding of basic UNIX system administration. (we use Red Hat Linux on
all our boxes here).
Our office is upbeat, our ideas are fresh, and we need someone willing to work
hard to help us grow our company in exchange for a great learning experience,
equity in the corp., and other benefits including a salary that will increase
based on performance.
If you're interested, please either call me directly at 760-781-5515 or email
me at michael@freedomstarr.com.
Feel free to check out our main corp. website at:
http://freedomstarr.com (use code RE6155133 to enter the site from there).
Sincerely,
Michael Starr Reed
Pres./CEO
FreedomStarr Communications, Inc.
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 13 Mar 1998 15:41:15 GMT
From: Art Cohen <upsetter@shore.net>
Subject: Re: Good Perl book
Message-Id: <6ebk2r$ilo@fridge.shore.net>
Ed Jamison <edwardt@i.really.really.hate.spam.jamison.com> wrote:
: Hmmm, no. Avoid this one if you can. It fits well in the listings with
: the other ones. Sub par quality. Stick with Learning Perl, or
: Programming Perl.
I agree. Start with the Llama, unless you're very ambitious and have a lot
of experience programming already. I just assessed the 2nd Edition of
Learning Perl for a CGI class I'm teaching and it's notably better than
the first edition (mainly because it introduces you to lots of useful Perl
5 features right away). I would recommend it unreservedly; it stands head
and shoulders above any other Perl or CGI book I've ever seen.
The first time I taught this course I used Sams.Net's "Learn CGI
Programming in 7 days", a book I would avoid like Ebola. It has typos in
some of the program listings, the Perl "tutorials" are completely
unrelated to the rest of the book's content, and some of the example
scripts aren't even complete. Also, the CD-ROM is a joke. The quality
control seems to have been nonexistant, and the changes between "Learn CGI
Programming With Perl" and "Learn CGI Programming With Perl 5" were purely
cosmetic. I would be very wary of this publisher. I haven't seen the "Perl
For Dummies" book, but I can't imagine why a dummy would want to learn
Perl in the first place. Get the Llama book: it's "Perl For Smarties".
--Art
National Ska/Reggae Calendar: www.ziplink.net/~upsetter/ska/calendar.html
Boston Ska Home Page: www.ziplink.net/~upsetter/ska/index.html
------------------------------
Date: Fri, 13 Mar 1998 17:29:45 GMT
From: you@somehost.somedomain (User)
Subject: Re: Good Perl book
Message-Id: <35096c7e.13642887@news.btinternet.com>
Whats wrong with the book specifically ?
I found it a really useful book, as someone who knew nothing about
perl, to someone who now knows they know very little about perl :->
As a beginners book ,what is specifically wrong with it to be "sub par
quality". The other books are very dry to start with, and not
something you can really read on the train on the way home.
Ian
On Fri, 13 Mar 1998 15:21:06 GMT,
edwardt@i.really.really.hate.spam.jamison.com (Ed Jamison) wrote:
>Hmmm, no. Avoid this one if you can. It fits well in the listings with
>the other ones. Sub par quality. Stick with Learning Perl, or
>Programming Perl.
>
>Ed
>
>
>Long ago (Fri, 13 Mar 1998 14:34:19 GMT), in a land far far away,
>you@somehost.somedomain spouted nonsense similar to this...
>> On Tue, 10 Mar 1998 14:05:57 -0600, bwb@acm.org wrote:
>>
>> 8-< Snip !
>>
>> I'll vouce for Perl for Dummies, geat book , you can actually read it
>> as a book rather than a dry text book, not geat at the advanced stuff
>> but really good for beginners.
>> >
>> > http://www.flathill.com/languages/perl/
>> >
>> >
>> >-----== Posted via Deja News, The Leader in Internet Discussion ==-----
>> >http://www.dejanews.com/ Now offering spam-free web-based newsreading
>>
>>
------------------------------
Date: Fri, 13 Mar 1998 15:40:35 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Help needed on I/O in CGI written with perl!!!
Message-Id: <EprKvn.CK3@world.std.com>
Sadi Kose <kose@cae.wisc.edu> writes:
>I wrote a CGI program using perl. It first opens a file ( i.e
>open(FOUT,">somefile.ext") ) and writes some things in there. The when
>I try to open it in append mode ( i.e open(ADD,">>somefile.ext") ) it
>deletes all the previous data.
>Also when I try to open it to read (i.e open(FIN,"somefile") ) it again
>deletes all the previous information in the file.
You should probably use one filehandle for all of these actions. Maybe
open the file in read/write module with "open FILE, "<+somefile.txt"
(checking the return status from open(), of course) using seek() to
get to the end of the file and writing, while at the end of the file,
perform another write to append to the file, and then using seek()
again move to the beginning and read.
Some of what you are seeing is due to the buffering perl does before
committing your changes to the operating system. When you write output
with print() or something, perl saves up smaller chunks in memory so
that it only has to write one big chunk.
So when you opened for write, the OS truncated your file to 0 bytes,
when you said print(), perl took you data and just held it. When you
opened for append, it appended to the truncated file. When you wrote
your appended data, perl held onto that too. When you tried to read,
it read from the file that was truncated to 0 and had 0 bytes appended
to it.
>I was wondering if this might have anything to do with the file and
>directory permitions?
That is another very likely problem. Especially since most systems
have CGI scripts run under a different UID as the user who created
them, and the environment in which they run can be dramatically
different.
Luckily, perl functions that call the operating system report whether
they succeeded or not, and if they did not, they return their error in
the $! variable. So you could say something like:
use CGI;
use CGI::Carp 'fatalsToBrowser';
open FILE, '<+somefile.ext' or die "Can't open somefile.ext: $!\n";
to have perl and the CGI module (you are using the CGI module to take
care of the CGI stuff, aren't you?) report the error to the browser
that requested that the script be run.
--
Andrew Langmead
------------------------------
Date: Fri, 13 Mar 1998 11:12:21 -0500
From: Jim Michael <jim.michael@gecm.com>
Subject: Re: Is there a "Newsgroup" for Newbies to Perl?
Message-Id: <35095AE5.24DA@gecm.com>
Mark P Stackhouse wrote:
> Do you really expect a "Newbie" to buy and read 4 books at the same
> time? I have, and am reading "Learning Perl", but I still get confused
> sometimes. Sorry, but my mind isn't a steel trap! I DO, use the
In the immortal words of a former QM prof, "Which word are you having
difficulty with?". Seriously, if there is a point you are unclear about,
this is a good place to ask about it. There is a big difference between
doing your research and asking for clarification vs. asking "how do i
..." without bothering to look for the answer on your own in the many
resources available, many of which are free such as your online docs and
perl.com.
Cheers,
Jim
--
------------------------------
Date: 13 Mar 1998 12:12:34 -0500
From: Myles Barrett Williams <a@b.c.d>
Subject: Re: Is there a "Newsgroup" for Newbies to Perl?
Message-Id: <lc1zw6ms59.fsf@duncan.cs.utk.edu>
Jonathan Feinberg <jdf@pobox.com> writes:
> Now, nobody here minds answering questions.
I'd have to differ with you, Jonathan. There are *some* people
subscribing to this newsgroup (no names) who hate answering questions.
Yet for some strange reason they do it anyway, until it burns them
out.
I think adding a comp.lang.perl.help newsgroup would be a good thing.
I'd rather see that than moderation.
------------------------------
Date: Fri, 13 Mar 1998 09:33:15 -0800
From: Jason Christian <jason@primal.ucdavis.edu>
Subject: Re: Is there a "Newsgroup" for Newbies to Perl?
Message-Id: <Pine.OSF.3.95.980313092357.29355F-100000@primal.ucdavis.edu>
On Fri, 13 Mar 1998, Mark P Stackhouse wrote:
>
> > There are pleanty of mentors at the University. They get paid, and
> ^
Good won. Spelling flames, especially directed at possible typos, will
win you won ton of friends.
> With all your education, I'd think you could at LEAST spell, or learn
> how to use a spell checker. The word is "plenty" not "pleanty".
>
> > they're called professors, tutors, teaching assistants, etc.
>
> Sorry... I'm not a student (literally) anymore, although I do believe
> life is about learning. Believe me, if I can find an on-line class or a
> night class next Fall, (we are in the middle of Spring semester you
> know) I'll be the first one in line. Right now, I'm on the "job" and
> expected to produce results now, not next Fall.
You don't tell us where you are. If you are in the San Francisco Bay
Area, U.C. Extension offers classes, usually on weekends, in Beginning
Perl (as well as more advanced courses) in such exotic locales as San
Francisco, San Ramon, and I think at a site in the South Bay. If you
are in Colorado, I understand there are some very fine courses offered
in the Boulder area. Dunno if billiard tutorials are included. I
suspect that there are public courses, offered on schedules convenient
to people with day jobs, elsewhere around the country.
Like the science fiction writer said, TANSTAAFL.
---------------------------------------------------------------------------
Jason Christian University of California, Davis
jason@primal.ucdavis.edu Agricultural and Resource Economics
Office:(530)752-1357 FAX:(530)752-5614 Davis, CA 95616
------------------------------
Date: Fri, 13 Mar 1998 11:22:16 -0600
From: Mark P Stackhouse <stackhou@elk.cray.com>
Subject: Newbie: stuck in endless loop!
Message-Id: <35096B48.7566@elk.cray.com>
Well... I'm back.
Before I get flamed... yes I have the book "Learning Perl"... and yes I
am reading it... and yes I checked perlfaq... and yes... I did jump
ahead to chapter 7.
Happy now James and David?
I'd like to use a "while" loop in the code below but if I do, I end up
in an endless loop. Why? I've checked my <STDIN> against my compare
with a print command. They look like they match to me! What am I
missing here?
print "Do you want to query from the `source' or `destination' end of
the net? ";
chomp ($which_end = <STDIN>);
$which_end = "\L$which_end";
print "$which_end";
if ($which_end ne /source/ || $which_end ne /destination/)
{
print "\n\n";
print "Excuse me?... that must be a typo!";
print " Try again please. ";
chomp ($which_end = <STDIN>);
$which_end = "\L$which_end";
}
print "$which_end"; #check
print "\n\n";
print "Enter the `System' error location... ";
chomp($error_location=<STDIN>);
print "\n\n";
--
Mark Stackhouse
x64704
*********************************************************
*
* Senior Electrical-Mechanical Technician
* Homepage - http://wwwmfg.cray.com/~stackhou
* E-mail - stackhou@elk.cray.com
*
* Off site homepage - http://www.execpc.com/~stackhou
*
* Home E-mail - stackhou@execpc.com
*
* "The best things in life aren't things"
*
*********************************************************
------------------------------
Date: Fri, 13 Mar 1998 11:22:41 -0600
From: schwern@starmedia.net
To: stephane.barizien@ocegr.fr
Subject: Re: Perl equivalent for /bin/which
Message-Id: <6ebpu2$afe$1@nnrp1.dejanews.com>
A quick search for "which" on CPAN didn't find anything. Here's something
simple and stupid:
sub which {
my $filename = shift;
my $wantarray = wantarray;
foreach (split /:/, $ENV{'PATH'}) { # Not sure how portable this is.
if( -x "$_/$filename" ) {
push @which, "$_/$filename";
last unless $wantarray;
}
}
return @which;
}
@perls = which 'perl'; # return all perls in your path.
$perl = which 'perl'; # Just one perl. Equivalent to /bin/which
In article <6e6c2c$oh01@janus.ocegr.fr>,
"Stephane Barizien" <NOSPAM.stephane.barizien@ocegr.fr> wrote:
>
> Maybe (probably) a newbie's question: how do I perform the equivalent of
> /bin/which (or, for Korn Shell addicts, the equivalent of "whence" or
> "type") in a Perl program?
>
> I can of course parse $ENV{"PATH"} myself, but there sure is a
> simpler-don't-reinvent-the-wheel method out there (CPAN?)
>
> TIA
>
>
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 13 Mar 1998 11:18:04 -0500
From: charlot@CAM.ORG (Richard Bellavance)
Subject: Re: perldoc -f question
Message-Id: <6ebm7s$b2i@ocean.CAM.ORG>
In article <35094A3D.948270BD@uswest.com>,
Ryan Rucker <rxruck2@uswest.com> wrote:
>
>My assumption is that the "-f" option came after perl 5.002. Could some
>verify this?
>
Yep, the -f option to perldoc is a Perl 5.004 addition. Another reason
to upgrade, I guess (as if the bug corrections weren't enough :-)
Richard.
--
Richard Bellavance -- charlot@cam.org -- http://www.cam.org/~charlot/
"All along this path I tread / My heart betrays my weary head
With nothing but my love to save / From the cradle to the grave"
(Eric Clapton, "From the cradle")
------------------------------
Date: Fri, 13 Mar 1998 17:22:17 GMT
From: stephen farrell <sfarrell+usenet@farrell.org>
Subject: Re: Q: Threads (in 5.004_62) and signals
Message-Id: <87btvazet2.fsf@phaedrus.uchicago.edu>
mbeattie@sable.ox.ac.uk (Malcolm Beattie) writes:
[snip]
> use Thread::Signal;
[snip]
So where can I find out more about threading in perl... I'm familiar
with malcolm's web page (http://users.ox.ac.uk/~mbeattie/), but there
is not much there. (or is pods that come with the latest development
version the only available resource?)
Thanks
--sf
------------------------------
Date: 13 Mar 1998 17:00:10 GMT
From: "Jeffrey M. Cook" <cook.jeff@usa.net>
Subject: Read one line of a file
Message-Id: <01bd4e41$ceae6ba0$732ac9cc@rainer>
How do I read one line of a text file do something then the same to the
next line in the text file?
Thank you for any help!
Jeff
--
____________________________________________________________
When sending me e-mail sent it to cook.jeff@usa.net
PC & CADD Solutions NW
www2.memes.com/pcandcad
____________________________________________________________
------------------------------
Date: Fri, 13 Mar 1998 16:17:54 +0000
From: Grahame S Cooper <G.S.Cooper@iti.salford.ac.uk>
Subject: Re: Redirecting to a script on another server.
Message-Id: <35095C31.5F79D964@iti.salford.ac.uk>
Grahame S Cooper wrote:<snip>
> I have tried using the Location: directive, but it
> doesn't seem to work for this purpose, and I can't see
> how I would specify whether to use PUT or GET, etc.
Of course, I mean POST or GET. (Must have accessed some
ancient memories of programming in assembler there!)
--
--------------------------------------------------
Dr Grahame S Cooper
Director
Information Technology Institute
University of Salford
Salford, M5 4WT, ENGLAND
(Remove the anti spam field to EMail me.)
==================================================
------------------------------
Date: Fri, 13 Mar 1998 16:38:48 -0000
From: "Ben" <ben@wallroyds.demon.co.uk>
Subject: Run subroutines from another CGI file?
Message-Id: <889807194.22766.0.nnrp-03.c2de5b4a@news.demon.co.uk>
Hello all :)
First of all, please accept my apologise if this message should not be in
this newsgroup. As well as my bad English as it is not my first language.
Wrote some subroutines in a CGI file in which will be used by quite a number
of Perl scripts.
I wonder if it is possible to run some Perl subroutines in a different file?
Some of the code is shown below ...
--------------------------------------------------------------------
require "/www/htdocs/interhawk/s-center/sub.cgi";
# From sub.cgi
&get_date;
(Some code)
# From sub.cgi
&get_id;
(Some code)
--------------------------------------------------------------------
Some code from the file - sub.cgi
--------------------------------------------------------------------
sub get_date
{
(the code)
}
sub get_id
{
(the code)
}
--------------------------------------------------------------------
I tried to run it via Telnet - But got some errors. The errors were ...
/www/htdocs/interhawk/s-center/sub.cgi did not return a true value at
email.cgi line 6.
Do anyone know how to do this in the right way? Or is it out of the question
to run subroutines from other files?
Tried to find some info off the web, but couldn't find the answers I wanted.
Only found info about running "scripts" not "subroutines".
Some more questions ... Why was the language named Perl?
Where to post questions about .htaccess and Perl?
Thank you for reading this.
Best Regards
Ben
------------------------------
Date: Fri, 13 Mar 1998 17:32:28 +0100
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: tainted glob confusion
Message-Id: <Pine.A41.3.95a.980313172132.86824A-100000@rsplus10.cern.ch>
On 13 Mar 1998, Greg Bacon wrote:
> From perlsec:
>
> @files = <*.c>; # Always insecure (uses csh)
> @files = glob('*.c'); # Always insecure (uses csh)
[blush] drat, how did I miss that? Thanks.
> Note to the wise: be extremely careful with filenames returned from
> readdir. Treat them as though they were tainted (else someone will
> hand you filenames like `rm -f *|').
I understand the problem! In this particular application, though,
the filenames (and the patterns being used for matching the filenames)
are entirely under the designer's control.
thanks
------------------------------
Date: Fri, 13 Mar 1998 10:10:10 -0500
From: Brian Mathis <brianm@kodak.com>
Subject: Re: Time delayed response
Message-Id: <35094C52.16E33FB8@kodak.com>
This is a multi-part message in MIME format.
--------------EF4E2C37AB0A2A9B3B958008
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
scott@softbase.com wrote:
>
> Mark Waterous (mail@silas.hypermart.net) wrote:
> > somewhere in the body, with simply:
>
> > print "<P> A paragraph for instance.</P>";
> > print "<P> Followed by another one, but...";
>
> > but I want it to delay for, say 2 seconds between outputting
> > the second print line, so it would come up in the browser 2 seconds
> > after the first.
>
> Well, you could get a slower connection to the Internet. Seriously,
> read some background info on the TCP/IP protocol. What you want
> to do is impossible.
>
> Your Perl program could write JavaScript code, don't forget. It
> is downloaded en masse and executed by the client, and has a
> delay.
>
> Scott
No, this is not impossible, nor does it have anything to do with TCP/IP
at all. What you simply need to do is make your script into an "nph"
(non-parsed header) type script. This tells the web server not to
buffer the output. Most servers use something like "nph-script.cgi" as
the name you need to use for the script, but it may vary.
After you do that, all you need to do is something like:
print 'line1 <p>';
sleep 2;
print 'line2 <p>';
That should do it. (Note: I've never actually tried this, results may
vary).
Brian Mathis
--------------EF4E2C37AB0A2A9B3B958008
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Brian Mathis
Content-Disposition: attachment; filename="vcard.vcf"
begin: vcard
fn: Brian Mathis
n: Mathis;Brian
org: US&C Intranet Services
adr: Mail Code: 01269;;343 State Street;Rochester;New York;14560-1269;6/15/KO, USA
email;internet: brianm@kodak.com
tel;work: 1(716)724-7960
tel;fax: 1(716)724-2496
x-mozilla-cpt: ;0
x-mozilla-html: FALSE
version: 2.1
end: vcard
--------------EF4E2C37AB0A2A9B3B958008--
------------------------------
Date: Fri, 13 Mar 1998 10:38:50 -0600
From: schwern@starmedia.net
To: ckc@dmi.dk
Subject: Re: Traversing directory trees.
Message-Id: <6ebnca$v75$1@nnrp1.dejanews.com>
File::Find or File::Recurse. The former comes with newer Perls, the latter
might be a smidge more applicable to your problem.
In article <wvpen09jq74.fsf@pratt.ejoper.dmi.min.dk>,
Casper Kvan Clausen <ckc@dmi.dk> wrote:
>
> Hey all.
>
> This one has given me some headaches...
>
> Given a directory tree and a starting directory, I have to return all
> sub-directory paths from the given directory.
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Fri, 13 Mar 1998 17:56:00 +0000
From: Stephan Dreyer <sd@mail.hbi.uni-hamburg.de>
Subject: Two Actions: Print in File AND Sendmail ?
Message-Id: <35097330.D8234F3D@hamburg.netsurf.de>
Hi !
I4ve got a serious problem over here:
I provide a highscore-list on one of my websites. If you manage to win
the game before, you will be redirected to a site with a form. Till now,
you only had to fill in your name and it will be transmitted into a
highscore.dat file.
Now I want some diffiult changes:
You enter your name, your email and select one from two radio-buttons
(with different values).
For the name nothing changes: It4s sent to the highscore.cgi file, to be
printed in the highscore.dat.
But the email and the value of the checked radio-Button should be sent
to me by email...
How can this be done in one step ?
The user should only hit the submit-Button, the script has to split the
input and print the name in the highscore-list, and send the name, the
email-adress and the value of the radio-button to my email-adress.
Some ideas?
Thanks for mailing me at
stephan.dreyer@hamburg.netsurf.de
------------------------------
Date: Fri, 13 Mar 1998 11:31:25 -0500
From: John Porter <jdporter@min.net>
Subject: Re: Way of testing whether a variable is blessed
Message-Id: <35095F5D.7765@min.net>
Allen Choy wrote:
>
> Is there a standard way of testing whether a variable is blessed or not?
>
> The only way I can think of is testing whether a reference has an '='
> sign.
Kludgy: the stringized form of a ref is not guaranteed to always look
as it does now.
A semi-canonical way is to test for the ability to call the 'can'
method. Since (currently) all blessed things have UNIVERSAL in
their superclass tree implicitly (not in any ISA list).
sub is_blessed {
eval { $_[0]->can('can') };
! length($@);
}
hth,
John Porter
------------------------------
Date: 13 Mar 1998 15:51:53 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: You have 1 message(s) - how to print plurals?
Message-Id: <6ebkmp$39m$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, damian@cs.monash.edu.au (Damian Conway) writes:
:>: I have a pet peeve about having a ten thousand dollar computer telling
:>: me "1 file(s) copied",
Me, too.
:I have written a module fairly sophisticated pluaralizing module for English
:nouns and verbs.
Years ago someone sent me a list of irregular English plurals they
were working up, but it's long gone. I usually content myself
with something like:
# Given an English noun in the singular, guess its plural.
# This works due to very limited input range. Not all
# corpora will be correctly handled.
sub plural {
local $_ = shift;
if (/^(.*?)( of .*)$/) { return plural($1) . $2 }
####################################
# order really matters here!
####################################
s/(ss)$/${1}es/ ||
s/([psc]h)$/${1}es/ ||
s/(z)$/${1}es/ ||
s/ff$/ffs/ ||
s/f$/ves/ ||
s/ey$/eys/ ||
s/y$/ies/ ||
s/ix$/ices/ || # often wrong
s/([sx])$/$1es/ ||
s/$/s/ ||
die "can't get here";
return $_;
}
If you try all to handle all the cases, you'll go nuts. Criterion,
phenomenon, and bacterium are bad enough, but that's not even the sliver
of the iceberg. We probably don't even want to get into datum and data
and data points and the like. And if we've ox and oxen, and child and
children, about brother and brethren? Or sister and sistern? Oh, maybe
not. :-) Fox and vixen (vichsen) aren't what they used to be either.
Why doesn't fax go to faxen, or box to boxen? We have dish and dishes,
but one fish, two fish -- unless it's seven species of fishes, not
one species. Mouse and mice, louse and lice, but house and houses,
changing the sibilitant's voicing in the last case. But goose to geese,
yet mongoose to mongooses. One Smith, two Smiths; one Jones, two Joneses.
And attorneys general or surgeons general, of course. Don't forget
bureaux, chapeaux, chbteaux, gbteaux, plateaux, portmanteaux, et tableaux,
bien sur. And several adieux or milieux, or des bons mots. Plus grafitto
from grafitti, but seldom although sometimes does soprano go to soprani.
And solo may be solos or soli, depending. Fork a prima donna and get
due prime donne. Mythos goes to to mythoi, but hoi polloi is already
plural (and has an article). Our phenonenon du jour, El Niqo, becomes
Los Niqos when repeated. Doubling your fianci or fiancie will get you
fiancis and fiancies, and a prison sentence outside of Utah. And sure,
axis gets you axes, but so does axe. Things like goyim, seraphim,
cherubim, djinni, efreeti, hydrae, medusae, and sphinges all come to mind.
I shudder to make a plural of octopus; it's octopuses, although Fowler
admits octopodes. And what about pegasus and hippopotamus? Nothing but
hippopotamuses and pegasuses will do. And then there are amoeba and
amoebae and the other protozoa. Ovum and ova, forum and fora, phylum
and phyla. Vertrabra and vertebrae. And where *does* Pharoah keep his
philtrum? We have genus to genera, but species to species. Who truly
remembers that sphinx goes to sphinges as does larynx to larynges,
or that iris goes to irides, but that when analysing more than once,
analysis generates analyses not analides? Or that status, hiatus,
prospectus, and apparatus are all invariant with respect to number?
You can't have two `stati'; you have two status (put a macron on the
`u', said like statoose), or better yet, simply two statuses as we have
with viruses. And we don't get choroi, but rather choruses from chorus.
Is antipodes already plural? Since nothing can be `more superior', why
can you have three superiors? Why don't we get `inos' back from inodes?
And with those housewives, just what *is* the plural of Hausfrau in the
dative, anyway? :-) And please, *please* don't ask me whether the Walls
or I am writing this, or that "am" will really annoy you. :-)
I very much respect your attempt, but doubt you'll be very successful
in more than a scant few of the special cases. Good luck, anyway. :-)
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
"Let me control a planet's oxygen supply, and I don't care who makes the laws."
--Great Cthuhlu's Starry Wisdom Band (via Roger Leroux)
------------------------------
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 2090
**************************************