[12277] in Perl-Users-Digest
Perl-Users Digest, Issue: 5877 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jun 3 14:07:29 1999
Date: Thu, 3 Jun 99 11:00:21 -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 Thu, 3 Jun 1999 Volume: 8 Number: 5877
Today's topics:
Re: A Problem with NULLs (brian d foy)
Re: Any Perl certification program? <rootbeer@redcat.com>
Re: Broken Pipe - nit picking <rootbeer@redcat.com>
Re: Can Perl call C functions? (Scott McMahan)
CGI script for age verification? (HUY4HUY)
CGI Scripting to a database paulm@dirigo.com
Re: Cookies, CGI.pm and IE <eivind@solbors.no>
Re: Distribute Perl <rootbeer@redcat.com>
Easy /bin/sh but Perl not <michaeldmooreNOSPAM@hotmail.com>
Re: File Reading problem... <ludlow@us.ibm.com>
re: Four-arg select on STDIN broken in Win95? (David M. Chess)
how to track users (w/out cookies) and write to them in mikecard@my-deja.com
Re: Importing functions into current namespace? <rootbeer@redcat.com>
Re: Importing functions into current namespace? (Andrew Allen)
Re: Loading modules at run time (Andrew Allen)
Re: mail problems... still :) <fruffet@kaptech.com>
miliseconds in a timestamp? amidalla@my-deja.com
Re: Multi-Inclusive Pattern Match (Andrew Allen)
Password Generator jatgal@my-deja.com
Re: PERL FREELANCERS: WANT TO MAKE A QUICK $500? (brian d foy)
Re: Perl Objects <rootbeer@redcat.com>
Re: Remove line from big flatfile? <upsetter@ziplink.net>
Re: Salvaging CPAN installs after Perl upgrade? <cassell@mail.cor.epa.gov>
Re: String extraction problem - please help? (Larry Rosler)
Re: Transferring string to other Perl program? <rootbeer@redcat.com>
Re: Trying to make custom start page for users via cook <cassell@mail.cor.epa.gov>
Re: Using isa() with scalars works only sometimes (Andrew Allen)
Re: Why dones't this oneliner work? <tchrist@mox.perl.com>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 03 Jun 1999 13:50:16 -0400
From: brian@pm.org (brian d foy)
Subject: Re: A Problem with NULLs
Message-Id: <brian-ya02408000R0306991350160001@news.panix.com>
In article <7ivs27$ubm$1@nnrp1.deja.com>, quanlay@yahoo.com posted:
> I've run into a rode block. Maybe someone can shed a little light on
> this for me.
> package testnull;
>
> sub new {
> Nothing => null
what's that 'null' bareword?
what a NULL is depends on your database server. you might look at
the DBI interface and docs to take care of all of this for you.
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>
------------------------------
Date: Thu, 3 Jun 1999 10:27:01 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Any Perl certification program?
Message-Id: <Pine.GSO.4.02A.9906031024520.22017-100000@user2.teleport.com>
On Tue, 1 Jun 1999, Zhang Yangbing wrote:
> I know Perl two years ago and try to get a Perl certification, so I
> can convince my future employer that I really know something about
> Perl, anyone knows there is some Perl certification program? thanks.
Any good stationery shop should carry blank certificates suitable for use
in laser or ink-jet printers, or even photocopiers. If you can write a
program in Perl which makes your printer output a certificate, you've
earned it. :-)
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 3 Jun 1999 10:05:01 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Broken Pipe - nit picking
Message-Id: <Pine.GSO.4.02A.9906030956350.22017-100000@user2.teleport.com>
On Wed, 2 Jun 1999, Andy Cantrell wrote:
> Most of the time FH closes with no problem. Every so often
> I'm getting the message "Broken Pipe" and $rc returns with a
> null.
I'm pretty sure that that message isn't coming from perl. It's coming from
Bash. See the Bash FAQ for some more information. (I can't get this URL to
work at the moment, but you may have better luck.)
ftp://ftp.cwru.edu/pub/bash/FAQ
Of course, you're probably not running Bash on purpose. Instead, you're
including some shell metacharacters (such as input redirection) in your
command, so Perl is running /bin/sh (aliased to Bash) to deal with them.
If you instead do the open on "-|" and exec your program directly with the
multiple-arg form of exec (after doing your own input redirection or
whatever) I think you'll find no Bash, no message, no problem. See the
docs on open if you're not familiar with "-|".
Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 3 Jun 1999 17:28:52 GMT
From: scott@aravis.softbase.com (Scott McMahan)
Subject: Re: Can Perl call C functions?
Message-Id: <3756bb54.0@news.new-era.net>
sbeaulieu@my-deja.com wrote:
> The perlxs example 4 does exactly what I want but I can't seem to get
> it to work with Windows NT which is what I need it to work in. Any
> comments?
The easiest thing to do on Windows is package your functions in
an Automation DLL, and call it using Win32::OLE.
Scott
------------------------------
Date: 3 Jun 1999 17:36:42 GMT
From: huy4huy@cs.com (HUY4HUY)
Subject: CGI script for age verification?
Message-Id: <19990603133642.24734.00000057@ng-ce1.news.cs.com>
I built up a site about age verification system, but my sign-up page does not
work.
My web address and email adress for that is:
http://www.ridinghigh.com
ktansel@hotmail.com
My site provider told me that I need a cgi script in my html coding. I found a
program provider in internet but they are selling it for $300 that I can not
afford now. I am a student and a new bee, I know almost nothing about
programming languages yet.
If someone has a spare time and help me for that I will be gratefull.
------------------------------
Date: Thu, 03 Jun 1999 13:57:31 GMT
From: paulm@dirigo.com
Subject: CGI Scripting to a database
Message-Id: <7j61k6$fvn$1@nnrp1.deja.com>
I'm currently in the process of setting up our database to be web
enabled. Does anyone know of a place where I can get an idea of how to
write CGI scripts to query a database via ODBC?
--
Paul R. Mesker
System Engineer
Dirigo Inc.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Thu, 03 Jun 1999 17:55:58 +0000
From: Eivind Trondsen <eivind@solbors.no>
Subject: Re: Cookies, CGI.pm and IE
Message-Id: <3756C1AE.76A81E49@solbors.no>
Considering, my posting wasn't quite informative, so I'll clarify.
This is the cookie-file from IE after a few pageviews;
pf
1&Eivind&2&Langsiktig%A4t%A4t%A4t%A4t%A4t%A4t%A4t%A4t
xx.xx.xx.xx/portfolio # Edited!!
0
1035654144
29346736
2740262944
29273311
*
Now where do the %A4t come from?
Here is Data::Dumper commenting on the hash before it is passed to
CGI.pm;
$VAR1 = {
1 => 'Eivind',
2 => 'Langsiktig',
};
And finally; the code that generates the cookie
<..>
$pcookie = $query->cookie(-name=>'pf',
-value=>$pf,
-path=>'/portfolio');
-]
<HTML>
<HEAD>
<META HTTP-EQUIV="Set-Cookie" CONTENT="[+ $pcookie +]">
<...>
--
Eivind Trondsen - SOL Bxrs AS http://www.solbors.no
Tlf 22 11 35 14 Fax 22 11 35 13 Mob 924 14 969
Q: What's tiny and yellow and very, very, dangerous?
A: A canary with the super-user password.
------------------------------
Date: Thu, 3 Jun 1999 10:41:20 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Distribute Perl
Message-Id: <Pine.GSO.4.02A.9906031029550.22017-100000@user2.teleport.com>
On Thu, 3 Jun 1999, Bill wrote:
> I need to distribute Perl programs to Windows machines that don't have
> Perl installed.
I'm not trying to flame you, but you probably don't realize that this has
been discussed in this newsgroup umpteen times already. You can see your
favorite Usenet archive for the details. Here's what it comes down to,
though.
1. Somebody should install perl on those Windows machines so that
they can run Perl programs.
2. No, you should compile your programs with perl2exe.
3. You ninny, that's not a compiler.
4. Besides, that takes a lot more time, trouble, and disk space.
You should just install perl on those Windows machines so that
they can run Perl programs.
5. But these are Windows people. They don't know how to install
software.
6. You should offer to install perl for a nominal fee.
7. You should offer to install Linux for a nominal fee.
8. You should sneak in at midnight to install Linux.
9. Why is it so much trouble? I just want these people to be able
to run Perl programs!
10. You should just install perl on those Windows machines so that
they can run Perl programs.
11. Buy perl2exe because compiled programs will run faster.
12. You have been seriously misinformed.
13. Well, I tried some of the things that you people suggested,
and what worked best was to have my customers install perl.
Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 2 Jun 1999 13:16:26 -0400
From: "MDM" <michaeldmooreNOSPAM@hotmail.com>
Subject: Easy /bin/sh but Perl not
Message-Id: <7j3otq$q3s$1@news.harvard.net>
Ok Im quite new to Perl and I am trying to convert this simple UNIX script
for use in Win32. Now the input for 'string' is quite easy in Perl but I do
not have a clue on how to do in Perl what 'grep' does in UNIX. To walk the
directory tree one level under /JOBS and when the file 'description' is
found grep for $string ?
I need to find some examples on how grep is used in Perl but from reading
the doc I dont think it is as easy as the UNIX grep ?
#!/bin/sh
if [ "$#" -lt 1 ] ;then
echo "Text string to search for: \c";read string
else
string=$1
fi
grep $string /JOBS/*/description
michaeldmooreNOSPAM@hotmail.com
------------------------------
Date: Thu, 03 Jun 1999 12:22:17 -0500
From: James Ludlow <ludlow@us.ibm.com>
Subject: Re: File Reading problem...
Message-Id: <3756B9C9.36413462@us.ibm.com>
Vincent Ridderikhoff wrote:
> I need to read a line from a file, from that line I need to put
> everything that is before the ; in a variable $USER and everything after
> the ; in the variable $MAIL.
The split function is what you are seeking.
perldoc -f split
> Sins I'm new at Perl, I know how to read a line from a file and how to
So then, your subject isn't as descriptive as you might have thought? :)
> chop a variable, but know I want to divide it. I know I could just say
Check out chomp. It's safer than chop for what you are likely doing.
perdoc -f chomp
> to put the whole line in the two variables and than chop the $USER at
> the ; and use a repeat statement or so to delete the first characters of
> the $MAIL, but I want to know if there is a cleaner way?
Yes, split.
--
James Ludlow (ludlow@us.ibm.com)
(Any opinions expressed are my own, not necessarily those of IBM)
------------------------------
Date: 3 Jun 1999 17:58:25 GMT
From: chess@us.ibm.com (David M. Chess)
Subject: re: Four-arg select on STDIN broken in Win95?
Message-Id: <7j6fon$pbe$1@news.btv.ibm.com>
Long, long ago, I wrote:
>I see that lots of other people have reported similar problems,
>but I haven't found any definitive answer in the group. It
>looks to me like four-argument select just isn't working right
>on STDIN.
This is apparently a known limitation. I don't know if it was
documented in the Win32 Perl port I was using at the time, but
in ActiveState Perl build 515, "perldoc perlwin32" says (among
other things):
The four-argument `select()' call is only supported on
sockets.
So there you go. I'm guessing that this is because the underlying
OS doesn't support the semantics of a four-argument select() that
includes both disk-files and sockets, and that rather than doing
some ugly hack under the covers (polling, say), they simply didn't
implement it.
Just thought I'd pass this discovery along. It's not that we're
doing anything wrong; it just doesn't work...
DC
------------------------------
Date: Thu, 03 Jun 1999 12:48:19 GMT
From: mikecard@my-deja.com
Subject: how to track users (w/out cookies) and write to them individually
Message-Id: <7j5tih$ehh$1@nnrp1.deja.com>
hi
if this is a cgi question and not perl related 1,000 apologies.
i am pretty new to perl and i want to make an online card game because i
think that it will be a good way to learn.
the actual code for the game seems fairly straight forward the problem i
am having is how to keep multiple users in the same game and contact
them individually.
suppose i have two players, player A and player B. how do i keep track
of them for instance after player A plays a card how do i tell the
program to write the result to player B's screen.
any help, even if it's just a resource that explains this in detail
would be appreciated
mike cardeiro
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Thu, 3 Jun 1999 10:50:48 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Importing functions into current namespace?
Message-Id: <Pine.GSO.4.02A.9906031048370.22017-100000@user2.teleport.com>
On Thu, 3 Jun 1999, Wayne Venables wrote:
> I'm sure I must be missing something obvious, but I'm writing
> a multi-module web application. I'm using object-oriented features
> but I also want a module which contains global functions. That is, I
> want to be able to access the functions by their name only without
> prepending the package name. Can I do it, and how?
It sounds as if you want to use the Exporter, which provides a simple,
standard way for a module to export functions. See the manpage for
Exporter for more information. But if you're writing your module without
the help of h2xs (which sets up the Exporter for you) you need to become
more Lazy. Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 3 Jun 1999 17:50:29 GMT
From: ada@fc.hp.com (Andrew Allen)
Subject: Re: Importing functions into current namespace?
Message-Id: <7j6f95$fva$4@fcnews.fc.hp.com>
Wayne Venables (wvenable_net@iname.com) wrote:
: Hello Everyone,
: I'm sure I must be missing something obvious, but I'm writing
: a multi-module web application. I'm using object-oriented features
: but I also want a module which contains global functions. That is, I
: want to be able to access the functions by their name only without
: prepending the package name. Can I do it, and how?
use the Exporter module. 'perldoc Exporter' should tell all.
Andrew
------------------------------
Date: 3 Jun 1999 17:24:50 GMT
From: ada@fc.hp.com (Andrew Allen)
Subject: Re: Loading modules at run time
Message-Id: <7j6dp2$fva$2@fcnews.fc.hp.com>
Jan van Rensburg (jan.van.rensburg@epiuse.com) wrote:
: tom,
: by "roll your own" do you mean do a:
: {require $somename;
: import $somename qw(function);
: }
Try:
eval "use $somename";
The problem is 'use/require $somename' has different semantics than
'use/require Bareword'. Read all about it in perlfunc. Or a thread
here just a little while ago.
Andrew
(suffering from repeated question syndrome. Is this a FAQ?)
------------------------------
Date: Thu, 3 Jun 1999 18:40:32 +0200
From: "Fred Ruffet" <fruffet@kaptech.com>
Subject: Re: mail problems... still :)
Message-Id: <7j6b6a$ht0$1@gatekeeper.ornano.kapt.com>
Really, I don't understand why you don't use the MIME::Lite module...
It's so simple. Imagine you want to send a mail in html format, and that all
your html code is stored in a variable called $htmltext (you may have read
this html code in a file for example). Then, to send a mail, you only do :
$msg = new MIME::Lite
From => 'you@yourserver',
To => 'him@hisserver',
Subject => 'whatitdealwith',
Encoding => 'base64',
Data => $htmltext;
$msg->attr("content-type" => "text/html"); # this line is not in the
declaration part of the object, because I didn't find the way of doing it,
even in the perldoc you hate so much :-) (Yes, I read your news...)
$msg->send;
...And it's done !
I find it more beautiful than all your "print".
MIME::Lite is available on the CPAN pages
http://www.perl.com/perl/info/cpan_modules.html
Regards,
Fred
Bastiaan S van den Berg a icrit dans le message
<7j64qc$qmm$1@zonnetje.NL.net>...
>hiya
>
>i've got this program running like a breeze now , but unfortunately , i
>can't seem to recieve mail from it..
>
>i've invested almost 3/4 hours into this program today , and i still can't
>see why it can't mail ..
>
>plz , there must be some perl-guru's still alive around this time ..
>could you take a look at it , and suggest changes , or rewrite what you
>think needs to be done ..
>
>tnx!!
>buZz
>
>btw. don't mind the string values , they're in dutch :)
>
>-=[code]=-
>
>$sendmail = "\usr\bin\sendmail"
>
>open (MAIL, "|$sendmail -oi -t") || die ("Content-Type: text/html
>\n\n<html><body>Error opening pipe to $sendmail: $!\n</body></html>\n");
>print MAIL ("To: office\@asc.nl\n",
> "Subject: [Site] Contactformulier.\n");
>print MAIL "\n\n";
>print MAIL "-=-=-=-\n";
>print MAIL "Bedrijf : $bedrijf\n" if defined $bedrijf;
>print MAIL "Contactpersoon : $contact\n" if defined $contact;
>print MAIL "Geslacht Contactpersoon : $geslacht\n" if defined $geslacht;
>print MAIL "Straat : $straat\n" if defined $straat;
>print MAIL "Postcode : $postcode\n" if defined $postcode;
>print MAIL "Plaats : $plaats\n" if defined $plaats;
>print MAIL "Email : $client_email\n" if defined $client_email;
>print MAIL "Telefoon nummer : $tel_nummer\n" if defined $tel_nummer;
>print MAIL "Fax nummer : $fax_nummer\n" if defined $fax_nummer;
>print MAIL "Ik wil gebeld worden voor een afspraak\n" if defined $belme;
>
>print MAIL "\n-=-=-=-\n";
>
>print MAIL "Verder commentaar :\n$comments\n" if defined $comments;
>print MAIL "\n\n";
>
>print MAIL "mvg. Uw website.\n";
>
>close(MAIL);
>open (EIND,"dank.htm");
>print "Content-type:text/html\n\n";
>while ($regel=<EIND>) {print "$regel\n";}
>close(EIND);
>
>-=[code ends]=-
>
>
>
>
------------------------------
Date: Thu, 03 Jun 1999 15:12:08 GMT
From: amidalla@my-deja.com
Subject: miliseconds in a timestamp?
Message-Id: <7j6600$hju$1@nnrp1.deja.com>
I'm looking for a smaller unit than the second to write to a log file
when an action is encountered. Currently I'm just using minutes and
seconds: ($sec, $min) = localtime(time) ..Thanx..
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 3 Jun 1999 17:34:10 GMT
From: ada@fc.hp.com (Andrew Allen)
Subject: Re: Multi-Inclusive Pattern Match
Message-Id: <7j6eai$fva$3@fcnews.fc.hp.com>
kgentes@gentek.net wrote:
: Perl-ers:
: thanks to this group for the many helpful sets of info
: that I find here. I recently utilized a FAQ posting
: from Tom C. to help me generate a pattern match
: sub routine that allows me to test for a list
: of patterns in a single string. The example I
: saw did an "or" of the pattern list, while I
: need to do an "and" of the patterns against
: the string.
Here's one-liner:
print $line if !grep($line!~/\b$_\b/,@popstates);
'course, it's rather inefficient, since it has to compile the regexes
every time, and doesn't short-circuit.
Andrew
------------------------------
Date: Thu, 03 Jun 1999 16:06:29 GMT
From: jatgal@my-deja.com
Subject: Password Generator
Message-Id: <7j695t$ivs$1@nnrp1.deja.com>
Does any one know, any good perl password generators, that will generate
easy to remember but secure passwords. Please let me know if you know
any scripts/modules/programs for it or the best way to do it.
Thanks
J
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Thu, 03 Jun 1999 13:46:39 -0400
From: brian@pm.org (brian d foy)
Subject: Re: PERL FREELANCERS: WANT TO MAKE A QUICK $500?
Message-Id: <brian-ya02408000R0306991346390001@news.panix.com>
In article <7j3jsd$mhb$1@nnrp1.deja.com>, salbarcar@my-deja.com posted:
> We have a calendar that we're trying to modify. It utilizes an SQL
> database. All that we need it to do is search by a DATE RANGE and RETURN
> RESULTS IN BATCHES OF 25. Right now it only searches one month at
> a time.
>
> My familiarity with Perl suggests that this is an easy job. Maybe 12?
> hours of work. Our bid is $500.
12 hours of work? it's about 12 lines of code, counting comments and
blank lines. which database server is this?
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>
------------------------------
Date: Thu, 3 Jun 1999 10:46:05 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Perl Objects
Message-Id: <Pine.GSO.4.02A.9906031042430.22017-100000@user2.teleport.com>
On Thu, 3 Jun 1999, Tommi Niemi wrote:
> I'm not very familiar with Perl Objects and I was thinking, how to
> make Perl program, where several objects are working at the same time.
> For example; I have two packages, parent and child. At first parent
> wakes child and after that they both are working independently and
> simultaneously (for emaxple writing on the screen 'This is parent',
> 'This is child').
I'm not certain, but you may be thinking about threading (or maybe
forking). These don't really have anything to do with object-oriented
programming, though. You can find information on how to implement these
via Perl in the Perl documentation - but you should probably find a good
book on advanced programming to learn what those techniques are really
doing.
Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 03 Jun 1999 17:26:22 GMT
From: Scratchie <upsetter@ziplink.net>
Subject: Re: Remove line from big flatfile?
Message-Id: <2Vy53.1771$nn.528958@news.shore.net>
Tom Christiansen <tchrist@mox.perl.com> wrote:
: :Each line a \r\n after it.
: You'd think so, but you'd be wrong.
Wow! Is ESP::RemoteFile on CPAN now? :)
--Art
--
--------------------------------------------------------------------------
National Ska & Reggae Calendar
http://www.agitators.com/calendar/
--------------------------------------------------------------------------
------------------------------
Date: Thu, 03 Jun 1999 10:04:13 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
To: Sitaram Chamarty <sitaram@diac.com>
Subject: Re: Salvaging CPAN installs after Perl upgrade?
Message-Id: <3756B58D.796B6B32@mail.cor.epa.gov>
[courtesy cc sent to poster]
Sitaram Chamarty wrote:
> [snip]
>
> Someone else suggested the "autobundle" CPAN command. Obviously
> that's way better than my method!
Thank you. I learned about it from a post in this ng by Randy
Kobes.. only a couple days ago. What a schnorrer I am!
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Thu, 3 Jun 1999 10:32:09 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: String extraction problem - please help?
Message-Id: <MPG.11c04dbcf452bd97989b62@nntp.hpl.hp.com>
In article <7j4r6s$4dc$1@nnrp1.deja.com> on Thu, 03 Jun 1999 03:01:51
GMT, npolonsk@hotmail.com <npolonsk@hotmail.com> says...
...
> ($month, $number) = ($line[0]=~ /\/usr\/home\/avert\/www\/cgi\/archive_
> (\d{2})\/(\w{3}).+/im);
...
> I'm sure that someone else would do it another way, but this is the
> most readable way that I could concieve to do it.
($month, $number) =
$line[0]=~ m%/usr/home/avert/www/cgi/archive_(\d{2})\/(\w{3}).+%i;
is a lot more readable. You have a bad case of LTS (Leaning Toothpick
Syndrome). In the tutorial that David Cassell pointed out in the
message you responded to, this is described as 'making mountains'.
I also took out the /m modifier, which affects the interpretation of ^
and $ only.
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 3 Jun 1999 10:16:21 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Transferring string to other Perl program?
Message-Id: <Pine.GSO.4.02A.9906031011280.22017-100000@user2.teleport.com>
On Wed, 2 Jun 1999, Jim wrote:
> I tried posting this through DejaNews, but I couldn't see it in from
> my Newsgroup viewer at home. Hopefully I am not re-posting.
Alas, you are reposting. If you're not certain that posting is working,
test by using one of the *.test newsgroups such as misc.test, rather than
posting again. (I'm not flaming you here - after all, you only posted
twice, not a dozen times. :-)
> I have two Perl scripts. Script1 calls Script2, which receives a
> string from the user. I then want to transfer this string back to
> Script1, to be used in other things. How do I accomplish this?
Why not write them as a single program? But, in general, to communicate
from one process to another, the perlipc manpage would probably have what
you need. But it's possible that you can get by simply by using
backquotes; see qx`` in the perlop manpage.
Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 03 Jun 1999 11:00:14 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Trying to make custom start page for users via cookie and perl. Help please?
Message-Id: <3756C2AE.D49E3E3F@mail.cor.epa.gov>
SiKnight wrote:
>
> On 30 May 1999 11:21:48 -0000, Jonathan Stowe
> <gellyfish@gellyfish.com> wrote:
>
> >On 28 May 1999 14:15:08 -0500 SiKnight wrote:
> >> [SNIP]
> >Oh thats a shame. I think that you will probably want to ask in a group
> >that is interested in such matters - comp.infosystems.www.authoring.cgi
> >
> >/J\
> So, you're telling me that this group isn't interested in matters in
> PERL? Gee, I guess the name of the newsgroup is deceiving...
Uh-oh, you've found us out. Actually, this ng is about
tormenting unsuspecting newbies. None of us know anything
about Perl. The person using the name 'Randal Schwartz'
is actually a little old lady in Kansas who knits afghans.
Now that we've got that aside, your question was not a Perl
question, whether you realized it or not. It was a CGI
question dressed in a llama's coat [metaphorically speaking].
So the place where you could get the most help for _what_
you_asked_ is in c.i.w.a.g., as /J\ said.
If you write some Perl code to do your task and have problems
getting it to work correctly, *then* it may be a question
for this ng. Or not, if the problem is still really a CGI one.
But if you're willing to follow the guidelines in the email
you got from gnat upon your first post, we'll be willing
to help.
HAND,
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: 3 Jun 1999 17:07:33 GMT
From: ada@fc.hp.com (Andrew Allen)
Subject: Re: Using isa() with scalars works only sometimes
Message-Id: <7j6col$fva$1@fcnews.fc.hp.com>
theonlycow@my-deja.com wrote:
: Is there some explanation for this? Is there something fundamentally
: flawed with my technique here?
I'd personally use "die" to report my errors, wrap the the top call to
the parser in an eval-block, check $@ there, and toss the
error-checking code sprinkled throughout the call tree.
There's a CPAN module Error.pm that might help you with this, if you
want OO exceptions.
Andrew
------------------------------
Date: 3 Jun 1999 11:01:45 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Why dones't this oneliner work?
Message-Id: <3756b4f9@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc,
S Starre <sstarre@my-deja.com> writes:
:I have two lines that I'm trying to combine into 1.
Don't do that. This is false efficiency. Just makes
everything hard to read and understand. As you've noticed.
:THIS WORKS:
: foreach (@y) {$_ && push @z,$x[$i]; $i++;}
:
:THIS DOESN'T, but I don't know why not. The logic appears OK:
: foreach (@y) {(($i++ + 1) && $_) && push @z,$x[$i];}
What aren't you doing something more straightforward like:
for ($i = 0; $i < @y; $i++) {
if ($y[$i]) {
push @z, $x[$i];
}
}
--tom
--
Intel chips aren't defective. They just seem that way.
------------------------------
Date: 12 Dec 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 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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 5877
**************************************