[18517] in Perl-Users-Digest
Perl-Users Digest, Issue: 685 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Apr 12 11:05:48 2001
Date: Thu, 12 Apr 2001 08:05:12 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <987087912-v10-i685@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 12 Apr 2001 Volume: 10 Number: 685
Today's topics:
Re: A CGI question (Randal L. Schwartz)
Re: A CGI question <flavell@mail.cern.ch>
Re: A CGI question (Si Ballenger)
Re: A_Geekette is a stupid wench (Tom Briles)
ANNOUNCE: NEXT 0.01 (Damian Conway)
Re: changing @INC permenently <mjcarman@home.com>
communication between blocked parent and children after (Alexander Fuchs)
Re: complaint about moderation of this group (---Pete---)
Re: How can a SMTP mail be deleted from a Unix mailbox (Cameron Laird)
Re: post to my yahoo/hotmail accounts via automatic sci (cRYOFAN)
Re: post to my yahoo/hotmail accounts via automatic sci (cRYOFAN)
Re: post to my yahoo/hotmail accounts via automatic sci <pne-news-20010412@newton.digitalspace.net>
Problems sending gif image from cgi script using LWP?? <shmooth@MailAndNews.com>
Re: Problems sending gif image from cgi script using LW (Eric Bohlman)
think I found what I was looking for... <cadet@alum.mit.edu>
Ulimit in Perl <scf@ltop.newk.net>
Re: Unix Script in a Perl script to the Web.vvp (Damian James)
Re: use strict and sysopen <bart.lateur@skynet.be>
Re: Why perl and not Bourne/Korn scripts? <bowman@montana.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 12 Apr 2001 07:31:08 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: A CGI question
Message-Id: <m1lmp6rxzn.fsf@halfdome.holdit.com>
>>>>> "Alan" == Alan J Flavell <flavell@mail.cern.ch> writes:
Alan> CGI has its own specific group, comp.infosystems.www.authoring.misc,
That's comp.infosystems.www.authoring.cgi, more affectionally known as
"CIWAC", which I pronounce "sigh whack", because that's how I feel
sometimes when I read that group. :)
--
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: Thu, 12 Apr 2001 16:38:24 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: A CGI question
Message-Id: <Pine.LNX.4.30.0104121637350.408-100000@lxplus003.cern.ch>
On 12 Apr 2001, Randal L. Schwartz wrote:
> >>>>> "Alan" == Alan J Flavell <flavell@mail.cern.ch> writes:
>
> Alan> CGI has its own specific group, comp.infosystems.www.authoring.misc,
>
> That's comp.infosystems.www.authoring.cgi,
Yes, of course it is. My apologies for the brain-check, and thanks
for picking me up on it!
------------------------------
Date: Thu, 12 Apr 2001 15:02:00 GMT
From: shb@vnet.net (Si Ballenger)
Subject: Re: A CGI question
Message-Id: <3ad5c20e.504241799@166.82.1.9>
On Thu, 12 Apr 2001 12:12:49 +0200, "Alan J. Flavell"
<flavell@mail.cern.ch> wrote:
>On Thu, 12 Apr 2001, Karl Young wrote:
>
>> What does the misc stand for anyway?
>
>'misc' means the same as it does on any mainstream usenet group: it is
>for questions which _do not_ have a more specific group to go to.
>
>> Is CGI not covered under misc?
>
>CGI has its own specific group, comp.infosystems.www.authoring.misc,
>so is it automatically off-topic on a *.misc group. It would be
>on-topic _if_ it was primarily about a Perl language question, and
>only incidentally related to the CGI.
>
>> I would be interested to know what the
>> consensus is in this group
>
>Really? I find that very hard to understand. You don't seem to have
>started finding out by reading this group, otherwise you would already
>know from the postings in the last couple of days what the regulars
>think about CGI postings here. And you would know what "jeopardy
>quoting" is and why it is wise for you to avoid it.
>
As an alternative, the really upset readers can save on their
Prozac bills by *just not reading* an article titled "A CGI
question", or if they they have absolutely no control over
themselves, they can put "CGI" in their kill file. I know it is a
struggle for some, but it can be done. ;-)
------------------------------
Date: Thu, 12 Apr 2001 14:35:00 GMT
From: sariq@texas.net (Tom Briles)
Subject: Re: A_Geekette is a stupid wench
Message-Id: <3ad5ba5e.254075441@news.texas.net>
On Thu, 12 Apr 2001 01:46:06 -0700, Elizabeth <moiraine:-P@qwest.net>
wrote:
>I apologize for fscking up so much and typing before thinking. I'll
>just lurk and learn the ropes. Thank you to those who have been patient
>with me.
>
>Elizabeth Crawford Johnson
>A stupid wench.
You aren't stupid, you were just ignorant. Take this new-found
knowledge with you when you next start following a newsgroup.
You might find it useful to mentally respond to posts here, then see
how close your *unposted* answers are to the answers the regulars
post. When your answers are equally useful (or even superior!),
that's when it's time to start posting responses. You'll know when
the time has come, Grasshopper. I learned more Perl lurking here for
a few months in early 1997 than in all of the books I've read and
classes I've taken combined.
BTW, it wasn't your ignorance that caused a number of the regulars to
killfile you (if it had been, we'd all have dozens of new killfile
entries each day), so much as your insolence. And that seems to have
cleared up a bit as well.
Happy Perling! :)
- Tom
P.S. I thought for awhile that you previously were a large, scaled,
green creature with horrendously bad halitosis. I'm happy to see that
my assumption was incorrect.
------------------------------
Date: 12 Apr 2001 07:16:13 GMT
From: damian@cs.monash.edu.au (Damian Conway)
Subject: ANNOUNCE: NEXT 0.01
Message-Id: <tdbdbu8f7pjq27@corp.supernews.com>
Keywords: perl, module, release
==============================================================================
Release of version 0.01 of NEXT
==============================================================================
NAME
NEXT - Pseudo class for method redispatch
DESCRIPTION
NEXT.pm adds a pseudoclass named C<NEXT> to any program that
uses it. If a method C<m> calls C<$self->NEXT::m()>, the call to
C<m> is redispatched as if the calling method had not originally
been found.
In other words, a call to C<$self->NEXT::m()> resumes the
depth-first, left-to-right search of parent classes that
resulted in the original call to C<m>.
Note that this is not the same thing as C<$self->SUPER::m()>, which
begins a new dispatch that is restricted to searching the ancestors
of the current class. C<$self->NEXT::m()> can backtrack past
the current class -- to look for a suitable method in other
ancestors of C<$self> -- whereas C<$self->SUPER::m()> cannot.
An particularly interesting use of redispatch is in
C<AUTOLOAD>'ed methods. If such a method determines that it is
not able to handle a particular call, it may choose to
redispatch that call, in the hope that some other C<AUTOLOAD>
(above it, or to its left) might do better.
Note that it is a fatal error for any method (including C<AUTOLOAD>)
to attempt to redispatch any method except itself. For example:
sub D::oops { $_[0]->NEXT::other_method() } # BANG!
AUTHOR
Damian Conway (damian@conway.org)
COPYRIGHT
Copyright (c) 2000, Damian Conway. All Rights Reserved.
This module is free software. It may be used, redistributed
and/or modified under the terms of the Perl Artistic License
(see http://www.perl.com/perl/misc/Artistic.html)
==============================================================================
CHANGES IN VERSION 0.01
==============================================================================
AVAILABILITY
NEXT has been uploaded to the CPAN
and is also available from:
http://www.csse.monash.edu.au/~damian/CPAN/NEXT.tar.gz
==============================================================================
------------------------------
Date: Thu, 12 Apr 2001 08:20:16 -0500
From: Michael Carman <mjcarman@home.com>
Subject: Re: changing @INC permenently
Message-Id: <3AD5AB90.7084EA2E@home.com>
Kim C wrote:
>
> Setting the PERL5LIB environment setting did the trick, and your
> suggestion of 'use lib /.../' will also be helpful for one-offs as it
> is far slimmer than the BEGIN { push @INC ... } I've been using. ;-)
This should be obvious, but you'll have to add the path to PERL5LIB on
*each* machine that will be using the library. If that ends up being a
lot of machines (i.e. everyone on your network) it may be simpler to put
a 'use lib' in the scripts that need it. Other options may exist if you
are running Perl from a network.
-mjc
------------------------------
Date: 12 Apr 2001 13:53:36 GMT
From: alexf@hal9000.uni-koblenz.de (Alexander Fuchs)
Subject: communication between blocked parent and children after fork
Message-Id: <slrn9dbcr0.hmj.alexf@hal9000.uni-koblenz.de>
Hello,
I have a tcp server using IO::Socket::INET->new, i.e. listening
on a tcp port. For each incoming connection a new process is
immediatly forked, which should handle this connection.
The parent process blocks and listens:
while ($client = $server->accept ()) {
..
elsif ($fork) {
close ($client);
}
...
}
Because of performance reasons the parent process doesn't read
anything of the incoming request.
Now the problem occured, that some of the incoming requests should
change the parent process status, e.g. it should reread its
configuration file. As the parent doesn't know the request, the
forked child has to tell him. But the parent is already
blocked waiting for new requests.
So, how should the child inform its parent?
I tried to break the parents normal sequential behaviour, i.e.
awake him from his blocking with a signal, but as I had to learn,
that I am not allowed to do much in a signal handler.
Is there a solution to my problem keeping the program structure?
Or is there a different approach which solves the problem?
--
Thanks,
Alexander Fuchs
------------------------------
Date: Thu, 12 Apr 2001 13:46:05 GMT
From: bogus@erol.com (---Pete---)
Subject: Re: complaint about moderation of this group
Message-Id: <3ad5b137.30380864@news.earthlink.net>
On Thu, 12 Apr 2001 08:57:06 +1000, mgjv@tradingpost.com.au (Martien
Verbruggen) wrote:
>No one here is paid to be here. No one here can afford to spend all
>their time educating people about the world of Usenet, programming in
>general and Perl. So we concentrate on Perl, and expect people to _know_
>about the other ones. If that scares off some people, that's too bad. It
>is the only practical way that a newsgroup with the amount of traffic
>that this one receives can be managed.
-------
Martien, I actually enjoyed reading your entire reply as it helps
to understand the history of the group and actions of the regulars.
What still troubles me is the fact that due to all the reasons we
discussed, newbies will continue to innocently post Perl/cgi
questions only to be faced with intolerance and nasty
encounters with no effort to really educate. Short term, you
might be correct that the quality of technical posts will remain
high but in the long term those people that treat others injustly
and rudely will make many enemies along the way and as the
numbers of folks offended grow the tables could eventually
turn. I scanned the GCI posts yesterday and it already seems
to be going in that direction. It's probably gonna get much
worse in here if the current strategy is not altered. In life,
times always change, the climate changes and we need to
adjust to these things in order to survive.
In closing, I respect your opinions and expertise but I largely
disagree that you need to be rude and uwilling to help
or educate people who make innocent mistakes in posting
cgi topics. Only time will tell who's correct but I'll continue to
treat people as I would like to be treated myself.
It's been interesting talking but we'll just have to agree
to disagree on this one <grin>.
PS: If you see me making attempts to educate and redirect
don't hesitate to correct me on the technical level if I am
off-base.
See you around the NG.
---pete---
------------------------------
Date: 12 Apr 2001 09:43:19 -0500
From: claird@starbase.neosoft.com (Cameron Laird)
Subject: Re: How can a SMTP mail be deleted from a Unix mailbox by a script?
Message-Id: <03DDB6EC2F87C4BD.58D892FB6AEB12DC.33E0493731A68E58@lp.airnews.net>
In article <9b3md1$2hr$1@charity.cs.utexas.edu>,
Logan Shaw <logan@cs.utexas.edu> wrote:
.
.
.
>If you used the .forward file to specify that the message goes to a
>program, it should go to the program and not to a mailbox. That is,
>unless you specified that the message should go to both, but I don't
>know why you'd send it to two places and do nothing but immediately
>delete it from one.
I suspect that Mr. Elfring is dealing with
something he didn't originally write. Yes,
I think it's likely that the easiest answer
is to look in the ~/.forward, and have it
stop doing what is not wanted.
Also, Mr. Elfring's English is not entirely
idiomatic, and we're probably confusing each
other a bit along the way.
>
>>- How can the mail deleted with the use of the Unix commands "mail" or
>>"mailx" in the preferred programming languages "bash", "Perl", "PHP" or
>>"TCL"?
>
>If you really have to delete a mail message from a mailbox, there are
>Perl modules that can load a mailbox, separate it into messages, let
>you do things with the list of messages (like delete some of them), and
>then write the updated set of messages back to the mailbox file.
... in other languages, too, including PHP
and Tcl, although of course these don't
publish the work as conveniently as CPAN
does.
.
.
.
--
Cameron Laird <claird@NeoSoft.com>
Business: http://www.Phaseit.net
Personal: http://starbase.neosoft.com/~claird/home.html
------------------------------
Date: Thu, 12 Apr 2001 13:06:12 GMT
From: cryofan@mylinuxisp.com (cRYOFAN)
Subject: Re: post to my yahoo/hotmail accounts via automatic scipt?
Message-Id: <3ad5a11c.125754114@news3.mylinuxisp.com>
On Thu, 12 Apr 2001 01:51:29 -0400, brian d foy <comdog@panix.com>
wrote:
>In article <3ad537f7.98832905@news3.mylinuxisp.com>,
>cryofan@mylinuxisp.com (cRYOFAN) wrote:
>
>> I have a program that I need to demo as part of my senior project, and
>> it need to periodically send out an email. Problem is that at the
>> school where I need to demo this script, my email is via SMTP.
>> But the school has disabled SMTP relay,
>
>and how does that stop you from sending mail?
>
Well, the sysadmin there told me that unless I could send from my UNIX
account (I do have a mail account there), meaning that I have to have
my perl script running in the RAM of my unix window, then I CANNOT
send mail via SMTP.
The UNIX account I have at school is very crippled; there is no perl
interpreter available, so my perl script cannot run in UNIX there.
And there is no perl2exe available for the Digital UNIX flavor that is
running at school. The only folders I have permission to see are like
gcc, cc, emacs, pico, etc. Crippled.
I am able run my scripts from the Windows boxes at school via the good
facilities of the demo perl2exe progams. So I just run the exe
versions of my scripts, and they work fine except for the email part.
How else could I send mail from the windows boxes at school except via
SMTP, which as I said before, I cannot do, as the sysadmin has
disabled SMTP relay there. I know, I have tried: the SMTP server would
be "mail.uhddx01.dt.uh.edu" and my account is
"myUserName@uhddxo1.dt.uh.edu", so that would be the sender, and I
have tried to send mail to my yahoo account, and failed; whereas when
I run the script from home while logged onto my ISP, it works fine;
I can send mail via the SMTP server at my ISP, with an SMTP server of
"mail.mylinuxisp.com" and the sender is "mysUserName@mylinuxisp.com"
and the recipient is my yahoo acct "cryofan@yahoo.com".
This is the code for the email alert part of my script:
use Mail::Sender;
.........
$sender = new Mail::Sender {smtp => 'mail.uhddxo1.dt.uh.edu',
from => 'myUserName@uhddxo1.dt.uh.edu'};
$sender->MailFile({to => 'cryofan@yahoo.com',
subject => 'The Dow has changed!',
msg => "The Dow has changed in the last 15 minutes by
$dow - $old_dow points.",
file => 'msg1.txt'
});
Works fine at home through my ISP! But not at school due to SMTP relay
disabled!
IS there any other way to send mail via my perl script to my yahoo
acct from the windows box at thisi school which has disabled SMTP
relay?
The only way I can think of is doing HTTP and logging onto a web based
email account like yahoo via POST.
But I am no web programming expert; maybe someone else can tell me
how.
BTW, the main function of this perl script (my senior project for my
BSCS degree) is to download financial news stories and if a story has
one or more occurrence of a certain financially important phrase such
as "the economy", then it counts all the instances of certain "up"
and "down" synonymous words such as
"rising", "falling" etc and stores those counts and the time in a
file, and at the same time downlaods the DOW industrial avg, and
stores that and the time. That data is plotted by magnitude and time
of day and date on a java appplet.
You can see some of the early data on the applet at
www.geocities.com/cryofan/
I will post the script and applet code and all the April data in the
next month.
But now my advisor wants me to do the email alert thing, and it works
fine at home, but I gotta demo it at school....any help is
appreciated.
------------------------------
Date: Thu, 12 Apr 2001 13:11:21 GMT
From: cryofan@mylinuxisp.com (cRYOFAN)
Subject: Re: post to my yahoo/hotmail accounts via automatic scipt?
Message-Id: <3ad5a8c5.127716008@news3.mylinuxisp.com>
On Thu, 12 Apr 2001 13:06:12 GMT, cryofan@mylinuxisp.com (cRYOFAN)
wrote:
>use Mail::Sender;
>.........
>
>$sender = new Mail::Sender {smtp => 'mail.uhddxo1.dt.uh.edu',
>from => 'myUserName@uhddxo1.dt.uh.edu'};
That school server should be "uhddx01" instead ( "0" instead of "o").
>$sender->MailFile({to => 'cryofan@yahoo.com',
>subject => 'The Dow has changed!',
> msg => "The Dow has changed in the last 15 minutes by
>$dow - $old_dow points.",
> file => 'msg1.txt'
> });
>
>
>Works fine at home through my ISP!
Of course when I use my ISP the SMTP server is changed to the SMTP
server name at my ISP, namely "mail.mylinuxisp.com" and my username
is "myUserName@mylinuxisp.com". As I said, it works fine via my ISP.
>
>IS there any other way to send mail via my perl script to my yahoo
>acct from the windows box at thisi school which has disabled SMTP
>relay?
>
>The only way I can think of is doing HTTP and logging onto a web based
>email account like yahoo via POST.
>
>But I am no web programming expert; maybe someone else can tell me
>how.
>
>BTW, the main function of this perl script (my senior project for my
>BSCS degree) is to download financial news stories and if a story has
>one or more occurrence of a certain financially important phrase such
>as "the economy", then it counts all the instances of certain "up"
>and "down" synonymous words such as
>"rising", "falling" etc and stores those counts and the time in a
>file, and at the same time downlaods the DOW industrial avg, and
>stores that and the time. That data is plotted by magnitude and time
>of day and date on a java appplet.
>
>You can see some of the early data on the applet at
>www.geocities.com/cryofan/
>
>I will post the script and applet code and all the April data in the
>next month.
>
>But now my advisor wants me to do the email alert thing, and it works
>fine at home, but I gotta demo it at school....any help is
>appreciated.
>
>
>
>
------------------------------
Date: Thu, 12 Apr 2001 16:09:38 +0200
From: Philip Newton <pne-news-20010412@newton.digitalspace.net>
Subject: Re: post to my yahoo/hotmail accounts via automatic scipt?
Message-Id: <dmdbdt8ju00mvhs46kbrp49120f86svhj5@4ax.com>
On Thu, 12 Apr 2001 05:11:17 GMT, cryofan@mylinuxisp.com (cRYOFAN)
wrote:
> I guess my only other
> choice is to somehow send mail through my hotmail or yahoo accounts
> via posting and logging onto my accounts via the webform.. Even this
> even possible?
Yes. You could use LWP to fetch the pages (including sub-frames) and
post stuff at the server as if coming from a browser.
Whether you would want to program that is another matter.
Cheers,
Philip
--
Philip Newton <nospam.newton@gmx.li>
Yes, that really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.
------------------------------
Date: Thu, 12 Apr 2001 10:48:09 -0400
From: me <shmooth@MailAndNews.com>
Subject: Problems sending gif image from cgi script using LWP??
Message-Id: <3AE3213B@MailAndNews.com>
Hi all,
My gif renders partially or not at all from my cgi script. I've tried
LWP::UserAgent as well as LWP::Simple. Here are a couple of code snippets.
I don't know if things are complicated by the fact that the URL I'm using to
retrive the gif is actually a script that will redirect (via a 'Location:'
header at least once). It seems this should be taken care of automatically
by
the UserAgent->request() call, as opposed to the UserAgent->simple_request()
call. What am I doing wrong?
###Using UserAgent (this code works fine for text/html, but not image/gif)
use LWP::UserAgent;
$ua = new LWP::UserAgent;
$ua->agent("My Test Agent/0.1a " . $ua->agent);
#Following URL is actually commercial code - not mine! :)
my $url = 'http://some_server/cgi-bin/adserver/redirector.pl';
my $req = new HTTP::Request GET => $url_new;
my $res = $ua->request($req);
print $res->headers_as_string;
print $res->content;
###Using Simple (this code works fine for text/html, but not image/gif)
use LWP::Simple;
#Include following line?
# print "Content-type: image/gif\n\n";
getprint($url_new);
--Peter--
------------------------------------------------------------
Get your FREE web-based e-mail and newsgroup access at:
http://MailAndNews.com
Create a new mailbox, or access your existing IMAP4 or
POP3 mailbox from anywhere with just a web browser.
------------------------------------------------------------
------------------------------
Date: 12 Apr 2001 15:02:03 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: Problems sending gif image from cgi script using LWP??
Message-Id: <9b4g1b$j6v$4@bob.news.rcn.net>
me <shmooth@mailandnews.com> wrote:
> My gif renders partially or not at all from my cgi script. I've tried
> LWP::UserAgent as well as LWP::Simple. Here are a couple of code snippets.
Are you running on a Win32 system? If so, your failure to binmode STDOUT
will cause exactly the problem you described.
------------------------------
Date: Thu, 12 Apr 2001 13:32:01 GMT
From: David Bakhash <cadet@alum.mit.edu>
Subject: think I found what I was looking for...
Message-Id: <m3hezuzp26.fsf_-_@alum.mit.edu>
POE is it...
http://poe.perl.org
thanks,
dave
------------------------------
Date: Thu, 12 Apr 2001 14:03:28 GMT
From: Stan Francis <scf@ltop.newk.net>
Subject: Ulimit in Perl
Message-Id: <QAiB6.1999$4N3.40210@ord-read.news.verio.net>
Is there a way to set system resource limits in a perl program/script like
ulimit in a shell? TIA
------------------------------
Date: 12 Apr 2001 14:15:17 GMT
From: damian@qimr.edu.au (Damian James)
Subject: Re: Unix Script in a Perl script to the Web.vvp
Message-Id: <slrn9dbe1a.89o.damian@puma.qimr.edu.au>
Prasad, Victor [FITZ:K500:EXCH] chose Thu, 12 Apr 2001 06:12:04 -0400
to say this:
>I would like to use a pre-existing Unix script in a perl script.
>
>I have a unix script that accepts up to two parameters. Once entered it
>performs its task and spits out output as it is working. I have to
>output the data from the Unix script to a Web page - hopefully - as in
>realtime. Sometimes the output takes a long time to finish - so buy
>displaying it as it output would let the user know it is working.
>...
I have to assume that by a 'Unix script' you mean some sort of shell
script.
>I have to pass the parameters to the Unix script - but am not sure how
>to get the output from the script to Perl then the web.
>
>Basically it the Unix script looks like this:
>
>Catalog? 10
>Item? 5
>...
OK, it looks like you are showing us the interactive output from the shell
script, rather than the script itself (which is what most of us might have
been expecting). Do you know if this script can be run non-interactively?
>...
>Inserted 5
>New total 5
>
>Successful.
>
>I was going to use the system command to make the script run. But am
>not sure how to get the output to let the use know all is OK.
Well, if there is output from this shell script that you want to keep
then you want to be using backticks rather than system(). But that
doesn't solve the problem of whether the shell script can be run
non-interactively. If you can specify the parameters on the command line
when the script is invoked, then your perl program could say something
like:
my @output = `your_script param1 param2`;
However, if this is not the case, then you need to either 1) rewrite the
shell script so that it CAN accept parameters on the command line, or 2)
investigate the CPAN for modules that would help your program to interact
with interactive IO (Expect sounds promising, but I must admit I've never
used it and can't say whether it would help in your case).
To output the return data from the shell script directly to the web
browser, should this be running in a CGI environment (you are using the
CGI module, right?), you'd do something like:
$| = 1;
print `your_script param1 param2`;
see:
perldoc perlvar
perldoc CGI
perdoc -f system
HTH,
Cheers,
Damian
--
@:=grep!($;+=m!$/|#!),split//,<DATA>;@;=0..$#:;while(@;){for($;=@;;--$;;){;(
$:=rand$;+$|)==$;&&next;@;[$;,$:]=@;[$:,$;]}push@|,shift@;if$;[0]==@|;select
$,,$,,$,,1/80;print qq x\bxx((@;+@|)*$|++),@:[@|,@;],!@;&&$/} __END__
Just another Perl Hacker # rev 3 -- a JAPH in progress, I guess...
------------------------------
Date: Thu, 12 Apr 2001 13:28:25 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: use strict and sysopen
Message-Id: <a1bbdtkjblv5uhrsnkgv4ros2h100h4ulg@4ax.com>
LXQ wrote:
>use Fcntl qw(:flock);
>use strict;
>
>[... trimmed ...]
>
> sysopen(DATABASE, $dataFile, O_APPEND)
> or die("ERROR: Can not open database file");
>
>[... trimmed ...]
>
>But when I tried to run it, Perl complained that:
>Bareword "O_APPEND" not allowed while "strict subs" in use at
Your problems is that, as soon as you add ":flock" to the list of stuff
to import when using Fcntl, it forgets about its defaults. You either
have to explicitely mention "Hey, I want the defaults too!", which is
what nobull did, or you use the module twice.
use Fcntl;
use Fcntl ':flock';
(You may use 'qw' if you like... it makes no difference here, as there's
only one word.)
--
Bart.
------------------------------
Date: Thu, 12 Apr 2001 07:35:06 -0600
From: "bowman" <bowman@montana.com>
Subject: Re: Why perl and not Bourne/Korn scripts?
Message-Id: <S3iB6.107$aY5.236@newsfeed.slurp.net>
"Roland" <roland.rashleigh-berry@virgin.net> wrote in message
news:3AD587CE.378@virgin.net...
> > I spend the time to get heavily into writing Bourne or Korn scripts or
> both or can perl do the same and should I learn perl and do it in perl
> instead?
By the time you learn a shell scripting, and I've found that sooner or later
you'll need to at least know a little of both the Bourne/Bash/Korn and
C/TCsh flavors, and then find you can't do what you want to do and need to
learn a little sed or awk, and then find that still doesn't cut it, you'd be
better off learning Perl.
Then, when someone drags you kicking and screaming onto Win2000 or WinXP and
suggests you need to learn JScript or VBScript, you smile and download the
AS Perl distro.
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.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 685
**************************************