[18191] in Perl-Users-Digest
Perl-Users Digest, Issue: 359 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Feb 26 18:06:56 2001
Date: Mon, 26 Feb 2001 15:05:21 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <983228720-v10-i359@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 26 Feb 2001 Volume: 10 Number: 359
Today's topics:
Re: #!/usr/local/bin/perl -w || /usr/bin/perl -w <joe+usenet@sunstarsys.com>
Re: #!/usr/local/bin/perl -w || /usr/bin/perl -w <bart.lateur@skynet.be>
Any tips on creating file records from a web form? <dersgniw@fuse.net>
Re: Any tips on creating file records from a web form? <iltzu@sci.invalid>
Re: Array length (Anno Siegel)
Re: Array length <uri@sysarch.com>
Re: Check Out a web based forum of this group at : <callgirl@la.znet.com>
Re: Executing perl on Win98 (Tim Hammerquist)
Re: GUI interface for Perl program <cave@pertus.com.pl>
Re: GUI interface for Perl program <peter.sundstrom-eds@eds.com>
Re: How they learn ( previously: Please Help with 10 l <shanem@ll.mit.edu>
Re: Is an array of hashes the best way to do this? <ewald@certifichecks.com>
LWP Module????? lefkogt@codenet.net
Re: New Perl Bulletin Board available (LK)
Re: New Perl Bulletin Board available (Monte Phillips)
OT: Re: cgi-bin not excuting perl scripts. what have i (Tim Hammerquist)
Re: Perl and (public) mysql <lmoran@wtsg.com>
Re: Perl in UNIX (Abigail)
perl newbie questions: database of complex configuratio <l.goodman@kitbag.com>
perl/CGI question (teknokrat)
Re: perl/CGI question <tlav1@mediaone.net>
Re: Please Help with 10 line programm -- beginner quest <mshort@usol.com>
Re: Please Help with 10 line programm -- beginner quest <iltzu@sci.invalid>
Re: Please Help with 10 line programm -- beginner quest <callgirl@la.znet.com>
Re: Please Help with 10 line programm -- beginner quest (Randal L. Schwartz)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 26 Feb 2001 12:28:09 -0500
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: #!/usr/local/bin/perl -w || /usr/bin/perl -w
Message-Id: <m31ysl4amu.fsf@mumonkan.sunstarsys.com>
mwang@mindspring.com (Michael Wang) writes:
> if the question is changed to
>
> if /usr/local/bin/perl is there
> use it
> elif /usr/bin/perl is there
> use it
> fi
>
> And we only know at least one of /usr/local/bin/perl and /usr/bin/perl
> is there but not know which one is there.
>
> I think this has be to
>
> #!/bin/ksh
>
> and some smart construct understandable for both ksh and perl.
You could try something like this:
#!/bin/zsh -- # -*- perl -*-
eval 'PATH="/usr/local/bin:/usr/bin"; exec perl -wS $0 ${1+"$@"}'
if 0;
and adjust the shell line accordingly (I couldn't get it to work
right with ksh on my box, though).
HTH
--
Joe Schaefer "The eternal mystery of the world is its comprehensibility."
--Albert Einstein
------------------------------
Date: Mon, 26 Feb 2001 17:58:51 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: #!/usr/local/bin/perl -w || /usr/bin/perl -w
Message-Id: <kb6l9tokupt41n4jq276n2uugj91eghtpf@4ax.com>
Michael Wang wrote:
>On Solaris 8, an old version of Perl is installed in
>/usr/bin/perl, and a new version in /usr/local/bin/perl.
>
>I want to use the newer version if it is there, otherwise
>I want to use the older version. How do I convey the idea
>in #! line?
You can put a symbolic link there so that /usr/local/bin/perl always
exists.
--
Bart.
------------------------------
Date: Mon, 26 Feb 2001 13:04:32 -0500
From: "Brian" <dersgniw@fuse.net>
Subject: Any tips on creating file records from a web form?
Message-Id: <t9l6gtmih3dke9@corp.supernews.com>
I want to create a form that users can enter their input in (mostly
<textarea>s). Then my perl script will read in that data and store it in a
unix flat file. Then of course, I want my script to be able to read that
flat file and output it to a web page.
I could write this in a dirty way, but I'm wondering if there's a good way.
Let's say I've got form input fields of "information" "email" and "misc".
What is a good way to create a record that would hold this info and then
read it? I'd rather not use any modules as not many are installed on our
machine. Also, I suppose I'd have to remove all newlines so a new record
won't span multiple lines. Should I just replace all "\n" with <br>? How
can I delimit these records?
I'd really appreciate any ideas or maybe a point to a script that already
does this. I did look through the faqs and searched through google groups
and didn't really find anything about this.
Regards,
Brian
------------------------------
Date: 26 Feb 2001 20:01:14 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: Any tips on creating file records from a web form?
Message-Id: <983217282.27707@itz.pp.sci.fi>
In article <t9l6gtmih3dke9@corp.supernews.com>, Brian wrote:
>
>Let's say I've got form input fields of "information" "email" and "misc".
>
>What is a good way to create a record that would hold this info and then
>read it? I'd rather not use any modules as not many are installed on our
>machine. Also, I suppose I'd have to remove all newlines so a new record
>won't span multiple lines. Should I just replace all "\n" with <br>? How
>can I delimit these records?
Well, you do have CGI.pm, right? And I hope you're already using it.
Take a look at the query_string() method. The returned value should
be one line of ASCII text, and you can turn it back into a CGI object
by passing it to CGI->new().
Depending on your needs, the save() method can also be useful.
--
Ilmari Karonen - http://www.sci.fi/~iltzu/
"Control: cmsg newgroup sci.math.tasteless" -- Red Drag Diva in the monastery
Please ignore Godzilla and its pseudonyms - do not feed the troll.
------------------------------
Date: 26 Feb 2001 16:13:41 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Array length
Message-Id: <97dvbl$ddi$1@mamenchi.zrz.TU-Berlin.DE>
According to Victor Eijkhout <victor@eijkhout.net>:
> Beable van Polasm <beable@my-deja.com> wrote:
>
> > perldoc perldata
> >
> > It says:
> > The length of an array is a scalar value. You may find
> > the length of array @days by evaluating $#days, as in csh.
>
> I love how the documentation covers all bases.
$a{b} isn't an array. It's a scalar, which may happen to be a reference
to an array. Arrays start with @.
> Not all arrays are "@samething". If $a{b} is an array, how do I get the
> length? The docs were absolutely no help. After a lot of experimenting I
> found $#{$a{b}}. Is that the best way? I never found anything looking
> like this in the docs. Then, perl is not a full-time occupation of mine.
> Hour a week at most. So it could be in the docs but I haven't found it
> yet.
>
> So what's a rule for getting array length that works for anything that
> is an array?
If <something> is an array ref, use scalar @{<something>} or
$#{<something>}, whichever is more convenient. Sometimes you can
leave off the extra {}, sometimes you can't. It depends on precedence
of operators used in <something>.
Anno
------------------------------
Date: Mon, 26 Feb 2001 16:16:55 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Array length
Message-Id: <x7bsrph11k.fsf@home.sysarch.com>
>>>>> "VE" == Victor Eijkhout <victor@eijkhout.net> writes:
VE> Beable van Polasm <beable@my-deja.com> wrote:
>> perldoc perldata
>>
>> It says:
>> The length of an array is a scalar value. You may find
>> the length of array @days by evaluating $#days, as in csh.
VE> I love how the documentation covers all bases.
VE> Not all arrays are "@samething". If $a{b} is an array, how do I get the
VE> length? The docs were absolutely no help. After a lot of experimenting I
VE> found $#{$a{b}}. Is that the best way? I never found anything looking
VE> like this in the docs. Then, perl is not a full-time occupation of mine.
VE> Hour a week at most. So it could be in the docs but I haven't found it
VE> yet.
if $a{b} is an array REF (it can't be an array), then you should read
perlref for how to handle refs. the rule is VERY simple. you look at @a
and then replace a with {REF EXPRRESION} and voila, you have some array
thing working on a ref.
VE> So what's a rule for getting array length that works for anything that
VE> is an array?
just apply that rule. it's easy and it works.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: Mon, 26 Feb 2001 14:19:09 -0800
From: Kiralynne Schilitubi <callgirl@la.znet.com>
Subject: Re: Check Out a web based forum of this group at :
Message-Id: <3A9AD65D.CAF915BA@la.znet.com>
TeKno wrote:
> http://www.supportinfo.com
> look in the forums, enjoy the rest of the pages too!
I have made a note of your quickly removing
your suspicious opening redirect page for
this site.
I have also noted this, along with
other noteworthy discoveries,
RCPT To:<TeKno@supportinfo.com>
550 5.1.1 <TeKno@supportinfo.com>
User unknown
Godzilla!
------------------------------
Date: Mon, 26 Feb 2001 20:46:08 GMT
From: tim@vegeta.ath.cx (Tim Hammerquist)
Subject: Re: Executing perl on Win98
Message-Id: <slrn99lgid.5u9.tim@vegeta.ath.cx>
obscuremu@riftsmux.dhs.org <obscuremu@riftsmux.dhs.org> wrote:
> "Brian McCann" <bmccann@naisp.net> wrote:
>
> >I usually run perl scripts on Sun or Win NT and to execute a script
> >all you have to do at the prompt is type filename.pl and the script executes
> >but on Win98 to get the script to execute you have to type
> >
> >perl filename.pl
> >
> > is there a way to run the script without calling the interpreter
> >before the filename?
> Short answer. Nope, there isn't.
> Better answer:
> As long as the extention of pl is linked to the perl interpeter you can always
> point and click using the mouse. :)
You can also take a look at bash shells for win32. While on Win98, I
used cygwin, which allowed me to take advantage of the '#!' line I
placed at the top of all my scripts anyway, as well as adding advanced
command line editing... =)
--
-Tim Hammerquist <timmy@cpan.org>
My life has a superb cast but I can't figure out the plot.
-- Ashleigh Brilliant
------------------------------
Date: Mon, 26 Feb 2001 17:09:16 +0100
From: Mirek Rewak <cave@pertus.com.pl>
Subject: Re: GUI interface for Perl program
Message-Id: <5rvk9tcigad2q0pintl5jtrh8t5okm6dq3@4ax.com>
On Mon, 26 Feb 2001 20:23:16 +1100, "Ron Savage" <ron@savage.net.au>
wrote:
>Consider CGI.
I know, but it will be a local application.
Pozdrowienia
Mirek Rewak
cave@pertus.com.pl
------------------------------
Date: Tue, 27 Feb 2001 10:57:11 +1300
From: "Peter Sundstrom" <peter.sundstrom-eds@eds.com>
Subject: Re: GUI interface for Perl program
Message-Id: <97ejfo$615$1@hermes.nz.eds.com>
"Mirek Rewak" <cave@pertus.com.pl> wrote in message
news:5rvk9tcigad2q0pintl5jtrh8t5okm6dq3@4ax.com...
On Mon, 26 Feb 2001 20:23:16 +1100, "Ron Savage" <ron@savage.net.au>
wrote:
>Consider CGI.
I know, but it will be a local application.
So why does that disclude it?
------------------------------
Date: Mon, 26 Feb 2001 17:09:08 -0500
From: Shane McDaniel <shanem@ll.mit.edu>
Subject: Re: How they learn ( previously: Please Help with 10 line programm -- beginner questions Thanks Guys)
Message-Id: <3A9AD404.AEFA51BE@ll.mit.edu>
I'm just curious but how did you go about learning perl? ie what
resources and books did you use. I'm just curious how the "newbies" go
about learning and whether it is flawed or not and how it might impact
performance. Nothing personal but the && mistake was fairly obvious if
you had read something about while loops.
mshort wrote:
>
> Perl People,
>
> Thanks I got it to work.
>
> The AND and && both work in the program. The comma doesn't work, it does
> exactly what Randall said, it drops the left argument.
>
> John,
>
> What do you mean "using strict"?
>
> Thanks again guys, next lesson is foreach loops and arrays.
>
> Sincerely,
>
> Matt Short
> John Joseph Trammell <trammell@bayazid.hypersloth.net> wrote in message
> news:slrn99l4rf.r0q.trammell@bayazid.hypersloth.net...
> > On Mon, 26 Feb 2001 13:04:00 -0800, mshort <mshort@usol.com> wrote:
> > > while ($ans ne 'yes', $ans ne 'no'){
> >
> > What test are you trying to perform here? Maybe you should
> > do some experimenting with this.
> >
> > And you're "using strict", right?
> >
------------------------------
Date: Mon, 26 Feb 2001 14:46:44 -0500
From: Ed Waldspurger <ewald@certifichecks.com>
Subject: Re: Is an array of hashes the best way to do this?
Message-Id: <MPG.15047cb3f728380b98968c@news.mtcibs.com>
In article <u9y9uwpfts.fsf@wcl-l.bham.ac.uk>, nobull@mail.com says...
> Ed Waldspurger <ewald@certifichecks.com> writes:
>
> > return @cartitems;
>
> Consider returning a reference here for the sake of efficiency.
This was my original idea, but I was having trouble getting the syntax
right to iterate over each item in a ref to an array of hashes.
> my $cartitems = readcart($cartid); # Returns ARRAY-ref
>
> for my $item (@$cartitems) {
> if ( do {
> no warnings qw( uninitialized );
> $item->{SKU} eq "some_product" && $item->{QTY} > 1;
> } ) {
> # Do something here
> }
> }
Yes, this is more like what I want to do. After looking at your
example, it makes sense that "for my $item (@$cartitems)" returns
a ref to the hash within each array element. I was treating it like it
was still a ref to an array of hashes and was trying to access the items
within the for loop like $item->[0]{'SKU'}.
Thank You for the help.
-Ed Waldspurger
------------------------------
Date: 26 Feb 2001 10:19:23 -0800
From: lefkogt@codenet.net
Subject: LWP Module?????
Message-Id: <97e6nb01sne@drn.newsguy.com>
Is there GOOD documentation (with examples) for the Perl LWP module? There is a
book which is no longer in print -- there must be something online for LWP???
If not, what else can be used in similar fashion, for example, get a webpage and
store it in a Perl variable so you can use REGEX to find information within that
webpage?
Gary
------------------------------
Date: Mon, 26 Feb 2001 16:18:27 GMT
From: lkenny@fisheries.org (LK)
Subject: Re: New Perl Bulletin Board available
Message-Id: <3a9a81b0.13155484@wingate>
On Sat, 18 Aug 2001 00:56:19 -0400, necro <necrorising@hotmail.com>
wrote:
>New Perl Bulletin Board available
>
>The MotherBoard is now available! Get the freedom and versatility of a
>high end bulletin board, at cut rate prices.
>
>http://www.worldwidecreations.com
Your posting method is incredible. Somehow you posted 6 months int he
future.
What is life like in the future? Have we solved world hunger yet?
------------------------------
Date: Mon, 26 Feb 2001 16:44:45 GMT
From: montep@hal-pc.org (Monte Phillips)
Subject: Re: New Perl Bulletin Board available
Message-Id: <3a9a87dc.19613482@news.hal-pc.org>
On Mon, 26 Feb 2001 16:18:27 GMT, lkenny@fisheries.org (LK) wrote:
>On Sat, 18 Aug 2001 00:56:19 -0400, necro <necrorising@hotmail.com>
>wrote:
>
>>New Perl Bulletin Board available
>>
>>The MotherBoard is now available! Get the freedom and versatility of a
>>high end bulletin board, at cut rate prices.
>>
>>http://www.worldwidecreations.com
>
>Your posting method is incredible. Somehow you posted 6 months int he
>future.
>
>What is life like in the future? Have we solved world hunger yet?
LOL! Future 'Vaporware', surely!
------------------------------
Date: Mon, 26 Feb 2001 20:43:15 GMT
From: tim@vegeta.ath.cx (Tim Hammerquist)
Subject: OT: Re: cgi-bin not excuting perl scripts. what have i done?
Message-Id: <slrn99lgd0.5u9.tim@vegeta.ath.cx>
Chile <abcd@ntlworld.com> wrote:
> for some reason when i just type in the url like below
>
> http://192.168.1.101/cgi-bin/
>
> i normally get a IE permission denied error but instead now i get file not
> found?
It sounds like you should get more familiar with Apache configurations
(which fails to come under a Perl newsgroup's domain, but I'll see what
I can do...) =)
Is your DocumentRoot still set to httpd/ ? If so, Apache may be
confused as to what you're trying to do. A cgi-bin/ directory,
correctly configured, will probably not display the content of the
script, whereas normal html directories do. Since your cgi-bin
directory is a subdirectory of your DocumentRoot, it inherits
DocumentRoot's permissions and will display the file.
> "Chile" <abcd@ntlworld.com> wrote in message
> news:PC6m6.24588$5n4.493852@news6-win.server.ntlworld.com...
> > Hi,
> >
> > i have a linux box with apache on it and it was working fine last night,
> > running perl scripts from the cgi-bin no prob's but now when i try and
> > access a scipt i get
> >
> > Not Found
> > The requested URL /cgi-bin/counter.pl was not found on this server.
> >
> >
> > i know the file is there as i can see it in the cgi-bin and can run it
> perl
> > counter.pl, witout problems.
> >
> > whats interesting is if i misspell counter.pl and try and run it i get the
> > IE file not found page so i don't know what this page error is coming from
> > or why.
If you get the IE error page, then Apache simple returned an HTTP error
code and IE returns its own explanation for why. If you get any other
page, in your case it's probably from Apache, telling you that something
isn't set up correctly.
> > Just to check, i went into the apache settings and changed the default
> page
> > from httpd/html to just httpd then i browsed to the cgi-bin and clicked on
> > the counter.pl but instead of executing it it just printed the file on the
> > screen like a txt file??
> >
> > i have changed it back now though.
Oh, you have changed it back, eh? Well, posting relevant sections of
your conf file (such as DocumentRoot, ScriptAlias, Alias, Addhandler,
Location, or Directory sections) and possibly some basic picture of
your entire directory structure would help me get a much better idea of
what's going on. Or you might even just see what you can learn about
your server itself.
This is very off-topic, and shouldn't continue on clpm, but you may
email me directly if you like.
HTH
--
-Tim Hammerquist <timmy@cpan.org>
Nearly all men can stand adversity, but if you
want to test a man's character, give him power.
-- Abraham Lincoln
------------------------------
Date: Mon, 26 Feb 2001 16:07:42 -0500
From: Lou Moran <lmoran@wtsg.com>
Subject: Re: Perl and (public) mysql
Message-Id: <p9hl9t8qo31bg8dlob6euod8pej92mq6pq@4ax.com>
On Mon, 26 Feb 2001 10:49:19 GMT, rgarciasuarez@free.fr (Rafael
Garcia-Suarez) wrote wonderful things about sparkplugs:
>Gregory Toomey wrote in comp.lang.perl.misc:
>> My ISP has Perl but not mysql.
>>
>> Is there a public mysql server on the net that I could connect to,
>> to try out mysql?
>
Another option would be to download the product from AbriaSoft which
will give you an Apache Server, Perl, PerlDBI, PHP and MySQL so you
can check it it out in all of its glory right on your computer.
www.abriasoft.com
there's a free one.
>If you want to try out MySQL, the best is probably to download and
>install it (from http://www.mysql.com/). If you want to build a site
>with a MySQL backend, you'll have to look for an hosting service that
>provides this feature, along with Perl/CGI.
--
"> thanks in advance !!!
If you are going to do anything 'in advance' it should be RTFM."
--swiped from a nobull clp.misc post
Lou Moran <lmoran@wtsg.com>
------------------------------
Date: 26 Feb 2001 22:11:10 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Perl in UNIX
Message-Id: <slrn99ll3u.65u.abigail@tsathoggua.rlyeh.net>
Steven Smolinski (sjs@linux.ca) wrote on MMDCCXXXIV September MCMXCIII in
<URL:news:slrn99ecqs.k0.sjs@ragnar.stevens.gulch>:
?? I was annoyed! How could Gwyn Judd <tjla@guvfybir.qlaqaf.bet>
?? never change his attribution string:
?? > I was shocked! How could Ilmari Karonen <iltzu@sci.invalid>
?? > say such a terrible thing:
?? >
?? > >What you could do, however, is to include the Perl code as a string
?? > >*in* the C program, and hand it to perl as a long -e option. Then
?? > >chmod the program to 711.
?? >
?? > But then you can read the string in 'top'. How about passing it to perl
?? > via a pipe?
??
?? Either way, what would you do about strings(1)?
If you can strings to get something useful out of a file with mode 711,
you already have enough permissions on the file that you don't need
strings.
If you don't have those permissions, strings won't do anything magical.
Or did you install strings suid root?
Abigail
------------------------------
Date: Mon, 26 Feb 2001 21:36:50 -0000
From: "Lloyd Goodman" <l.goodman@kitbag.com>
Subject: perl newbie questions: database of complex configuration files
Message-Id: <3a9ace29$1@news2lo.highwayone.net>
I'm currently writing a script to download a copy of both the running and
saved configuration on foundry networks switches and then compare the two to
see if they are the same and then compare them with a central database of
what these configurations should be. I then want to record this info back
to the database - it's essenttially going to be used as a tool to backup the
configurations and to prevent situations where two administartors are
unwittingly working on the same switch over a period of time and altering
each others changes.
Can any one suggest an approach to storing all this info in such a way that
it can be easily compared? I have a reasonable understanding of the unix
diff command and RCS and so on but can't help feeling there's probably an
easy (-ish) way to do this with perl that I have no experience of (for
instance could perl/XML be used, would it make any sense?). Below is a
simple example of a foundry configuration file. Unfortunately I don't know
whether the order of the entries in the file will always be the same which
is alsoone of my main concerns.
Thanks in advance for any advice.
Lloyd Goodman
Current configuration:
!
ver 07.0.12T12
!
!
server port 80
tcp
!
url-map p1
!
!
server real plum 24.52.19.76
port http
port http url "HEAD /"
!
server real honey 24.52.19.68
port http
port http url "HEAD /"
!
!
server virtual viptest1 24.52.19.67
port http concurrent
bind http honey http plum http
!
!
!
!
hostname peaches
ip address 24.52.19.66 255.255.255.240
interface e 1
!
interface e 2
!
interface e 3
!
interface e 4
!
interface e 5
!
interface e 6
!
interface e 7
!
interface e 8
!
interface e 9
!
interface e 10
!
!
end
telnet@peaches>
------------------------------
Date: Mon, 26 Feb 2001 17:12:39 GMT
From: teknokrat@mindless.com (teknokrat)
Subject: perl/CGI question
Message-Id: <3a9a8db2.13624515@news.clara.net>
I would like to execute a new perl script at the end of a CGI script
using exec("perl script.pl\n"). Unfortunatelt this give me an internal
server error - does anyone know how this can be done?
The reason i want to do this is so that the web user doesn't have to
wait ages for the second script to complete.
thanks
------------------------------
Date: Mon, 26 Feb 2001 22:52:20 GMT
From: ted <tlav1@mediaone.net>
Subject: Re: perl/CGI question
Message-Id: <3A9B08EB.824F8F3F@mediaone.net>
An Internal Server error seems to imply that there is something wrong in
second script you're trying to exec. I don't know how much help I can be
with the few details you've provided, but you can try something like
this...
$myscript = "/path/to/your/script.pl";
system("$myscript") or die "cannot system call $myscript\n\$!\n";
...or you can try the backtick operator...
`./myscript.pl` or die "cannot run myscript.pl\n\$!\n";
These are just guesses. Hope one works for you.
ted
teknokrat wrote:
> I would like to execute a new perl script at the end of a CGI script
> using exec("perl script.pl\n"). Unfortunatelt this give me an internal
> server error - does anyone know how this can be done?
>
> The reason i want to do this is so that the web user doesn't have to
> wait ages for the second script to complete.
>
> thanks
------------------------------
Date: Mon, 26 Feb 2001 16:19:11 -0800
From: "mshort" <mshort@usol.com>
Subject: Re: Please Help with 10 line programm -- beginner questions Thanks Guys
Message-Id: <t9lhq9iga2fdb9@corp.supernews.com>
Perl People,
Thanks I got it to work.
The AND and && both work in the program. The comma doesn't work, it does
exactly what Randall said, it drops the left argument.
John,
What do you mean "using strict"?
Thanks again guys, next lesson is foreach loops and arrays.
Sincerely,
Matt Short
John Joseph Trammell <trammell@bayazid.hypersloth.net> wrote in message
news:slrn99l4rf.r0q.trammell@bayazid.hypersloth.net...
> On Mon, 26 Feb 2001 13:04:00 -0800, mshort <mshort@usol.com> wrote:
> > while ($ans ne 'yes', $ans ne 'no'){
>
> What test are you trying to perform here? Maybe you should
> do some experimenting with this.
>
> And you're "using strict", right?
>
------------------------------
Date: 26 Feb 2001 21:43:50 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: Please Help with 10 line programm -- beginner questions Thanks Guys
Message-Id: <983223650.5724@itz.pp.sci.fi>
In article <t9lhq9iga2fdb9@corp.supernews.com>, mshort wrote:
>
>What do you mean "using strict"?
Start your scripts like this:
#!/usr/bin/perl -w
use strict;
For more information, type the following shell commands:
perldoc perldoc
perldoc strict
perldoc perl
--
Ilmari Karonen - http://www.sci.fi/~iltzu/
"I did, however, blame it on an 'Intermittant connection in the power cable',
which was true, after a fashion." -- Dave Hinz in the monastery
Please ignore Godzilla and its pseudonyms - do not feed the troll.
------------------------------
Date: Mon, 26 Feb 2001 14:09:11 -0800
From: Kiralynne Schilitubi <callgirl@la.znet.com>
Subject: Re: Please Help with 10 line programm -- beginner questions Thanks Guys
Message-Id: <3A9AD407.C7FC390F@la.znet.com>
mshort wrote:
(snippage)
> What do you mean "using strict"?
A realistic definition for strict
would be,
"Bloat my program's memory usage,
cause my program to run slower,
make my program as difficult as
possible to write along with
causing it to crash often."
The author of the strict module indicates,
paraphrased, a careful choice should be
made before using strict. Use of strict
is not appropriate for many programs.
Strict will restrict your ability to
write both effective and imaginative
programs. You would be wise to research
strict carefully and think twice before
making use of it.
However, use of strict is a great
learning tool for beginners and
a good tool for those lacking
programming skills, regardless of
their self-perceived skill level.
Strict is analogous to training
wheels on a bicycle.
Godzilla!
------------------------------
Date: 26 Feb 2001 14:53:42 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Please Help with 10 line programm -- beginner questions Thanks Guys
Message-Id: <m166hxaweh.fsf@halfdome.holdit.com>
>>>>> "Kiralynne" == Kiralynne Schilitubi <callgirl@la.znet.com> writes:
>> What do you mean "using strict"?
Kiralynne> A realistic definition for strict
Kiralynne> would be,
Kiralynne> "Bloat my program's memory usage,
Kiralynne> cause my program to run slower,
Kiralynne> make my program as difficult as
Kiralynne> possible to write along with
Kiralynne> causing it to crash often."
With all the stuff you've learned over the past year, Kira, I'm amazed
at how you still act like a luddite about some of Perl's core
features.
Kiralynne> The author of the strict module indicates, paraphrased, a
Kiralynne> careful choice should be made before using strict. Use of
Kiralynne> strict is not appropriate for many programs.
Are you misreading this statement (from perldoc strict):
If no import list is supplied, all possible restrictions
are assumed. (This is the safest mode to operate in, but
is sometimes too strict for casual programming.)
Currently, there are three possible things to be strict
about: "subs", "vars", and "refs".
Perhaps you're confusing "casual programming" with "many programs".
Most of the programs I write are not in the "casual programming"
category, and in fact Stonehenge's official position on "strict" is
"anything that exceeds 10 lines or 10 minutes of use or we get paid
more than $10 for must use strict". That's at least 90% of what I
write.
Kiralynne> Strict is analogous to training wheels on a bicycle.
No, more like rear view mirrors. There are very few things that a
high-performance program will want to do that "use strict" prevents,
and even so, it can be disabled for any chunk of code in a controlled
fashion.
Kira, you are clearly learning. Your posts keep including more and
more interesting Perl knowledge. But please give up your hold on
"anything modern is bloated". That's a long-dead battle.
print "Just another Perl hacker,";
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 359
**************************************