[16364] in Perl-Users-Digest
Perl-Users Digest, Issue: 3776 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jul 22 14:05:23 2000
Date: Sat, 22 Jul 2000 11:05:10 -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: <964289110-v9-i3776@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sat, 22 Jul 2000 Volume: 9 Number: 3776
Today's topics:
Re: alt.perl ?? <gellyfish@gellyfish.com>
CGI.pm Cookies and images together <Connected@btinternet.com>
Re: CGI.pm List <gellyfish@gellyfish.com>
Re: Difference between a .cgi file and a .pl file? <turnere@cc.wwu.edu>
Re: Free Programmer <charlie@charlie.com>
Re: Free Programmer joel_ricker@my-deja.com
Re: How to detect when an output file is removed (Colin Keith)
How to enable Server Side Include on Apache ? <whofer@access.ch>
IO:Socket and Timeout => "5" ? <coy@coystoys.com>
Re: Loop with regexps aqutiv@my-deja.com
Re: Loop with regexps <eric.selin@pp.inet.fi>
Re: Loop with regexps aqutiv@my-deja.com
Re: NFS Client in perl? <gellyfish@gellyfish.com>
OK, how do I put a variable in a regexp? <eric.selin@pp.inet.fi>
Re: OK, how do I put a variable in a regexp? <turnere0@my-deja.com>
Re: OK, how do I put a variable in a regexp? <godzilla@stomp.stomp.tokyo>
Re: OK, how do I put a variable in a regexp? <mn@chello.at>
Re: perl-5.6.0: Bug with "not" operator? (Keith Calvert Ivey)
Perl: nested closure crashes on Linux <occitan@esperanto.org>
Re: Query String Golf <tony_curtis32@yahoo.com>
Questions on GD PERL module... <rwilliamson@uno.gers.com>
Re: Removing (not extracting!) URL's from a string?? <gellyfish@gellyfish.com>
Re: uninitialized variable value? (Keith Calvert Ivey)
Re: uninitialized variable value? (Abigail)
Re: UPD-packet problem.. (Clinton A. Pierce)
Where can I download PERL 5.005_02 from? <rwilliamson@uno.gers.com>
Where to save socket descriptor? <daneel@tux.org>
Re: Where to save socket descriptor? (Randal L. Schwartz)
Re: Why doesn't ActivePerl 5.6.0 change my PATH? <gellyfish@gellyfish.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 22 Jul 2000 11:06:47 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: alt.perl ??
Message-Id: <8lbrnn$rbu$1@orpheus.gellyfish.com>
On Thu, 20 Jul 2000 22:45:40 -0400 Wally wrote:
> Is there such a newsgroup as alt. perl ?
> It doesn't seem to come up in any searches, yet
> I've heard people mention it.
>
It does exist but its a pointless waste of space. Many people filter
posts that are cross-posted there.
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: Sat, 22 Jul 2000 15:08:30 +0100
From: Jerry Pank <Connected@btinternet.com>
Subject: CGI.pm Cookies and images together
Message-Id: <sdYM7WAerae5EwoN@btinternet.com>
I am trying to use CGI.pm to return an image *and* drop a cookie at the
same time and am nearly there, but not quite!
eg:
Calling document:
..<body><img src='cookie.pl height='10' width='20'>..
CGI part of script
sub return_img {
my $image = &get_image;
my $cookie = &test_data;
print header('-type' => 'image/gif',
'-cookie' => $cookie),
$image;
}
The above returns the image, but only drops the cookie once the image
source is viewed from the browser. Not quite what I want!
Any suggestions?
-- j :wq
------------------------------
Date: 22 Jul 2000 19:41:57 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: CGI.pm List
Message-Id: <8lcptl$si1$1@orpheus.gellyfish.com>
On 21 Jul 2000 16:57:47 GMT Robert Goff wrote:
> Is there a mailing list for the CGI.pm module? Or should I ask the
> question here?
>
> Is CGI.pm being maintained? By whom? The docs indicate that Mr. Stein
> hasn't updated it for a while.
>
I think the 1998 date in the documentation possibly relates to the time
when the module was placed in the distribution but I cant be sure of this
- however the module is now at version 2.68 and the version that came
with the 5.6.0 distribution was 2.56 or something like that - It is
perhaps one of the most actively updated, as well it might be, as the CGI
sphere is one that is coninuously beset by new security alerts.
If you have a *patch* that you might want to submit then I would suggest
that you contact the author directly, however if you simply have some
difficulty with using the module then I guess you might want to ask here,
in comp.lang.perl.modules, or comp.infosystems.wwww.authoring.cgi
depending on where your problem lies. Things you might consider as
bugs are more than likely differences in the behaviour you expect than
the documentation .....
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: Sat, 22 Jul 2000 17:33:47 GMT
From: turnere <turnere@cc.wwu.edu>
Subject: Re: Difference between a .cgi file and a .pl file?
Message-Id: <8lcltr$fig$1@nnrp1.deja.com>
In article <3bRhQ9$V1m@openbazaar.net>,
vek@pharmnl.ohout.pharmapartners.nl.bbs@openbazaar.net (Villy Kruse)
wrote:
> On 17 Jul 2000 10:16:23 EDT, Abigail <abigail@delanet.com> wrote:
> >DS (snakeman@kc.rr.com) wrote on MMDXI September MCMXCIII in
> ><URL:news:vjmc5.94$L5.2310@typhoon.kc.rr.com>:
> >][ What is the diference betweeen a .pl file and a .cgi file?
> >
> >The name.
> >
> >][ Can I convert a .pl to a .cgi?
> >
> >Sure. Rename the file.
> >
> >
> >
>
> Correct.
>
> In some systems the extensions are magic, so a perl script is
recognized
> as such only based on the suffix.
>
> On unix systems in general the suffix on executables is not used for
any
> purpuse; the '#!' line does that. And if you install CGI programs in
> a dedicated cig-bin directory, the web server doesn't care either.
>
> Villy
>
What if the Apache conf file has this directive?:
AddHandler cgi-script .pl
If you change to .cgi your scripts may not work properly.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sat, 22 Jul 2000 11:19:08 -0500
From: "Charlie" <charlie@charlie.com>
Subject: Re: Free Programmer
Message-Id: <3979c94d$0$10398$726baab@news.execpc.com>
Looking for unpaid jobs? Try:
http://cgi.resourceindex.com/Jobs/Unpaid/
<joejava@dragoncat.net> wrote in message news:8lb21k$e0l$1@nnrp1.deja.com...
> When do you ever get anything free? Well I have a strong HTML
> background but have been learning Perl and I'm looking for real world
> projects to get involved in to expand my knowledge so I can get
> better.
>
> I'm new to Perl but have a very analytical mind and am quick to learn
> and adapt to new ideas.
>
> So if you need something done and willing to work with me on time and
> other possible constraints for free let me know.
>
> Thanks
> Joel
>
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
------------------------------
Date: Sat, 22 Jul 2000 17:31:28 GMT
From: joel_ricker@my-deja.com
Subject: Re: Free Programmer
Message-Id: <8lclph$fhr$1@nnrp1.deja.com>
In article <3979c94d$0$10398$726baab@news.execpc.com>,
"Charlie" <charlie@charlie.com> wrote:
> Looking for unpaid jobs? Try:
> http://cgi.resourceindex.com/Jobs/Unpaid/
I did. Also volunteered for those listed.
Joel
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sat, 22 Jul 2000 17:40:20 GMT
From: ckeith@clara.net (Colin Keith)
Subject: Re: How to detect when an output file is removed
Message-Id: <80le5.1$DT4.1097446@nnrp2.clara.net>
In article <8lanb7$71v$1@nnrp1.deja.com>, timhood@bigfoot.com wrote:
>I have a process that writes output to a log file. It seems though that
>if someone removes the logfile after the program redirects the output
>that all future output goes to nowhere-land.
Okay, this is where I make a fool out of myself, but the general idea is:
This isn't a 'problem' as such, it is.. how it works. You see writing to
files actually uses file descriptors (/handles), not file names. The
filename is just used as an index for things like the access permissions and
where to find the start of the file in the file system. As such you can
delete the entry from the directory structure since it is a separate entity
from the file you're actually writing to. The deletion varies, but you'll
often find the entry is still there, just marked as unused. ("cat ." on
unix, or think about 'Undelete' programs on win32)
When you close the file handle your data is no longer accessible (as
a file at least) because their is nothing to say where the file
starts. Though off topic, I'm sure someone can point out ways of pulling
data from the disk still. (With magnets and a steady hand if you're a
true guru :-) If you've ever looked at CGI.pm, you'll see that the 'secure'
option for uploaded files opens a filehandle and immediately unlinks the
filename. This is 'secure' because nothing else can find the start of the
file, but your program still has a handle open to it.
Still, onto the perl. The way to prevent this from happening is to open your
file and immediately lock it. If you can't lock it, you fail to continue.
Once locked the file is not removable by anyone else, problem solved.
perldoc -q lock
and read the section on "=head2 I still don't get locking. I just want to
increment the number in the file. How can I do this?"
If you want the file to exist but you don't want to lock it for some weird
reason, you could write it to a new file just before your program exits by
rewinding to the top of the file:
seek(FH, 0, 0) || die "Can't seek to the beginning of the file - $!";
Then working your way through it again:
while(read(FH, $buf, 1024)){
print NFH $buf;
}
Where NFH is a newly opened file handle.
Two points
1. You must write to FH unbuffered. Perl flushes the buffers the last time
on closing the FH. But when we close it we'll lose it, so you have to make
sure nothing is still in the output buffer for FH when rereading it.
2. You have to open FH read/write. This caught me for ages in the script I
wrote to reassure myself I wasn't talking rubbish :)
Thus:
#!/usr/bin/perl -w
use strict;
die "open x failed - $!" if(!open(FH, "+>/tmp/x"));
select((select(FH), $|=1)[0]); # since buffers only flushed on closing
print FH "blah blah blah ... ";
sleep(5); # You have 5 secs on the clock, rm away! :)
print FH "blah blah blah ... "; # more data to log
# I have ended, quick, copy me to my final destination
die "failed seek - $!" if(!seek(FH, 0, 0));
die "open x2 failed - $!" if(!open(NFH, ">/tmp/x2"));
my($buf);
print "read/writing\n";
while(read(FH, $buf, 5)){
print "read.. \"$buf\"\n";
print NFH $buf;
}
I guess you could even dump this into &DESTROY, but that's
probably bad.
But flocking is the better way.
Or chfn -s "/nologin" <file_removers_username> :)
Col.
---
Colin Keith
Systems Administrator
Network Operations Team
ClaraNET (UK) Ltd. NOC
------------------------------
Date: Sat, 22 Jul 2000 19:49:38 +0100
From: "Werner Hofer" <whofer@access.ch>
Subject: How to enable Server Side Include on Apache ?
Message-Id: <8lcmor$ea4$1@pacifica.access.ch>
Hi
i have a Linux ( S.u.S.e 6.0 ) with Apache Server 1.3
From a workstation i would like to execute a Perl Script on the Apache
Server with
Server Side Include ( <!--#exec CGI='./cgi-bin/loadguestbook.pl'--> ). But
it doesn't
work.
Now my question: How can i enable Server Side Include (SSI) on the Appache
Webserver ?
Thanks a lot for your help in advance
Werner
------------------------------
Date: Sat, 22 Jul 2000 17:35:20 GMT
From: "Coy" <coy@coystoys.com>
Subject: IO:Socket and Timeout => "5" ?
Message-Id: <sXke5.7628$Mt.80592@nnrp1.ptd.net>
(yes this is a repost, since noone replied to the last )
( one and I need to get this code done in one week )
IO:Socket is used to see that a machine is running
its services like it should.
Now, I noticed at times, the program would hang
in wait (for something)...
So, i checked the service by hand (the one it hung on)
by telnet 192.168.123.1 <port>
Trying 192.168.123.1....
(it just hangs here)
Now, in my code I have :
: foreach $port (@ports) {
: $socket = IO::Socket::INET->new(
: PeerAddr => $host,
: PeerPort => $port,
: Proto => "tcp",
: Timeout => "5",
: Type => SOCK_STREAM)
: or print "$host: No service on port: $port\n";
:
: if ($socket) {
: close($socket);
: print "Service on port: $port\n"
: }
: }
Isn't Timeout suppose to kill the socket if it doesn't connect?
The program just hangs in place forever like the telnet session did.
What am I doing wrong ?
TIA
-Coy
------------------------------
Date: Sat, 22 Jul 2000 15:07:33 GMT
From: aqutiv@my-deja.com
Subject: Re: Loop with regexps
Message-Id: <8lcdbd$9tf$1@nnrp1.deja.com>
In article <mghe5.880$Av5.21090@news.kpnqwest.fi>,
"Eric Selin" <eric.selin@pp.inet.fi> wrote:
> Hi, I need a loop that will search for a regexp in a string.
> Like this:
>
> $b = 1;
> loop until(endof $a) {
> $a =~ /^(.*);
> print "<a href=\"$b\">a$</a>\n";
> $b++;
> }
>
> Thats just an idea. I hope you get the point.
> Thanx, Eric
>
>
A match regexp does return a list, so you can use that with a foreach
loop, for example:
$string = 12345678;
foreach $digit ($string =~ /(\d)/g) {
print ++$digit;
}
__END__
wich will print:
23456789
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sat, 22 Jul 2000 15:40:12 GMT
From: "Eric Selin" <eric.selin@pp.inet.fi>
Subject: Re: Loop with regexps
Message-Id: <wfje5.886$Av5.21062@news.kpnqwest.fi>
I have grep:ed a file with linenumbers:
foreach $line ($a =~ /^(\d*:.*)/g) {
print "$line<br>"
}
This print only the first line!
<aqutiv@my-deja.com> wrote in message news:8lcdbd$9tf$1@nnrp1.deja.com...
> In article <mghe5.880$Av5.21090@news.kpnqwest.fi>,
> "Eric Selin" <eric.selin@pp.inet.fi> wrote:
> > Hi, I need a loop that will search for a regexp in a string.
> > Like this:
> >
> > $b = 1;
> > loop until(endof $a) {
> > $a =~ /^(.*);
> > print "<a href=\"$b\">a$</a>\n";
> > $b++;
> > }
> >
> > Thats just an idea. I hope you get the point.
> > Thanx, Eric
> >
> >
>
> A match regexp does return a list, so you can use that with a foreach
> loop, for example:
>
> $string = 12345678;
>
> foreach $digit ($string =~ /(\d)/g) {
> print ++$digit;
> }
>
> __END__
>
> wich will print:
> 23456789
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
------------------------------
Date: Sat, 22 Jul 2000 17:04:10 GMT
From: aqutiv@my-deja.com
Subject: Re: Loop with regexps
Message-Id: <8lck61$ebt$1@nnrp1.deja.com>
In article <wfje5.886$Av5.21062@news.kpnqwest.fi>,
"Eric Selin" <eric.selin@pp.inet.fi> wrote:
> I have grep:ed a file with linenumbers:
> foreach $line ($a =~ /^(\d*:.*)/g) {
> print "$line<br>"
> }
> This print only the first line!
For multiple lines you need to use the m option, also your regexp was a
bit too greedy. here...
$a =~ /^\d+?:(.*)/gm;
is probably what you need.
read: perldoc perlre
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 22 Jul 2000 11:10:03 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: NFS Client in perl?
Message-Id: <8lbrtr$rcb$1@orpheus.gellyfish.com>
On 20 Jul 2000 17:30:39 -0700 Greg Andrews wrote:
> Otis Gospodnetic <otis@my-deja.com> writes:
>>
>>I need to be able to check whether a remote NFS server is up and
>>whether the local machine has certain partitions from that NFS server
>>mounted.
>>
>>I know I could probably try talking to nfsd over a socket and that I
>>could probably try checking if some file that is on the mounted
>>partition exist, but that doesn't look like the prettiest solution.
>>
>>I searched for 'NFS' at http://search.cpan.org/ but found nothing.
>>
>>Is there no perl NFS module or something such?
>>
>
> A module that implements a filesystem? That would be pretty
> complex.
>
There is of course PerlFS - not that I would recommend it to my friends ;-}
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: Sat, 22 Jul 2000 15:43:27 GMT
From: "Eric Selin" <eric.selin@pp.inet.fi>
Subject: OK, how do I put a variable in a regexp?
Message-Id: <zije5.887$Av5.21009@news.kpnqwest.fi>
This works:
$a =~ /14:(.*)\t(.*)/;
print "$1<br>";
But not this:
$i = 14;
$a =~ /^$i:(.*)\t(.*)/;
print "$i<br>";
}
------------------------------
Date: Sat, 22 Jul 2000 17:05:19 GMT
From: turnere <turnere0@my-deja.com>
Subject: Re: OK, how do I put a variable in a regexp?
Message-Id: <8lck86$eki$1@nnrp1.deja.com>
In article <zije5.887$Av5.21009@news.kpnqwest.fi>,
"Eric Selin" <eric.selin@pp.inet.fi> wrote:
> This works:
> $a =~ /14:(.*)\t(.*)/;
> print "$1<br>";
>
> But not this:
> $i = 14;
> $a =~ /^$i:(.*)\t(.*)/;
> print "$i<br>";
> }
>
>
What are you trying to do? What you wrote that "doesn't work" is
equivalent to:
$i = 14;
print "$i<br>";
which prints 14<br>.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sat, 22 Jul 2000 10:31:53 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: OK, how do I put a variable in a regexp?
Message-Id: <3979DA89.8561E217@stomp.stomp.tokyo>
Eric Selin wrote:
(alt.perl deleted to prevent tempting them here)
> This works:
> $a =~ /14:(.*)\t(.*)/;
> print "$1<br>";
> But not this:
> $i = 14;
> $a =~ /^$i:(.*)\t(.*)/;
> print "$i<br>";
> }
This single bracket above, just a copy
and paste typo isn't it?
I don't have any problem inserting your variable
within a matching operator.
????
Godzilla!
--
I will rock you.
http://la.znet.com/~callgirl5/magicman.mid
TEST SCRIPT:
___________
#!/usr/local/bin/perl
print "Content-Type: text/plain\n\n";
$a = "13:NoMatch NoMatch 14:Match1 Match2";
$a =~ /14:(.*)\t(.*)/;
print "\$a is: $a\n",
"\$1 is: $1\n",
"\$2 is: $2\n\n";
$i = 14;
$a =~ /^$i:(.*)\t(.*)/;
print "\$a is: $a\n",
"\$i is: $i\n",
"\$1 is: $1\n",
"\$2 is: $2\n";
exit;
PRINTED RESULTS:
________________
$a is: 13:NoMatch NoMatch 14:Match1 Match2
$1 is: Match1
$2 is: Match2
$a is: 13:NoMatch NoMatch 14:Match1 Match2
$i is: 14
$1 is: Match1
$2 is: Match2
------------------------------
Date: Sat, 22 Jul 2000 17:31:21 GMT
From: "Niederkircher" <mn@chello.at>
Subject: Re: OK, how do I put a variable in a regexp?
Message-Id: <JTke5.90924$7D2.1399467@news.chello.at>
yep i really don't care about this way but what if i wanted to fetch "$i"
(for example from a HTTP form) and not assign in the code?
Simon
"turnere" <turnere0@my-deja.com> wrote in message
news:8lck86$eki$1@nnrp1.deja.com...
> In article <zije5.887$Av5.21009@news.kpnqwest.fi>,
> "Eric Selin" <eric.selin@pp.inet.fi> wrote:
> > This works:
> > $a =~ /14:(.*)\t(.*)/;
> > print "$1<br>";
> >
> > But not this:
> > $i = 14;
> > $a =~ /^$i:(.*)\t(.*)/;
> > print "$i<br>";
> > }
> >
> >
>
> What are you trying to do? What you wrote that "doesn't work" is
> equivalent to:
>
> $i = 14;
> print "$i<br>";
>
> which prints 14<br>.
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
------------------------------
Date: Sat, 22 Jul 2000 15:29:17 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: perl-5.6.0: Bug with "not" operator?
Message-Id: <397ebb7d.34967558@news.newsguy.com>
mjtg@cus.cam.ac.uk (M.J.T. Guy) wrote:
>Keith Calvert Ivey <kcivey@cpcug.org> wrote:
>>mjtg@cus.cam.ac.uk (M.J.T. Guy) wrote:
>>>The examples which have come up are like
>>>
>>> not (localtime)[6]; # it isn't Sunday
>>
>>Yes, but have you ever seen that used in a real program?
>
>See the p5p archives for reports of problems actually encountered.
>They had that general style.
Thanks. Timothy A. McDaniel posted an example from a real
program to p5p on May 3, if anyone else cares:
if (not ($id, $count) = /^([^,]+),\s*([0-9]+)$/ ) {
--
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC
(Free at last from the forced spamsig of
Newsfeeds.com, cursed be their name)
------------------------------
Date: Sat, 22 Jul 2000 17:49:19 GMT
From: Daniel Pfeiffer <occitan@esperanto.org>
To: perlbug@perl.com
Subject: Perl: nested closure crashes on Linux
Message-Id: <8lcmqr$g7t$1@nnrp1.deja.com>
This Perl programme
sub myprint($) {
print $_[0], "\n";
}
my @str = qw(a b);
my $prog = sub {
myprint $str[0];
sub f {
myprint $str[1];
}
f;
};
&{$prog};
with perl-5.005_03 on Siemens Reliant Unix gives:
a
Use of uninitialized value at perltest line 2.
On SuSE Linux 6.4 with an out-of-the-box (configure; make...)
perl5.00405 it gives:
Can't use an undefined value as an ARRAY reference at perltest line 10.
a
On the same Linux, the perl-5.005_03 that comes with the distribution
and an out-of-the-box perl5.6.0 both give memory fault. An strace shows
a SIGSEGV but it doesn't dump core.
This happens neither if I name the sub and call it normally, nor if I
leave out either of the myprint lines. What's going on? Just because
the inner block belongs to a sub nested in an anonymous sub, shouldn't
mean I loose my closure. All the less so, if it only happens I've
already accessed it before the inner block.
-- Daniel
--
Bring text-docs to life! Erwecke Textdokumente zum Leben!
http://beam.to/iPerl/
Vivigu tekstodokumentojn!
-----------------------------------------------------------------
---
Flags:
category=core
severity=high
---
Site configuration information for perl v5.6.0:
Configured by pfeiffer at Fri May 5 04:54:46 MEST 2000.
Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
Platform:
osname=linux, osvers=2.2.14, archname=i686-linux
uname='linux pfdabpc 2.2.14 #1 mon mar 13 10:51:48 gmt 2000 i686
unknown '
config_args='-Dcc=gcc'
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef
usemultiplicity=undef
useperlio=undef d_sfio=undef uselargefiles=define
use64bitint=undef use64bitall=undef uselongdouble=undef
usesocks=undef
Compiler:
cc='gcc', optimize='-O2', gccversion=2.95.2 19991024 (release)
cppflags='-fno-strict-aliasing -I/usr/local/include'
ccflags ='-fno-strict-aliasing -I/usr/local/include
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
stdchar='char', d_stdstdio=define, usevfork=false
intsize=4, longsize=4, ptrsize=4, doublesize=8
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
alignbytes=4, usemymalloc=n, prototype=define
Linker and Libraries:
ld='gcc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lnsl -lndbm -lgdbm -ldbm -ldb -ldl -lm -lc -lposix -lcrypt
libc=, so=so, useshrplib=false, libperl=libperl.a
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'
Locally applied patches:
---
@INC for perl v5.6.0:
/usr/local/lib/perl5/5.6.0/i686-linux
/usr/local/lib/perl5/5.6.0
/usr/local/lib/perl5/site_perl/5.6.0/i686-linux
/usr/local/lib/perl5/site_perl/5.6.0
/usr/local/lib/perl5/site_perl
.
---
Environment for perl v5.6.0:
HOME=/home/pfeiffer
LANG=german
LANGUAGE (unset)
LC_CTYPE=de_DE_88591
LD_LIBRARY_PATH (unset)
LOGDIR (unset)
PATH=/home/pfeiffer/bin:/usr/local/system/scripts:/usr/local/bin:/bin:/usr/bin::/sbin:/usr/sbin:/usr/games/bin:/usr/bin/X11:/opt/kde/bin
PERL_BADLANG (unset)
SHELL=/bin/ksh
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 22 Jul 2000 10:15:19 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: Query String Golf
Message-Id: <87n1ja5h88.fsf@limey.hpcc.uh.edu>
>> On Sat, 22 Jul 2000 08:29:43 GMT,
>> aqutiv@my-deja.com said:
> So... What would be the shortest way to parse a query
> string style string? I've found this solution:
> $_ = $ENV{'QUERY_STRING'}; tr/+/ /;
> @QS{/(.+?)=.+?(&|$)/g} = /.+?=(.+?)(&|$)/g;
> s/%(..)/pack('c', hex($1))/eg foreach %QS;
> Which I admit, Isn't perfect. can anyone do it with
> less keywords and/or maby more efficient?
use CGI;
8 chars :-)
t
--
"With $10,000, we'd be millionaires!"
Homer Simpson
------------------------------
Date: Sat, 22 Jul 2000 17:16:34 GMT
From: "Rusty Williamson" <rwilliamson@uno.gers.com>
Subject: Questions on GD PERL module...
Message-Id: <SFke5.148$wn.2732@typhoon.san.rr.com>
Hi,
I'm kind of new at this and I'm not sure what the problem is. I'm trying to
install an older version of GD version 1.18 on PERL 5.004 and I'm getting
the following errors during make:
. . .
gcc -c -I/usr/local/include -O2 -DVERSION=\"1.18\" -DXS_VERSION=\"
1.18\" -fpic -I/usr/local/lib/perl5/AViiON-dgux/5.00404/CORE GD.c
GD.c: In function `XS_GD_constant':
GD.c:213: `PL_na' undeclared (first use this function)
GD.c:213: (Each undeclared identifier is reported only once
GD.c:213: for each function it appears in.)
GD.c: In function `XS_GD__Image_new':
GD.c:238: `PL_na' undeclared (first use this function)
GD.c: In function `XS_GD__Image__newFromGif':
GD.c:278: `PL_na' undeclared (first use this function)
GD.c: In function `XS_GD__Image__newFromXbm':
GD.c:302: `PL_na' undeclared (first use this function)
GD.c: In function `XS_GD__Image__newFromGd':
GD.c:326: `PL_na' undeclared (first use this function)
GD.c: In function `XS_GD__Image_char':
<snip>
*** Error code 1
Can anyone give me any information on what could be wrong?
Thanks for any help you can give me!
Rusty
------------------------------------------------------------
Rusty Williamson
Systems Programmer
GERS Retail Systems
http://www.gers.com/
The Object Workshop
http://home.san.rr.com/williamson/
Home Page
http://www.znet.com/~rusty/
------------------------------------------------------------
------------------------------
Date: 22 Jul 2000 11:42:19 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Removing (not extracting!) URL's from a string??
Message-Id: <8lbtqb$rf6$1@orpheus.gellyfish.com>
On Thu, 20 Jul 2000 14:07:10 GMT Richard Lawrence wrote:
>
> Quick question - I have some HTML source stored in a string and I'd
> like to remove (not extract) the hyperlinks to other sites. I know this
> will work:
>
> $content =~ /<a .+?>(.*?)<\/a>/$1/gis;
>
> however its a bit too vaige, will fall over with anything slightly more
> complicated and makes too many assumptions.
You will want to use HTML::Parse, believe me. This is a quick hack of
an example that uses version 3 of the module - you will want to change
the code in the start() subroutine to filter those URLs that you dont
want :
#!/usr/bin/perl -w
use strict;
use HTML::Parser;
my $parser = HTML::Parser->new(api_version => 3,
default_h => [ sub { print shift },"text" ],
start_h => [ \&start,"self,tagname,attr,text" ]);
$parser->parse_file(shift || '-' );
sub start
{
my ($self,$tag,$attr,$text) = @_;
if ( $tag eq 'a' && exists $attr->{href} )
{
if ( $attr->{href} =~ m/^http:/ &&
$attr->{href} !~ m/www\.gellyfish\.com/ )
{
$self->handler( end => \&end,"self, tagname, text");
return;
}
}
print $text;
}
sub end
{
my ( $self, $tag,$text ) = @_;
if ( $tag eq 'a' )
{
$self->handler(end => undef);
}
else
{
print $text;
}
}
Having your HTML in a string you can use the parse() method instead of
parse_file() that I have used for ease of testing.
Hope that helps
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: Sat, 22 Jul 2000 16:36:29 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: uninitialized variable value?
Message-Id: <397fc787.38049443@news.newsguy.com>
abigail@foad.org (Abigail) wrote:
>Keith Calvert Ivey (kcivey@cpcug.org) wrote on MMDXVII September MCMXCIII
>"" Why does it say "uninitialized" there anyway rather than
>"" "undefined"? If I initialize the variable and then later set it
>"" to undef and use it, I still get the same warning.
>
>You snipped out something from my posting.
>
>The line where I pointed out that variables aren't uninitialized, but
>*VALUES* can be.
>
>Please don't reply and start babbling about uninitialized variables again.
Sorry for babbling, but I'm trying to understand the distinction
you're making between "uninitialized" and "undefined". You're
saying that the phrase "uninitialized variable" is incorrect,
which means you consider these to be errors in the
documentation:
perldata:
# Undefined null scalars are returned when there is no real
# value for something, such as when there was an error, or
# at end of file, or when you refer to an uninitialized
# variable or element of an array.
perlfunc:
# Many operations return undef to indicate failure, end of
# file, system error, uninitialized variable, and other
# exceptional conditions.
But you say that variables can be initialized, so normal use of
English would imply that they're uninitialized when they haven't
been initialized yet. That doesn't have to mean you can
uninitialize them, of course. It's "un-" + "initialized", not
"uninitialize" + "-ed". "My work is undone" usually means that
I haven't done it yet, not that someone has come along and
undone it.
Is it also an error to refer to a value as undefined, or are
"undefined" and "uninitialized" synonyms when referring to
values, or is there some distinction I'm missing? From the
documentation of the warning in question, one would gather that
they're synonymous:
perldiag:
# Use of uninitialized value
#
# (W) An undefined value was used as if it were
# already defined. It was interpreted as a ``'' or
# a 0, but maybe it was a mistake. To suppress this
# warning assign an initial value to your variables.
Why not just use "undefined" everywhere?
--
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC
(Free at last from the forced spamsig of
Newsfeeds.com, cursed be their name)
------------------------------
Date: 22 Jul 2000 13:52:23 EDT
From: abigail@foad.org (Abigail)
Subject: Re: uninitialized variable value?
Message-Id: <slrn8njoro.vcg.abigail@alexandra.foad.org>
M.J.T. Guy (mjtg@cus.cam.ac.uk) wrote on MMDXVII September MCMXCIII in
<URL:news:8lc8nj$6ir$1@pegasus.csx.cam.ac.uk>:
() Abigail <abigail@foad.org> wrote:
() >
() >Here's one way to test it:
() >
() > eval 'local $^W = 1; "$certain_variable"';
() > if ($@ =~ /^Use of uninitialized value in string/) {
() > # Value is unitialized
() > }
()
() Eh? What are you expecting to see in $@ ?
Did you try?
() You aren't confusing warn() and die() by any chance ?
Why do you think there's an assignment to $^W?
Abigail
--
New email address: abigail@foad.org
------------------------------
Date: Sat, 22 Jul 2000 16:26:57 GMT
From: clintp@geeksalad.org (Clinton A. Pierce)
Subject: Re: UPD-packet problem..
Message-Id: <lXje5.47714$fR2.428699@news1.rdc1.mi.home.com>
[Posted and mailed]
In article <tl2e5.2783$MJ5.32912@twister.sunsite.auc.dk>,
"Daniel Ditlew" <ditlew@abk.auc.dk> writes:
> Hi.. I get this UPD - packet from a server.. when I make the UPD request
> "players"..
>
> Server responds with the following packet:
> (int32) -1
> (byte) ASCII 'D' (players response, S2A_PLAYER)
> (byte) active client count
>
> for each active client
> (byte) client number / index
> (string) player name
> (int32) client's frag total
> (float32) client's total time in-game
>
> I have a problem.. I seem to recive the packet as one long string, and I
> dont know how to split the string up into the different components.. I have
> tried to use a filter which looks for names in the packet, but it doesn't
> always do the work..
>
> This is my code:
> [torturous code deleted]
You went through all of that but you haven't discovered unpack()?
perldoc -f unpack is probably what you've been looking for.
--
Clinton A. Pierce Teach Yourself Perl in 24 Hours!
clintp@geeksalad.org for details see http://www.geeksalad.org
"If you rush a Miracle Man,
you get rotten Miracles." --Miracle Max, The Princess Bride
------------------------------
Date: Sat, 22 Jul 2000 17:06:47 GMT
From: "Rusty Williamson" <rwilliamson@uno.gers.com>
Subject: Where can I download PERL 5.005_02 from?
Message-Id: <Hwke5.144$wn.2690@typhoon.san.rr.com>
Hello,
I need to find the UNIX source distribution for PERL 5.005_02. Does anyone
know where I can find this? Is there an on-line archive of older PERL
versions?
Thank you for your help!
------------------------------------------------------------
Rusty Williamson
Systems Programmer
GERS Retail Systems
http://www.gers.com/
The Object Workshop
http://home.san.rr.com/williamson/
Home Page
http://www.znet.com/~rusty/
------------------------------------------------------------
------------------------------
Date: Sat, 22 Jul 2000 15:32:51 GMT
From: Michael Ransburg <daneel@tux.org>
Subject: Where to save socket descriptor?
Message-Id: <8lcer2$apf$1@nnrp1.deja.com>
Hello!
Following situation:
I'm coding a web interface for a server application. The users log in
which causes a perl script in the background to open a socket to the
server application.
Now the user is 'logged in' and is able to perform different actions,
using different perl scripts.
The problem I face is that all these scripts need the socket file
descriptor to accomplish their function. Usually they send something
through the socket, get a response and then exit. So I cannot hold the
descriptor within the script, because it would be gone as soon as the
script exits.
I need a way to store the descriptor somewhere. I tried to write it into
a cookie, but that did not work (I guess because it gets transformed
into a scalar context). I tried to write the descriptor to a file and
reopen it using fdopen, but that did not work either (probably because
of the same problem - scalar context).
How would you handle such a situation? Where would you keep your socket
descriptor?
I hope my problem is clear, if not please ask! :)
thanks
mike
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 22 Jul 2000 08:43:25 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Where to save socket descriptor?
Message-Id: <m1g0p2w4pu.fsf@halfdome.holdit.com>
>>>>> "Michael" == Michael Ransburg <daneel@tux.org> writes:
Michael> How would you handle such a situation? Where would you keep your socket
Michael> descriptor?
In a mini-web-server for each "logged in" user (skipping over the
oxymoronic term there):
http://www.stonehenge.com/merlyn/WebTechniques/col23.html
http://www.stonehenge.com/merlyn/WebTechniques/col24.html
--
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: 22 Jul 2000 11:03:55 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Why doesn't ActivePerl 5.6.0 change my PATH?
Message-Id: <8lbrib$rbj$1@orpheus.gellyfish.com>
On Sat, 22 Jul 2000 00:07:58 +0100 Stuart Moore wrote:
> David Ness <DNess@Home.Com> wrote in message
> news:39788723.7C1BD22F@Home.Com...
>>
>> I might only add that a slightly deceptive thing that you may
>> encounter is that the SET may not get executed on opening a new DOS
>> window until you have rebooted your machine once. IIRC, there was a
>> time when I believed that AutoExec.BAT didn't really `work' because
>> I would change it and then open a new window and not see effect of
>> the change. However, when I changed it, rebooted the machine and then
>> opened a DOS window, the change had the proper effect.
>
> True, but that's mainly because autoexec.bat is only processed on startup,
Infact I believe that you can cause each DOS session to run the autoexec
file (or indeed any other batch file ) when it is started.
> so it ignores it after that; what's equally annoying is setting environment
> variables in one DOS box have no effect on the others, so even if you've set
> the path correctly and got it working in one it doesn't go to all the rest
> by default. I expect this is by design, but it still can be annoying.
>
Well this is by design and in common with most other OSes shells. What
you could do is use 'SET' or 'PATH' to capture the current environment
to some file which you can run in the other DOS boxes or edit into your
autoexec.bat .
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
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 3776
**************************************