[18334] in Perl-Users-Digest
Perl-Users Digest, Issue: 502 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Mar 16 09:10:33 2001
Date: Fri, 16 Mar 2001 06:10:18 -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: <984751817-v10-i502@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 16 Mar 2001 Volume: 10 Number: 502
Today's topics:
Re: new user <graham.wood@iona.com>
Re: new user (Philip Lees)
Re: new user <anders.goransson@chello.se>
Re: new user nobull@mail.com
Re: pb with a cgi script <Mathieu.Peltier@netcourrier.com>
Re: Perl 4 <kiwitter@qns.de>
Re: Perl 4 <uri@sysarch.com>
Re: Perl 4 <bart.lateur@skynet.be>
Re: Perl 4 (Tony L. Svanstrom)
problem with file lock that is not removed <svg@wanadoo.nl>
Re: problems with systems calls (Damian James)
Re: Read enum values from a column with perl DBI / Cann (Rafael Garcia-Suarez)
Re: Server run on a cd (Philip Lees)
Spaces in path to perl script (NT) <paul@indigoproductions.be>
subscirbe Newsgroup <stefanm@ciberia.es>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 16 Mar 2001 11:28:08 -0000
From: "Graham Wood" <graham.wood@iona.com>
Subject: Re: new user
Message-Id: <98stum$mod$1@spider.iona.com>
<snipped>
> Global symbol "$in" requires explicit package name at
> C:\Perl\eg\example.pl line
> 20.
> Execution of C:\Perl\eg\example.pl aborted due to compilation errors.
> ----------------
>
> How do I get all these explicit packages names.
>
>
> regards Anders
I suspect that the script contains "use strict" but is not written to use
strict. Use strict will oblige you to give a specific package name for
every variable you use in the script or make it local to the current package
by using "my". The point of this is that it prevents you from inadvertently
reusing a variable name that is already in scope. If you can find "use
strict;" in the script try commenting it out (#use strict;) and see if this
gets rid of all the error messages.
Hope this helps
Graham Wood
------------------------------
Date: Fri, 16 Mar 2001 11:52:24 GMT
From: pjlees@ics.forthcomingevents.gr (Philip Lees)
Subject: Re: new user
Message-Id: <3ab1facd.15857021@news.grnet.gr>
On Fri, 16 Mar 2001 11:02:53 GMT, Anders Goeransson
<anders.goransson@chello.se> wrote:
>I just downloaded perl
>---------------------------
>This is perl, v5.6.0 built for MSWin32-x86-multi-thread
>(with 1 registered patch, see perl -V for more detail)
>
>Copyright 1987-2000, Larry Wall
>
>Binary build 623 provided by ActiveState Tool Corp.
>http://www.ActiveState.com
>Built 16:27:07 Dec 15 2000
>--------------------------
>
>I now try to run a little script (which I've gotten from a friend) and
>it works fine on a machine using MKS tools. On the above perl I get
>the following messages:
>Global symbol "$dir" requires explicit package name at
>C:\Perl\eg\example.pl lin
>e 2.
>How do I get all these explicit packages names.
Somewhere near the start of the script you have the line:
use strict;
This is a GOOD THING.
Perl is warning you that you have not declared the variable whose name
is included in the warning message. You need to declare your variables
explicitly when or before they are used, e.g.:
my $dir;
or
my $dir = 'foo';
perldiag (in the Perl documentation on your hard disk) has
explanations for warnings and error messages.
You could also try adding the line:
use diagnostics;
to get more complete explanations of warnings and error messages.
If you're going to ask more questions here, you're likely to get a
better response if you use a subject line that indicates the nature of
your problem.
I also suggest that you take a look at your Perl documentation - at
least the FAQ - before posting again.
Phil
--
@x=split//,'Just another Perl decoder,';split//,'*'x@x;%i=split/=/,
'AA=a=aa= =1=,';for$i(0..$#x){$_[$i]=chr($=+5);while($_[$i]ne$x[$i])
{$_[$i]=$i{$_[$i]}if$i{++$_[$i]};print@_,"\r";while(rand!=rand){}}}
Ignore coming events if you wish to send me e-mail
------------------------------
Date: Fri, 16 Mar 2001 12:31:09 GMT
From: Anders Goeransson <anders.goransson@chello.se>
Subject: Re: new user
Message-Id: <oj14btocqdkt4r59bcstr23lf92bf8tcse@4ax.com>
On Fri, 16 Mar 2001 11:28:08 -0000, "Graham Wood"
<graham.wood@iona.com> wrote:
><snipped>
>> Global symbol "$in" requires explicit package name at
>> C:\Perl\eg\example.pl line
>> 20.
>> Execution of C:\Perl\eg\example.pl aborted due to compilation errors.
>> ----------------
>>
>> How do I get all these explicit packages names.
>>
>>
>> regards Anders
>I suspect that the script contains "use strict" but is not written to use
>strict. Use strict will oblige you to give a specific package name for
>every variable you use in the script or make it local to the current package
>by using "my". The point of this is that it prevents you from inadvertently
>reusing a variable name that is already in scope. If you can find "use
>strict;" in the script try commenting it out (#use strict;) and see if this
>gets rid of all the error messages.
>
>Hope this helps
>
>Graham Wood
Thanks a million!
It works now. (There were some other fishy things to get rid of
too....)
Anders Goransson
------------------------------
Date: 16 Mar 2001 12:17:15 +0000
From: nobull@mail.com
Subject: Re: new user
Message-Id: <u9g0gdewms.fsf@wcl-l.bham.ac.uk>
Anders Goeransson <anders.goransson@chello.se> writes:
> I just downloaded perl
Then you just downloaded the manual too.
> Binary build 623 provided by ActiveState Tool Corp.
> http://www.ActiveState.com
ActiveState installation places a link to the local copy of the Perl
manual in your Start menu.
> I get the following messages:
> Global symbol "$dir" requires explicit package name at
> How do I get all these explicit packages names.
Perl error messages, their meanings, their most likely causes and how
to fix them are documented in the "perldiag" section of the manual.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Fri, 16 Mar 2001 09:18:14 +0100
From: Mathieu Peltier <Mathieu.Peltier@netcourrier.com>
Subject: Re: pb with a cgi script
Message-Id: <3AB1CC46.B7EDC2F3@netcourrier.com>
nobull@mail.com wrote:
> Can you explain the reasoning by which you concluded that the problem
> you are experiencing was in any way related to the fact that your
> script is being called through the CGI API?
ok, excuse me for this bad post.
--
Mathieu Peltier
------------------------------
Date: Fri, 16 Mar 2001 09:10:46 +0100
From: "Kiwitter@qns.de" <kiwitter@qns.de>
Subject: Re: Perl 4
Message-Id: <98shrh$jep$02$1@news.t-online.com>
hi @ all...
it so that i develop. on my linux system and port. it to system V unix with
perl 4.
bye
--
------------------------------------------
Patrick Kiwitter
QNS Quattro Network Solutions
Werner Hellweg 27
44803 Bochum
Tel.: (0049) +234/9351430
Fax : (0049) +234/353214
http://www.QNS.de
------------------------------------------
"Martien Verbruggen" <mgjv@tradingpost.com.au> schrieb im Newsbeitrag
news:slrn9b2r6e.nts.mgjv@verbruggen.comdyn.com.au...
> [Please, in the future, put your reply _after_ the suitably trimmed
> text you reply to. It's the generally accepted convention on this
> group, and Usenet in general.]
>
> On Thu, 15 Mar 2001 14:59:40 +0100,
> Kiwitter@qns.de <kiwitter@qns.de> wrote:
> > "Martien Verbruggen" <mgjv@tradingpost.com.au> schrieb im Newsbeitrag
> > news:slrn9b1439.kjn.mgjv@martien.heliotrope.home...
> >> On Thu, 15 Mar 2001 10:33:44 +0100,
> >> Kiwitter@qns.de <kiwitter@qns.de> wrote:
> >> >
> >> > where can i get Perl 4 for Linux ? can some one tell me the URL
> >> > of an server wherer i can download perl 4 ?
> >>
> >> Anyway, you can download the sources from any CPAN mirror,
> >
> > no my os is System V unix :-)
>
> Euhmm.. And you're looking for a linux binary?
>
> Anyway, your question prompted me to try to get the hints for perl4 on
> Linux correct again yesterday. unfortunately there was more needed
> than just a few hints. I've been able to compile it, and get it to
> pass all the tests (had to change the tests that used a glob, because
> of ordering problems). Still have to make sure socket-related stuff
> works.
>
> Is there any interest in this stuff, purely for hstorical reasons?
> Should I dump it on CPAN as a diff?
>
> Martien
> --
> Martien Verbruggen |
> Interactive Media Division | I'm just very selective about what I
> Commercial Dynamics Pty. Ltd. | accept as reality - Calvin
> NSW, Australia |
------------------------------
Date: Fri, 16 Mar 2001 09:06:39 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Perl 4
Message-Id: <x7r8zy6q1s.fsf@home.sysarch.com>
>>>>> "Kd" == Kiwitter@qns de <kiwitter@qns.de> writes:
Kd> hi @ all... it so that i develop. on my linux system and port. it
Kd> to system V unix with perl 4.
WHY? for curiosity sake maybe. but for real development? perl4 is buggy
and unsupported. even moronzilla uses perl5 now.
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: Fri, 16 Mar 2001 10:03:01 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Perl 4
Message-Id: <d8p3btgt70eb3bjak7hnu5mrank6ig34fg@4ax.com>
Uri Guttman wrote:
>perl4 is buggy
>and unsupported. even moronzilla uses perl5 now.
And what does that prove? ;-)
--
Bart.
------------------------------
Date: Fri, 16 Mar 2001 12:56:33 GMT
From: tony@svanstrom.com (Tony L. Svanstrom)
Subject: Re: Perl 4
Message-Id: <1eqd7zc.1sfligy1yzrrrkN%tony@svanstrom.com>
Bart Lateur <bart.lateur@skynet.be> wrote:
> Uri Guttman wrote:
>
> >perl4 is buggy
> >and unsupported. even moronzilla uses perl5 now.
>
> And what does that prove? ;-)
That even trolls and stupid people can learn, it just takes a lil
longer. =)
/Tony
------------------------------
Date: Fri, 16 Mar 2001 11:27:59 +0100
From: Sander van Gennip <svg@wanadoo.nl>
Subject: problem with file lock that is not removed
Message-Id: <16q3btcboladlfpepahd3lgmhuhevubcas@4ax.com>
Hi,
I am using the following scheme in updating a file:
===================
open(DATA,"+<$file");
flock(DATA,LOCK_EX);
@log = <DATA>;
... some code that modifies @log ...
seek DATA,0,0;
truncate DATA,0;
foreach $line (@log) {
print(DATA $line);
}
flock(DATA,LOCK_UN);
close(DATA);
============
The problem is the following: once in about 200 script calls the file
seems to remain locked, and any script calls following it wait forever
for the lock to be granted. If I download, remove and upload the file
everything works again.
Anyone know what might be causing this and how it can be solved?
Any thoughts much appreciated,
Sander van Gennip
------------------------------
Date: 16 Mar 2001 08:56:25 GMT
From: damian@qimr.edu.au (Damian James)
Subject: Re: problems with systems calls
Message-Id: <slrn9b3l9f.r5p.damian@puma.qimr.edu.au>
Duncan Hall chose Fri, 16 Mar 2001 18:20:08 +1100 to say this:
>Can anyone tell me why when run from a browser this script does not
>finish displaying the page until the download of the jre.zip file is
>complete?
>
>...
>
>#!/usr/bin/perl
>
>print "Content-type: text/html\n\n";
>print "just downloading jre.zip first - its 15 meg in size\n";
>
>`wget http://192.168.100.5/jre.zip -O /var/www/html/downloads/jre.zip`;
>
Buffering. Add a $| = 1 in there before the print statements, and check
out:
perldoc perlvar
scanning for $|.
You might also want to have a look at:
http://perl.plover.com/FAQs/Buffering.html
You should also be using 'strict' and the -w switch :-).
HTH
Cheers,
Damian
--
@;=0..23;@;{@;}=split//,<DATA>;while(@;){for($;=@;;--$;;){next if($:=rand($;
+1))==0+$;;@;[$;,$:]=@;[$:,$;]}print map{$;{$_}}(@| ,@;);push@|,shift@;if$;[
0]==@|;$|=1;select$&,$&,$&,1/80;print"\b"x(@;+@|)}print"\n"__END__
Just another Perl Hacker
------------------------------
Date: Fri, 16 Mar 2001 09:01:05 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: Read enum values from a column with perl DBI / Cannot understand this match thing or why it is not working
Message-Id: <slrn9b3lig.ifd.rgarciasuarez@rafael.kazibao.net>
Mark Worsdall wrote in comp.lang.perl.misc:
> Trying to read enum values from a specifed column but it does not work
> cos I do not understand the /^enum part.
>
> Any help?
>
> my $dbh = DBI->connect( "dbi:$datasrc", "$sqlUser", "$sqlPassword") or
> die DBI->errstr;
> my $sth = $dbh->prepare("SELECT $column FROM $sqlTable");
> $sth->execute;
Lack of error handling.
> #@row = $sth->fetchrow_array;
You're aware that the above line is a comment, aren't you?
> /^enum\((.*)\)/ and do {
The // match is done implicitely against the $_ variable here. And it's
variable has not been used in the code you've shown. There's something
missing here. This should apparently be some enumerated values. Perhaps
do you want something like :
$row[0] =~ /^enum\((.*)\)/ and do { ... }
> my $values = $1;
> $values =~ s/^'//;
> $values =~ s/'$//;
> my @values = split /','/, $values;
> # now print your dropdown with @values
> foreach (@values) {
> print $_ . "<br>";
> }
> };
------------------------------
Date: Fri, 16 Mar 2001 08:31:03 GMT
From: pjlees@ics.forthcomingevents.gr (Philip Lees)
Subject: Re: Server run on a cd
Message-Id: <3ab1cf00.4644338@news.grnet.gr>
On Fri, 16 Mar 2001 00:45:00 -0500, jtjohnston
<jtjohnston@courrier.usherb.ca> wrote:
>I have a question. Have you ever, or is it possible to run a very basic
>copy of a server from a CD rom?
http://www.indigostar.com/
'MicroWeb allows you to create a working web site on a CD-ROM. '
I don't know if this is what you are looking for.
Phil
--
@x=split//,'Just another Perl decoder,';split//,'*'x@x;%i=split/=/,
'AA=a=aa= =1=,';for$i(0..$#x){$_[$i]=chr($=+5);while($_[$i]ne$x[$i])
{$_[$i]=$i{$_[$i]}if$i{++$_[$i]};print@_,"\r";while(rand!=rand){}}}
Ignore coming events if you wish to send me e-mail
------------------------------
Date: Fri, 16 Mar 2001 13:30:45 GMT
From: Paul Goris <paul@indigoproductions.be>
Subject: Spaces in path to perl script (NT)
Message-Id: <B6D7D415.ABDF%paul@indigoproductions.be>
We have to run a Perl script from within a directory that contains spaces in
the path to it. Everytime we try to acces the script, an error occurs saying
the script can't be found.
We run MIIS 4.0 on an NT machine.
The path to the script is someting like:
D:\Web\Directory with Spaces\Folder\thescript.cgi
The error produced is:
#
CGI Error
The specified CGI application misbehaved by not returning a complete set of
HTTP headers. The headers it did return are:
Can't open perl script "D:\Web\Directory": No such file or directory
#
Apparently the path to the script is cut off at the first space so the
script can't be found...
All other Perl scripts on our server work fine, just the ones with spaces in
the path will generate this error.
The obvious solution would be to eliminate the spaces from the directory
names, but unfortunately that is not possible.
All my thanks for any help on this!
Paul Goris
------------------------------
Date: Fri, 16 Mar 2001 14:47:04 +0100
From: "Stefan" <stefanm@ciberia.es>
Subject: subscirbe Newsgroup
Message-Id: <984750429.910778@cache2-serv>
------------------------------
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 502
**************************************