[17216] in Perl-Users-Digest
Perl-Users Digest, Issue: 4638 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Oct 17 03:05:33 2000
Date: Tue, 17 Oct 2000 00:05:14 -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: <971766314-v9-i4638@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 17 Oct 2000 Volume: 9 Number: 4638
Today's topics:
Re: CGI script problem on Win <elephant@squirrelgroup.com>
Re: Compiling Locally <was Why these 2 simple errors?> (BUCK NAKED1)
Re: Compiling Locally <was Why these 2 simple errors?> <uri@sysarch.com>
Re: Executing PERL scripts from Linux <harrisr@bignet.net>
Re: Executing PERL scripts from Linux (Gwyn Judd)
Re: Executing PERL scripts from Linux <president@webticker.com>
Re: Help about simple patten matching <mbudash@sonic.net>
Re: Help! Internal error occured calling glob(). <bwalton@rochester.rr.com>
Re: mod_perl variables <no2spam_sloppysquirrel@hotmail.com>
Net::DNS host info <peter.sundstrom@eds.com>
Re: newbie String problem <hhkohls@gmx.de>
Passwd Help?? <r.fraser@student.murdoch.edu.au>
Perl to .exe Converter <Christian.Oehring@de.bosch.com>
Re: Perl to .exe Converter <R.Matzke@haushahn-as.de>
Re: question <anmcguire@my-deja.com>
Re: redirecting stderr in an open statement on WIN32 <elephant@squirrelgroup.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 17 Oct 2000 16:01:16 +1000
From: jason <elephant@squirrelgroup.com>
Subject: Re: CGI script problem on Win
Message-Id: <MPG.145696395b97fa59989824@localhost>
Mike wrote ..
>I am trying to run guestbook CGI script and File upload script on my Web
>server on WIn 98.
>There is no response to the action. I tried perl script.cgi and got the
>following error message :
>"offline mode: enter name=value pairs on standard input).
>Anybody knows what does it mean ?
your CGI module thinks that it's in debug mode - this usually only
happens when you run a script that uses the CGI module from the command
line .. assuming that you're running this program via a web server (like
Microsoft's PWS or IIS) then the problem might be an old CGI module -
grab the latest version of the CGI.pm and see if that helps .. otherwise
- report back
you get the latest CGI from CPAN - http://www.cpan.org/
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: Tue, 17 Oct 2000 01:07:40 -0500 (CDT)
From: dennis100@webtv.net (BUCK NAKED1)
Subject: Re: Compiling Locally <was Why these 2 simple errors?>
Message-Id: <4072-39EBECAC-85@storefull-243.iap.bryant.webtv.net>
What does "cc" or "cc compiler" mean? C compiler? Are you saying that
CPAN.pm doesn't allow for a local installation? or are you saying that
CPAN.pm will allow a local install if I'm able to compile?
BTW, what does "manifying" mean?
--Dennis
------------------------------
Date: Tue, 17 Oct 2000 06:24:41 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Compiling Locally <was Why these 2 simple errors?>
Message-Id: <x74s2ct26u.fsf@home.sysarch.com>
>>>>> "BN" == BUCK NAKED1 <dennis100@webtv.net> writes:
BN> What does "cc" or "cc compiler" mean? C compiler? Are you saying that
BN> CPAN.pm doesn't allow for a local installation? or are you saying that
BN> CPAN.pm will allow a local install if I'm able to compile?
cc is the standard name for the c compiler. if the module had XS code it
needs to have it compiled to be built and installed. pure perl modules
don't need to have a compiler. cpan.pm can install either type.
BN> BTW, what does "manifying" mean?
converting the pod text of modules to unix man format.
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: Tue, 17 Oct 2000 00:12:33 -0400
From: "Randy Harris" <harrisr@bignet.net>
Subject: Re: Executing PERL scripts from Linux
Message-Id: <sunkcdgpddg006@corp.supernews.com>
Julian Cook/Sherab Gyatso <president@webticker.com> wrote in message
news:39EBA562.2C134C20@webticker.com...
> Hello again folks.
> I am running Red Hat Linux 6.1 and Perl 5.6
> My perl is located at /usr/local/bin/perl
>
> Everytime I have created a PERL script,
> I have always tested it with
> "perl testprogram.cgi"
> (where the script name is testprogram.cgi obviously)
>
> I start every script with
> #!/usr/local/bin/perl/
>
> I "chmod u+x testprogram.cgi"
> and when I try to run it straight from the command
> line by typing "testprogram.cgi", I get
> "bash: testprogram.cgi: command not found"
>
Julian, take note of the earlier post by Garry Williams. The error that
you are receiving is from the bash command processor. It's telling you
that it cannot find testprogram.cgi. This almost certainly means that
it is simply not in your search path. The error is not the result of
not being executable. (you would get a different error msg)
> When I do test with "perl testprogram.cgi"
> it works fine.
perl, it is finding, because it is in your PATH.
>
> I thought that as long as a script was executable
> and the first line contained the hash bang, then
> it would run. Then again, I am not a Linux
> pro, admittedly.
>
This is generally correct, but only if the command processor can find
it.
Try: ./testprogram.cgi
> Does anyone have any idea on how to correct this so
> it runs from the command line when chmod u+x?
> I am setting this script up as a cron job and I am
> referencing it by the script name.
>
When you set it up as a cron, you will want to supply the full path:
/cgi/scripts/testprogram.cgi (or wherever you have it)
Regards,
Randy Harris
> Many thanks in advance.
>
>
> Julian Cook
> president_at_webticker_dot_com
> -------------------------------
> Flames go to /dev/null
------------------------------
Date: Tue, 17 Oct 2000 04:29:05 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: Executing PERL scripts from Linux
Message-Id: <slrn8unlca.f7l.tjla@thislove.dyndns.org>
I was shocked! How could Julian Cook/Sherab Gyatso <president@webticker.com>
say such a terrible thing:
>
>> Excellent advice, however I think the OP's problem was that his shebang
>> line refers to the directory '/usr/local/bin/perl/' rather than the
>> binary file '/usr/local/bin/perl'.
>
>Thanks Gwyn,
>but "/usr/local/bin/perl/" was a typo in my post.
>They do start with "/usr/local/bin/perl" and they still
>don't execute.
Well in that case is perl actually in the directory '/usr/local/bin'? Is
the script in your $PATH?
--
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
Can't act. Slightly bald. Also dances.
-- RKO executive, reacting to Fred Astaire's screen test.
Cerf/Navasky, "The Experts Speak"
------------------------------
Date: Tue, 17 Oct 2000 04:39:04 GMT
From: Julian Cook/Sherab Gyatso <president@webticker.com>
Subject: Re: Executing PERL scripts from Linux
Message-Id: <39EBD804.7F07EDCC@webticker.com>
Hi Gwyn,
Thanks to Randy Harris and Garry Williams for clearing this up.
The script itself was in /home/scripts and perl is in /usr/local/bin/.
When in the /home/scripts directory "perl xxx.cgi" works because perl
** IS ** in the path. If you make the script "xxx.cgi" executable, it
still
flops because /home/scripts is not in the path. I added /home/scripts
to
the path and voila! It works.
<LOVEFEST>
But the really kool thing is that I posted this only a couple of hours
ago and so many great people came forward to help me out. Proving yet
again
how wonderful this comp.lang.perl.misc community is.
</LOVEFEST>
Julian Cook
Gwyn Judd wrote:
>
> I was shocked! How could Julian Cook/Sherab Gyatso <president@webticker.com>
> say such a terrible thing:
> >
> >> Excellent advice, however I think the OP's problem was that his shebang
> >> line refers to the directory '/usr/local/bin/perl/' rather than the
> >> binary file '/usr/local/bin/perl'.
> >
> >Thanks Gwyn,
> >but "/usr/local/bin/perl/" was a typo in my post.
> >They do start with "/usr/local/bin/perl" and they still
> >don't execute.
>
> Well in that case is perl actually in the directory '/usr/local/bin'? Is
> the script in your $PATH?
>
> --
> Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
> Can't act. Slightly bald. Also dances.
> -- RKO executive, reacting to Fred Astaire's screen test.
> Cerf/Navasky, "The Experts Speak"
-
------------------------------
Date: Mon, 16 Oct 2000 21:20:19 -0700
From: Michael Budash <mbudash@sonic.net>
Subject: Re: Help about simple patten matching
Message-Id: <mbudash-1E67CA.21201916102000@news.pacbell.net>
In article <8sgi7u$n97$1@horn.hk.diyixian.com>, "Regent Linus"
<wstsoi@hongkong.com> wrote:
> Hi I have a problem about extracting email address.
>
> -------------------------------------------------------------------------
> $_=q~
> Regent Linus <regent@regent.com> (Regent's Lab.)
> ~;
>
> s/.*?(\w+\@.*?(?:\..*)+)\W.*?/$1/os;
> print;
>
> -------------------------------------------------------------------------
>
> It returns :
> regent@regent.com> (Regent's Lab.)
>
> why the non-word character \W can't match '>'?
> Could anybody amend my code for me so that I could get
> regent@regent.com?
>
> Thanks
>
>
>
s/^.*?(\w+\@\w+\.\w+)\W.*$/$1/so;
hth-
--
Michael Budash ~~~~~~~~~~ mbudash@sonic.net
------------------------------
Date: Tue, 17 Oct 2000 04:29:05 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: Help! Internal error occured calling glob().
Message-Id: <39EBD58C.3AF274AB@rochester.rr.com>
Liang Tang wrote:
>
> Dear Perl experts,
>
> My program printed out an error message saying :"internal error: glob
> failed at myperl.pl line 1688, <_GEN_9> chunk 2".
> That line is just:
> @allfiles = <*.log> ;
>
> The same error is reported if the line is: @allfiles = glob ("*.log");
>
> However, the program seems to be working well.
>
> What does this error message means? How can I avoid it?
...
> Liang Tang
I'm not sure, since your don't state your platform and OS. Does an:
ls *.log
or
dir *.log
in that directory work from your OS's prompt? It may be that there is
an I/O error on disk from attempting to list that directory? Or maybe
you don't have permission to list that directory? Or, if your program
is running as a CGI script, perhaps your web server doesn't have
permission -- or perhaps you aren't attempting to list the directory you
think your are listing, as the CGI script will run with some
server-assigned directory as the current directory.
--
Bob Walton
--
Bob Walton
------------------------------
Date: 17 Oct 2000 04:39:53 GMT
From: "Sloppy" <no2spam_sloppysquirrel@hotmail.com>
Subject: Re: mod_perl variables
Message-Id: <8sgl6p$5h@dispatch.concentric.net>
<nobull@mail.com> wrote in message
news:u9d7h723p5.fsf@wcl-l.bham.ac.uk...
> apacheproblems@my-deja.com writes:
> [1] By here I mean comp.lang.perl.misc. There is no such group as
> comp.lang.perl.
Hmm.. this sounds to me like the apple exists but not the apple tree ;-)
I'm subscribed to the latter but not the former...
is the "misc" group a better choice for reading?
--
Sloppy
Be good or be good at it!
------------------------------
Date: Tue, 17 Oct 2000 18:07:27 +1300
From: "Peter Sundstrom" <peter.sundstrom@eds.com>
Subject: Net::DNS host info
Message-Id: <8sgn1c$9p2$1@hermes.nz.eds.com>
I'm using Net::DNS to list a zone and I want to return the data without the
SOA TTL field.
The code snippet I'm using is:
foreach my $rr (@zone) {
next if ($rr->type !~ /\bA|CNAME\b/);
my $name = $rr->name;
my $class = $rr->class;
my $type = $rr->type;
if ($rr->type eq 'CNAME') {
$data=$rr->cname;
}
elsif ($rr->type eq 'MX') {
$data=$rr->mx;
}
else {
$data=$rr->address;
}
push(@hosts,"$name $class $type $data\n");
}
return @hosts;
This seems like a lot of overkill to do what I want to achieve. The other
way I though of doing it was:
foreach my $rr (@zone) {
next if ($rr->type !~ /\bA|CNAME\b/);
my @data=split(' ',$rr->string);
push(@hosts,"$data[0] $data[2] $data[3] $data[4]\n");
}
return @hosts;
That still seems a little messy. Suggestions for better ways to do it?
------------------------------
Date: Tue, 17 Oct 2000 08:43:33 +0200
From: Hans-Helmut Kohls <hhkohls@gmx.de>
Subject: Re: newbie String problem
Message-Id: <39EBF514.F2CF6CCD@gmx.de>
thank you all, for fast and great help.
-hans
------------------------------
Date: Tue, 17 Oct 2000 13:27:52 +0800
From: Fraser <r.fraser@student.murdoch.edu.au>
Subject: Passwd Help??
Message-Id: <39EBE358.F21C4D7D@student.murdoch.edu.au>
In Perl, how do you use system information such as "passwd" and
"getpwnam" and print the info to the screen (stdout)?
please
help!!
------------------------------
Date: Tue, 17 Oct 2000 08:13:09 +0200
From: Christian Oehring <Christian.Oehring@de.bosch.com>
Subject: Perl to .exe Converter
Message-Id: <8sgqmv$194$1@proxy.fe.internet.bosch.de>
Hi,
Can anybody tell me if a perl-to-exe converter exists ??? If such a
converter exists, can anybody tell me the URL to these tool ??
Thanx an greetings from Stuttgart / Germany
------------------------------
Date: Tue, 17 Oct 2000 08:46:33 +0200
From: "Rainer Matzke" <R.Matzke@haushahn-as.de>
Subject: Re: Perl to .exe Converter
Message-Id: <39ebf4f2$0$21907@businessnews.de.uu.net>
http://www.perl2exe.com
------------------------------
Date: Tue, 17 Oct 2000 06:06:50 GMT
From: Andrew N McGuire <anmcguire@my-deja.com>
Subject: Re: question
Message-Id: <8sgq9n$u6p$1@nnrp1.deja.com>
In article <slrn8un2uo.a0g.mgjv@verbruggen.comdyn.com.au>,
mgjv@tradingpost.com.au wrote:
> On Mon, 16 Oct 2000 15:08:42 -0500,
> Andrew N. McGuire <anmcguire@ce.mediaone.net> wrote:
> > On 16 Oct 2000, Joe Schaefer quoth:
> > JS> 1 while <IN>;
> > JS>
> > JS> is reevaluated each time action is called- my mistake!
> > JS> ( I think "}" is closing the file for you.)
> > JS> Your code still doesn't seem to work, though- if I use
> > JS> this:
> >
> > Actually it is open() that closes the file file by implicitly
calling
> > close() for every open() after the first. ( Thats a mouthful ).
>
> This prompted me to search for the bit of the documentation that
> states that filehandles are implicitly closed when they go out of
> scope. It's hard to find.
>
> # man perldelta
> [snip]
> Implicitly closed filehandles are safer
>
> Sometimes implicitly closed filehandles (as when they are
> localized, and Perl automatically closes them on exiting
> the scope) could inadvertently set $? or $!. This has
> been corrected.
> [snip]
>
> It's implicit (sic) from this statement that an implicit close happens
> on a localised file handle.
[ snip ]
I always kind of "felt" that this was the correct behaviour, but
never saw that reference in the documentation. Perhaps I did,
and I did not recognize the implications of it. Either way,
thank you for the correction. :-)
anm
--
$ENV{PAGER} = 'perl -wpe0';
system perldoc => '-t', '-F', $0;
=head1 Just Another Perl Hacker
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 17 Oct 2000 15:57:45 +1000
From: jason <elephant@squirrelgroup.com>
Subject: Re: redirecting stderr in an open statement on WIN32
Message-Id: <MPG.14569566fbe598cd989823@localhost>
Christopher Hahn wrote ..
>I am writing a script on Windows 2000, which might also need
>to run on NT 4.0.
>
>I am using a pipe to get the output of a system executable.
>The program that I am running is writing to stderr as well as stdout.
>(stupid, as the message is "Nothing to do" which is not much of an error)
>
>I am wanting to use:
>
>open("command 2>&1 |") or die "Could not open pipe:$!\n";
>
>but this does not seem to working, as I get lines from the pipe, I write
>them to a log. But the output sent to stderr still shows up at the console.
>
>Any ideas appreciated, including pointers to any FAQs that I may
>have missed in my search.
NTs cmd.exe supports the file descriptor redirection (although you're
missing the first argument to 'open')
can't test on Win2k - sorry (but Microsoft would have been stupid to
change it)
--
jason -- elephant@squirrelgroup.com --
------------------------------
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 V9 Issue 4638
**************************************