[10295] in Perl-Users-Digest
Perl-Users Digest, Issue: 3888 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Oct 4 19:08:03 1998
Date: Sun, 4 Oct 98 16:00:26 -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 Sun, 4 Oct 1998 Volume: 8 Number: 3888
Today's topics:
Re: Building perl for Solaris <eashton@bbnplanet.com>
Re: CGI.pm - forms within tables - How to? (Larry Hunter)
Re: CGI.pm objects <mp@mkt2mkt.com>
Re: DEL in PERL (Mark-Jason Dominus)
Re: HELP !!! PERL EMERGENCY (Rich)
Re: How do you setup Win98 to run perl CGI scripts helphand@pacbell.net
implementing ceiling and floor <xah@best.com>
Re: implementing ceiling and floor <matt@whiterabbit.co.uk>
Re: implementing ceiling and floor (Daniel E. Macks)
ip addresses (Daryn Brightblade)
Re: ip addresses <eashton@bbnplanet.com>
Re: Newbie needs help slizarra@my-dejanews.com
Newbie question about variable scope <perless@yellowkite.com>
Re: Newbie question about variable scope (Mark-Jason Dominus)
Re: Newbie question about variable scope <perless@yellowkite.com>
Re: Newbie question about variable scope <r_larsen@image.dk>
Re: Newbie question about variable scope (Mark-Jason Dominus)
Re: Newbie question about variable scope (I R A Aggie)
Re: Newbie question about variable scope <eashton@bbnplanet.com>
News indexing robot (webmaster)
perl and Locale settings. <hysterx@interaccess.com>
Re: Problem with Getopt::Std <r28629@email.sps.mot.com>
Question about using @a=<STDIN> <algar@NOSPAM.minn.net>
Re: Removing a line from a file (Tad McClellan)
return status of a remote shell command <lkl@runge.uni-c.dk>
Re: RFC: "Build'n'Play" installation tool <eashton@bbnplanet.com>
Run cgi scripts ar regular intervals <jayss@sprintmail.com>
Re: Run cgi scripts ar regular intervals <eashton@bbnplanet.com>
Re: Run cgi scripts ar regular intervals <samwang@freewwweb.com>
Re: Run cgi scripts ar regular intervals <eashton@bbnplanet.com>
Re: Survey Script <matt@whiterabbit.co.uk>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 04 Oct 1998 21:30:43 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: Building perl for Solaris
Message-Id: <3617E68C.A4FB68F9@bbnplanet.com>
Gerard Hickey wrote:
> This build was done on Solaris 2.5.1 using gcc 2.7.2. I even tried to
> put /usr/ccs/bin at the front of $PATH. I figure that this problem
> has been solved many times before, but I can not find anything.
I forget if it was 2.7.1 or 2.7.2 that gave me grief on numerous things
but you might want to look at 2.8.* and see if the README mentions the
bug. When you run Configure stick to the defaults on a clean build and
see if you get the same results. Also, you don't want /usr/ccs/bin
preceeding the path to your gcc on Solaris unless you are using
SUNWspro.
e.
As I was lying there with my eyes closed, just after I'd
imagined what it might be like if in fact I never got up
again, I thought of you. I opened my eyes then and got
right up and went back to being happy again.
I'm grateful to you, you see. I wanted to tell you. -R. Carver-
------------------------------
Date: 4 Oct 1998 17:41:00 GMT
From: lhunter@acm.org (Larry Hunter)
Subject: Re: CGI.pm - forms within tables - How to?
Message-Id: <6v8bvc$k70$1@hiram.io.com>
In article <6ur3q8$2fm$3@marina.cinenet.net>, cberry@cinenet.net says...
>
>Note that since you want the radio buttons in separate cells, you can't
>use CGI.pm's radio_group function; hence the literal HTML for these.
You CAN use the radio_group function for this. Assign its return value
to an array, and you get a list of the radio button components. Then
you can arrange them in table cells for whatever layout you want.
------------------------------------------------------------------------
Larry Hunter lhunter@acm.org http://www.io.com/~lhunter/
------------------------------
Date: Sun, 04 Oct 1998 15:07:20 -0800
From: madame philosophe <mp@mkt2mkt.com>
To: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: CGI.pm objects
Message-Id: <3617FFA5.5F14A040@mkt2mkt.com>
Hi Jonathan,
Thanks for a sincere and well intended answer... (finally!)
I am printing off your reply and will study it. Will post back if there are
more questions from my p-brain.....
Thanks
madame p
(..hey just think of it as a filehandle in an OO world!)
Jonathan Stowe wrote:
> On Sat, 03 Oct 1998 21:08:17 -0800 madame philosophe <mp@mkt2mkt.com> wrote:
> > Hi all,
>
> > I'm attempting to use CGI.pm with it's oo interface....
>
> Good, good.
>
> > I'm guessing that I should keep myself straight by constructing objects
> > within subroutines (methods?). I know I don't have to, but for my
> > barely understanding the rules I'm grasping for a programming
> > methodology that will keep my nose clean.
>
> You dont really need to do that and there is some overhead on constructing
> the new objects - I would favour passing around the object variable between
> subroutines if the object was not desired to be global.
>
> > What I want to know is this:
>
> > How I use CGI.pm objects without getting totally over my head with oo
> > programming? I've perused the modules and I'm completely overwelmed.
>
> > (Don't tell me to take a programming class or I'll hunt you down and
> > skin you alive, er.. I mean that such a suggestion won't be helpful to
> > me at this point in time)
>
> > CGI.pm is fairly understandable, or I should say the most understandable
> > to me.
> > (This is for a web cgi script)
>
> > I get it that CGI.pm generates a new object (Q), but how to use other
> > CGI.pm objects alongside Q within the same script? Do I HAVE to make
> > packages?
>
> > Here's a teeny example...
>
> > If I've already declared "use CGI; " and "$q = new CGI; " in the main
> > routine
>
> > can I do this in a subroutine?? Dites-moi!
>
> > (I'm not confident in my syntax, either, so there you go)
>
> > sub verify_this_user {
>
> > local(@login_keys) = @_;
> > my($user) = new CGI(@login_keys);
>
> > if ($user->param('login')) {
> > check_password($user);
> > } elsif ($user->param('forgot')) {
> > retrieve_clueword($user->param('username'));
> > email_to_agent($user->param('username'));
> > } elsif ($user->param('change_password')) {
> > check_username($user->param('username'));
> > if ($user_matched = 1){
> > print_change_password_page($user);
> > }
> > }
>
> > } #end of verify_this_user()
>
> You cannot create a new CGI object from an array like that.
>
> As far as I know (and the manpage seems to indicate) there are four possible
> constructors:
>
> Plain:
>
> my $query = new CGI;
>
> # The CGI object is created from the current CGI environment
>
> File:
>
> my $query = new CGI($filename); # or
>
> my $query = new CGI(\*FILEHANDLE);
>
> # file consists of name=value lines
> # this could have been previously created by CGI's save() method
>
> Reference to Hash:
>
> my $query = new CGI(\%hash);
>
> # %hash contain name value pairs.
>
> Query string:
>
> my $query = CGI($querystring);
>
> # where $querystring is a properly formatted URL escaped query string
> # such as would be found from $ENV{QUERY_STRING}
>
> In your example (if I was going to do it like that) I would probably use
> the latter constructor so the beginning of your code would become:
>
> sub verify_this_user {
>
> local $query_string = shift;
> my $user = new CGI($query_string);
>
> ....
> }
>
> And you would use it (assuming you already have a CGI instance called $q)
> like:
>
> verify_this_user($q->query_string());
>
> Have fun
>
> /J\
> --
> Jonathan Stowe <jns@btinternet.com>
> Some of your questions answered:
> <URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: 4 Oct 1998 14:28:56 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: DEL in PERL
Message-Id: <6v8ep8$kn8$1@monet.op.net>
In article <fl_aggie-0210981034350001@aggie.coaps.fsu.edu>,
I R A Aggie <fl_aggie@thepentagon.com> wrote:
>> I am trying to find all files on the HD which end in *.bak and then delete
>> them.
>
>find2perl / '*.bak' -exec rm -f {} \;
>
That command will erase everything. I think you meant to write
find2perl / -name '*.bak' -exec rm -f {} \;
------------------------------
Date: 4 Oct 1998 20:48:28 GMT
From: richm@ucesucks.mulveyr.roc.servtech.com (Rich)
Subject: Re: HELP !!! PERL EMERGENCY
Message-Id: <slrn71fnof.5qg.richm@ll.aa2ys.ampr.org>
On 4 Oct 1998 19:57:21 GMT, SattarS <sattars@aol.com> wrote:
>
>Hi,
>
>Can someone tell me how in Perl 5 I can get the IP address,Subnet mask and
>Default Gateway ? (ie is there a command that will get me this info!!)
>
>Thanks
>
( Newgroup redirected to something a wee bit more relevant... )
Why not just execute ifconfig/netstat, and parse the output?
- Rich
--
Rich Mulvey
My return address is my last name,
followed by my first initial, @mulveyr.roc.servtech.com
http://mulveyr.roc.servtech.com
Amateur Radio: aa2ys@wb2wxq.#wny.ny.usa
------------------------------
Date: Sun, 04 Oct 1998 17:02:57 GMT
From: helphand@pacbell.net
Subject: Re: How do you setup Win98 to run perl CGI scripts
Message-Id: <3617a9a7.665889700@news.pacbell.net>
On Sun, 04 Oct 1998 13:12:21 GMT, aali@ix.netcom.com (Abdul Ali)
wrote:
>Hi everyone,
>
>I am using Perl for Win32 on my Win98 PC at home. My PC is not a
>server. Is it possible to set up my machine so that I could bring up
>Netscape and have it recognize and run Perl CGI scripts?
>
>Thanks,
>Abdul
Yes, install server software on your Win98 system. There's lots of
freeware servers available that work just fine, try www.tucows.com
or www.sambar.com
Scott
--------
Delta Performance Group, "Achieving the Competitive Edge"
http://www.deltagrp.com/
------------------------------
Date: Sun, 04 Oct 1998 12:33:20 +0000
From: "Xah" <xah@best.com>
Subject: implementing ceiling and floor
Message-Id: <6v8i1r$knr$1@nntp2.ba.best.com>
I'm implementing "ceiling" and "floor", since I don't see them anywhere and
the FAQ basically says implement your own.
My question is, how to find out if an argument is integer? Must I turn it
into a string and test the string form (sprintf)? (doesn't looks to me like
a clean approach.)
For example, the following floor gives wrong answer when the argument is a
negative integer.
sub Floor {if ($_[0] >= 0) {return (int $_[0]);} else {return (int $_[0]
-1);} ;};
I recall that every number in perl is real. So perhaps the question is
reduced to whether the input is close to an integer. Accuracy is very
important for me. Is it best to require that the input be in a string form?
Thanks to experts.
Xah, xah@best.com
http://www.best.com/~xah/PageTwo_dir/more.html
"Sysadmin... bah."
------------------------------
Date: Sun, 04 Oct 1998 20:39:10 +0100
From: Matt Pryor <matt@whiterabbit.co.uk>
To: Xah <xah@best.com>
Subject: Re: implementing ceiling and floor
Message-Id: <3617CEDE.C4A1985@whiterabbit.co.uk>
How about
if ($number == int($number)) {..} ?
Matt
--
Xah wrote:
>
> I'm implementing "ceiling" and "floor", since I don't see them anywhere and
> the FAQ basically says implement your own.
>
> My question is, how to find out if an argument is integer? Must I turn it
> into a string and test the string form (sprintf)? (doesn't looks to me like
> a clean approach.)
>
> For example, the following floor gives wrong answer when the argument is a
> negative integer.
>
> sub Floor {if ($_[0] >= 0) {return (int $_[0]);} else {return (int $_[0]
> -1);} ;};
>
> I recall that every number in perl is real. So perhaps the question is
> reduced to whether the input is close to an integer. Accuracy is very
> important for me. Is it best to require that the input be in a string form?
>
> Thanks to experts.
>
> Xah, xah@best.com
> http://www.best.com/~xah/PageTwo_dir/more.html
> "Sysadmin... bah."
--
Matt's daily comic strip
Porridge and Fartcakes
http://www.whiterabbit.co.uk/cartoons
------------------------------
Date: 4 Oct 1998 21:14:19 GMT
From: dmacks@sas.upenn.edu (Daniel E. Macks)
Subject: Re: implementing ceiling and floor
Message-Id: <6v8ofb$743$1@netnews.upenn.edu>
Xah (xah@best.com) said:
: I'm implementing "ceiling" and "floor", since I don't see them anywhere and
: the FAQ basically says implement your own.
The FAQ I see proposes using the POSIX module...
ceil This is identical to the C function ceil().
floor This is identical to the C function floor().
but if you wanted to roll your own just to be sure, consider...
sub Ceil { int($_[0]) + ( $_[0]>0 && $_[0] != int($_[0]) ) }
sub Floor { int($_[0]) - ( $_[0]<0 && $_[0] != int($_[0]) ) }
dan
--
Daniel Macks
dmacks@a.chem.upenn.edu
dmacks@netspace.org
http://www.netspace.org/~dmacks
------------------------------
Date: Sun, 04 Oct 1998 21:10:00 GMT
From: daryn@solamnia.demon.co.uk (Daryn Brightblade)
Subject: ip addresses
Message-Id: <3617e39b.2894802@news.demon.co.uk>
Dear all...
Just a quick desperation question please.
is it at all possible for me to use a single command in perl
to bring up the network config of the pc in question please?
ie
a perl 5 version of the NT command "ipconfig"
It's probably easier to go the long way around and just do the command
ipconfig, route it to a text file and search what we want from that
but is there an easier way please?
Thank you all a _lot_ for responding if you do. :)
Daryn Brightblade
Est Sularus Oth Mithas
Comrades in Arms, Brothers in Peace, the Clan Brightblade
http://www.solamnia.demon.co.uk/
------------------------------
Date: Sun, 04 Oct 1998 21:40:06 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: ip addresses
Message-Id: <3617E8BE.5FEF3A29@bbnplanet.com>
Daryn Brightblade wrote:
> Just a quick desperation question please.
> is it at all possible for me to use a single command in perl
> to bring up the network config of the pc in question please?
Have you tried 'netstat /?' You should be able to see all interfaces,
ports, protocols and ips with that command. Perl doesn't have an
internal function to do this that I know of.
e.
As I was lying there with my eyes closed, just after I'd
imagined what it might be like if in fact I never got up
again, I thought of you. I opened my eyes then and got
right up and went back to being happy again.
I'm grateful to you, you see. I wanted to tell you. -R. Carver-
------------------------------
Date: Sun, 04 Oct 1998 20:52:22 GMT
From: slizarra@my-dejanews.com
Subject: Re: Newbie needs help
Message-Id: <6v8n66$8bf$1@nnrp1.dejanews.com>
If you need to find the Perl book, I suggest that you visit
http://www.sylnet.com/books
Good Luck!
In article <slrn70355h.4j.alastair@calliope.demon.co.uk>,
alastair@calliope.demon.co.uk wrote:
> Maxim Weinstein <weinstem@bms.com> wrote:
> >I'm a perl newbie, though I have a _little_ C programming experience.
> >I'm trying to create a script that does significant file manipulation,
> >but I'm unsure how to do it, even after looking over a few perl
> >resources.
>
> I'm sorry if you only want to see a response along the lines of a 'pre-canned'
> program but I think I have very good advice.
>
> Basically, you need to do more than merely 'look' over a few perl resources
> (whatever they are). If you want to learn and understand, the best way is to
> actually get stuck in and try things out. It really isn't hard. The program
you
> want is pretty straightforward.
>
> I'd buy a book on perl (e.g. Learning Perl from O'Reilly) and start to read
and,
> more importantly, try.
>
> Good luck.
>
> --
>
> Alastair
> work : alastair@psoft.co.uk
> home : alastair@calliope.demon.co.uk
>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Sun, 04 Oct 1998 17:06:52 GMT
From: "Perless Dudek" <perless@yellowkite.com>
Subject: Newbie question about variable scope
Message-Id: <MWNR1.9510$N43.29034654@news.rdc1.tn.home.com>
Hello,
I am still trying to make this work. I think my problem has to do with
somthing about local/global variables and my PERL environment, but I dont
know what to do about it. Can anyone help????
Thanks,
Syd
****Code*****
#!/usr/bin/perl -w
use Getopt::Std;
getopt('de');
print "Debug trace swith on\n" if $opt_d;
print "Extra debug trace swith on\n" if $opt_e;
print "no more switches\n";
*** Result ****
% perl -w optdemo.pl
"use" may clash with future reserved word at optdemo.pl line 2.
syntax error in file optdemo.pl at line 2, next 2 tokens "use Getopt"
"getopt" may clash with future reserved word at optdemo.pl line 4.
------------------------------
Date: 4 Oct 1998 14:05:16 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Newbie question about variable scope
Message-Id: <6v8dcs$khc$1@monet.op.net>
In article <MWNR1.9510$N43.29034654@news.rdc1.tn.home.com>,
Perless Dudek <perless@yellowkite.com> wrote:
>"use" may clash with future reserved word at optdemo.pl line 2.
This is not a variable scope problem. The problem is that your
version of perl is too old. Time to upgrade.
------------------------------
Date: Sun, 04 Oct 1998 18:10:54 GMT
From: "Perless Dudek" <perless@yellowkite.com>
Subject: Re: Newbie question about variable scope
Message-Id: <OSOR1.9515$N43.29066488@news.rdc1.tn.home.com>
Thanks,
My server says I have Perl5 v004_03. (Or whatever the latest perl is on
Vservers.com) is there a new command that I should use that accomplishes
the same thing I am trying? I am using examples in the "Perl How-To" book
to learn Perl.
Thanks much!
Syd
>
>This is not a variable scope problem. The problem is that your
>version of perl is too old. Time to upgrade.
------------------------------
Date: Sun, 04 Oct 1998 22:37:50 +0100
From: R. A. Larsen <r_larsen@image.dk>
Subject: Re: Newbie question about variable scope
Message-Id: <VA.00000062.0096c08b@octo>
"Perless Dudek" <perless@yellowkite.com> wrote:
>
> Hello,
>
> I am still trying to make this work. I think my problem has to do with
> somthing about local/global variables and my PERL environment, but I dont
> know what to do about it. Can anyone help????
>
> Thanks,
> Syd
>
> ****Code*****
>
> #!/usr/bin/perl -w
Are you trying this running unix (the headers suggest you are using Win95) or is
perl installed there?
Is perl in your path?
> use Getopt::Std;
>
> getopt('de');
> print "Debug trace swith on\n" if $opt_d;
> print "Extra debug trace swith on\n" if $opt_e;
> print "no more switches\n";
I tried your program and it works (-w warns about only using the variables once).
I am running perl 5.004_02. It works because I have perl in my path.
> *** Result ****
>
> % perl -w optdemo.pl
>
> "use" may clash with future reserved word at optdemo.pl line 2.
> syntax error in file optdemo.pl at line 2, next 2 tokens "use Getopt"
> "getopt" may clash with future reserved word at optdemo.pl line 4.
What version of perl are you using (perl -v)? perl 4.xxx do AFAIK not have 'use'.
Reni
--
Using Virtual Access
http://www.vamail.com
------------------------------
Date: 4 Oct 1998 15:45:48 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Newbie question about variable scope
Message-Id: <6v8j9c$l27$1@monet.op.net>
In article <OSOR1.9515$N43.29066488@news.rdc1.tn.home.com>,
Perless Dudek <perless@yellowkite.com> wrote:
>My server says I have Perl5 v004_03. (Or whatever the latest perl is on
>Vservers.com)
Your server is lying, or you aren't using the perl you think you are.
The message you got indicates perl 4.
If your server really does have perl 5, talk to your system
dministrators to find out where it is and how to get your scripts to
se it.
------------------------------
Date: Sun, 04 Oct 1998 16:53:30 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Newbie question about variable scope
Message-Id: <fl_aggie-0410981653300001@aggie.coaps.fsu.edu>
In article <6v8j9c$l27$1@monet.op.net>, mjd@op.net (Mark-Jason Dominus) wrote:
+ In article <OSOR1.9515$N43.29066488@news.rdc1.tn.home.com>,
+ Perless Dudek <perless@yellowkite.com> wrote:
+ >My server says I have Perl5 v004_03. (Or whatever the latest perl is on
+ >Vservers.com)
+
+ Your server is lying, or you aren't using the perl you think you are.
+ The message you got indicates perl 4.
Our friend should try this from the command line:
/usr/bin/perl -v
which is the interpreter invoked by the script, if the shebang line is
honored/believed. It may be that the server in question has multiple
perls.
James - or one rather old one...v4pl36 was a 1991 introduction, if I remember...
------------------------------
Date: Sun, 04 Oct 1998 21:50:38 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: Newbie question about variable scope
Message-Id: <3617EB37.44E5C308@bbnplanet.com>
Perless Dudek wrote:
> My server says I have Perl5 v004_03. (Or whatever the latest perl is on
> Vservers.com) is there a new command that I should use that accomplishes
> the same thing I am trying? I am using examples in the "Perl How-To" book
> to learn Perl.
Try this then. Do a 'which perl' on your system. It may be that your
shebang is calling a different version of perl than you think. MJD is
correct in saying that your program is calling perl4. /usr/bin/perl may
not be the same as /usr/local/bin/perl. Also, toss the how-to book and
go get yourself a copy of the Perl Cookbook.
e.
As I was lying there with my eyes closed, just after I'd
imagined what it might be like if in fact I never got up
again, I thought of you. I opened my eyes then and got
right up and went back to being happy again.
I'm grateful to you, you see. I wanted to tell you. -R. Carver-
------------------------------
Date: Sun, 04 Oct 1998 19:06:30 GMT
From: eikosi@freemail.gr (webmaster)
Subject: News indexing robot
Message-Id: <3617c672.179809564@news.ping.be>
Hi all
I am looking for a "light" version of a robot which crawls Newspaper
sites and comes up with headlines and summaries.
Something like http://www.newsindex.com/
but of course a ligher version
Is anything out there?
I spent lots of time searching before I post here so I hope you would
find it justified.
An email reply would be preferable, but I wiil come back here with
credits.
Thanks a lot
Sandra Patri
------------------------------
Date: Sun, 4 Oct 1998 17:00:48 -0500
From: "Dave Cooper" <hysterx@interaccess.com>
Subject: perl and Locale settings.
Message-Id: <6v8r7s$a3k$1@supernews.com>
Hello,
I am totally new to perl and I bought a book on it. I went and entered
the first few examples as .pl files and tried to run them. The first time I
ran it I got an error about the type of commands I was using (i.e. "chomp"
and while X ne Y) So I figured out that the main version of perl on my
system was 4. I also found perl5 in another directory. This seems that it is
the one that the book refers to 5.004. My system is FreeBSD 2.2.6. When I
run the hello.pl file it gives me the following error:
bash$ perl5 -v
perl: warning: Setting local failed.
perl: warning: Please check that you locale settings:
LC_ALL = "unset"
LANG = "us"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Can someone please give me information on this error and how maybe I can
correct it or where the specific topics related to this problem are. I did
not install perl on my system it was just there when I went to learn it.
Thank you in advance.
David Cooper
------------------------------
Date: Sun, 04 Oct 1998 13:44:28 -0500
From: Tk Soh <r28629@email.sps.mot.com>
Subject: Re: Problem with Getopt::Std
Message-Id: <3617C20C.1C07BBE2@email.sps.mot.com>
Perless Dudek wrote:
> use 'Getopt::Std';
Try remove the quotes around Getopt::Std.
Are you sure you copied the example correctly?
:)
------------------------------
Date: Sun, 4 Oct 1998 12:53:33 -0500
From: "Algar" <algar@NOSPAM.minn.net>
Subject: Question about using @a=<STDIN>
Message-Id: <6v8cm2$sqv$1@news.minn.net>
Here is a small script I wrote while working through O'Reilly's "Learning
Perl on Win32 Systems."
----------------------------------------------------------------------------
----------------------------------
#Input list of strings and print them out in reverse order.
#without using the reverse function.
print("Please enter a list of strings ending with Ctrl-Z: \n");
@list=<STDIN>;
print("------------------------------------\n");
print("- Here are the results -\n");
print("------------------------------------\n");
do
{
chomp($a=pop(@list));
print("$a\n");
} while (defined($a));
----------------------------------------------------------------------------
----------------------------------
When I run this on my Win98 system (the only place I have tried it) I notice
that the first instance of
print("------------------------------------\n"); doesn't produce any output.
However when I modify the code as follows
@list=<STDIN>;
print("\n");
print("------------------------------------\n");
print("- Here are the results -\n");
print("------------------------------------\n");
The heading is dispayed correctly. Is it the case that you must print
something to the bit bucket after using <STDIN> to enter an array before
subsequent print statements will produce output?
I am using the latest Win32 version of Perl from ActiveState.
Thanks in advance!
-Al
------------------------------
Date: Sun, 4 Oct 1998 12:45:54 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Removing a line from a file
Message-Id: <i8c8v6.dfc.ln@flash.net>
Stephen Benjamin (steve.benjamin@juno.com) wrote:
: How would I remove
: that line from the file
: Can someone help me?
Yes.
Someone has already taken the time to help you, but you have
ignored it.
This someone (someones, actually) have compiled a list of
Frequently Asked Questions (FAQ), and put them all together
in one place so that you can find the answer quickly.
These FAQs *come with* the perl distribution. If you have
a proper perl, then you already have these files on your
hard disk somewhere. Find out where.
But you have to look for the answer in order to find it.
You are expected to do that *before* posting, as the question
has been asked, and answered, hundreds or thousands of times
already, and one more time will not increase the accuracy of
the previous answers.
Perl FAQ, part 5:
"How do I change one line in a file/
delete a line in a file/
insert a line in the middle of a file/
append to the beginning of a file?"
: Please reply via e-mail.
That is much too selfish.
Why would you want to hoard the answer like that?
It is much more public-spirited to post the answer so that
others get a chance to see it.
I'm gonna go with the public-spirited approach.
Ask it here, get the answer here.
: Thanks in advance!
Uh huh.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sun, 04 Oct 1998 21:00:44 +0200
From: "Lars Kr. Lundin" <lkl@runge.uni-c.dk>
Subject: return status of a remote shell command
Message-Id: <3617C5DC.41C6@runge.uni-c.dk>
I have a script that I run from perl on a remote machine with
system('rsh remotehost myscipt.pl');
where rsh is the UNIX remote shell command.
I am now interested in the return status of myscript.pl.
system will return the returnvalue of rsh, which is of minor interest.
Can anyone tell my how I can run myscript.pl on a remote (UNIX) machine,
and get the return status of myscript.pl into the local perl process?
A pure perl solution would be very interesting.
Thank you,
Lars.
PS. Please mail of copy of your answer directly to me.
--
M.Sc. Lars Kr. Lundin. | Problems worthy
IMM, Technical University of Denmark. | of attack
Phone (Office) +45 4525 3080, Fax +45 4593 2373. | prove their worth
E-mail: lkl@runge.uni-c.dk | by hitting back
URL: http://www.imm.dtu.dk/~lkl/ | -Piet Hein
------------------------------
Date: Sun, 04 Oct 1998 21:23:55 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: RFC: "Build'n'Play" installation tool
Message-Id: <3617E4F4.692232B3@bbnplanet.com>
Steffen Beyer wrote:
> Moreover this CD-ROM is planned to include a tool for automatically
> installing Perl and most of the modules from CPAN (some subsets have
> also been defined) called "Build'n'Play", or "BnP" for short.
Cool concept, but the name makes me cringe. How about 'Compile 'n' Go'?
e.
As I was lying there with my eyes closed, just after I'd
imagined what it might be like if in fact I never got up
again, I thought of you. I opened my eyes then and got
right up and went back to being happy again.
I'm grateful to you, you see. I wanted to tell you. -R. Carver-
------------------------------
Date: Sun, 4 Oct 1998 11:45:52 -0700
From: "Jay Scherberth" <jayss@sprintmail.com>
Subject: Run cgi scripts ar regular intervals
Message-Id: <6v8flo$i5v$1@fir.prod.itd.earthlink.net>
I have a Perl script that retrieves content from another site and writes it
to a file on my server. I use an #include to populate a table cell on my
home page with this remote content.
Is there a way to get the Perl script to run on it's own (atomically) at
regular intervals, like, once an hour?
Platform is NT IIS4.0.
Thanks in advance,
Jay Scherberth
------------------------------
Date: Sun, 04 Oct 1998 21:43:47 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: Run cgi scripts ar regular intervals
Message-Id: <3617E99C.73668C76@bbnplanet.com>
Jay Scherberth wrote:
> Is there a way to get the Perl script to run on it's own (atomically) at
> regular intervals, like, once an hour?
On NT you can use the 'at' utility. There are also numerous other
cron-like utilities out there for NT. Have a go at http://www.tucows.com
e.
As I was lying there with my eyes closed, just after I'd
imagined what it might be like if in fact I never got up
again, I thought of you. I opened my eyes then and got
right up and went back to being happy again.
I'm grateful to you, you see. I wanted to tell you. -R. Carver-
------------------------------
Date: Sun, 04 Oct 1998 17:08:37 -0500
From: Sam Wang <samwang@freewwweb.com>
Subject: Re: Run cgi scripts ar regular intervals
Message-Id: <3617F1E4.6C72C5FC@freewwweb.com>
anything for a linux-apache platform? i was thinking of using an infinite loop
that slept, but i think cgi's will terminate if i hit stop on my client
browser.
Elaine -HappyFunBall- Ashton wrote:
> Jay Scherberth wrote:
>
> > Is there a way to get the Perl script to run on it's own (atomically) at
> > regular intervals, like, once an hour?
>
> On NT you can use the 'at' utility. There are also numerous other
> cron-like utilities out there for NT. Have a go at http://www.tucows.com
>
> e.
>
> As I was lying there with my eyes closed, just after I'd
> imagined what it might be like if in fact I never got up
> again, I thought of you. I opened my eyes then and got
> right up and went back to being happy again.
> I'm grateful to you, you see. I wanted to tell you. -R. Carver-
------------------------------
Date: Sun, 04 Oct 1998 22:38:48 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: Run cgi scripts ar regular intervals
Message-Id: <3617F681.8F8B7B0E@bbnplanet.com>
Sam Wang wrote:
> anything for a linux-apache platform? i was thinking of using an infinite loop
> that slept, but i think cgi's will terminate if i hit stop on my client
> browser.
Try 'man crontab'. Uh, what are you trying to do here?
e.
As I was lying there with my eyes closed, just after I'd
imagined what it might be like if in fact I never got up
again, I thought of you. I opened my eyes then and got
right up and went back to being happy again.
I'm grateful to you, you see. I wanted to tell you. -R. Carver-
------------------------------
Date: Sun, 04 Oct 1998 18:07:23 +0100
From: Matt Pryor <matt@whiterabbit.co.uk>
To: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Survey Script
Message-Id: <3617AB4B.5079B6B5@whiterabbit.co.uk>
[cc'd to Larry]
Well the url of the script in plain text format is
http://www.whiterabbit.co.uk/review_script.txt - the link to this is
provided with the output of the script though.
Matt
Larry Rosler wrote:
> How about also posting the URL of the CGI program, or put the URL on the
> HTML page, so anyone interested can learn from it?
--
Matt's daily comic strip
Porridge and Fartcakes
http://www.whiterabbit.co.uk/cartoons
------------------------------
Date: 12 Jul 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 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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 3888
**************************************