[18603] in Perl-Users-Digest
Perl-Users Digest, Issue: 771 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Apr 26 09:05:51 2001
Date: Thu, 26 Apr 2001 06:05:09 -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: <988290309-v10-i771@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 26 Apr 2001 Volume: 10 Number: 771
Today's topics:
Re: [Regex] Number of Matches THANKS! <SiStie@nuclear-network.com>
Re: [Very OT] Sex and apathy <miltonroad@btinternet.com>
Appending to files and flock. <taka@yarn.demon.co.uk>
Re: Appending to files and flock. <ubl@schaffhausen.de>
Re: Appending to files and flock. (Abigail)
Re: Appending to files and flock. <miltonroad@btinternet.com>
Re: Browsing Directories by CGI <gtoomey@usa.net>
Re: checking case in perl <pne-news-20010426@newton.digitalspace.net>
Re: file uploading <mk@ticklets.com>
Re: Good editor for perl <pne-news-20010426@newton.digitalspace.net>
Re: Good editor for perl <rle@keygene_dot_com>
Help Me Obi One You're my Only Hope <tuan.ngo1@home.com>
Re: Help Me Obi One You're my Only Hope <mk@ticklets.com>
Re: Help! How to down size perl interperator ? <pally@axtronics.com.tw>
How to down size /usr/bin/perl ? <pally@axtronics.com.tw>
how to open http://www.domain.com <question_1@hetnet.nl>
Re: how to open http://www.domain.com <gtoomey@usa.net>
HTTP POST to Apache web server <owen.sullivan@worldzap.com>
Re: match a range of number <david.bouman@nl.xo.com>
Re: match a range of number (Abigail)
Re: match a range of number (Abigail)
Re: match a range of number <bart.lateur@skynet.be>
Multipage Perl CGI script <sondberg@indexdata.dk>
Re: Question: Storable dumps in code <ubl@schaffhausen.de>
re-sizing a GIF image on the fly <graham@dragroup.com>
Re: Running Command Line Commands <miltonroad@btinternet.com>
Re: SGI IRIX fork() syscall: child process doesn't term (Abigail)
Re: Tcl is faster then perl. (Harri Haataja)
Re: Tcl is faster then perl. (Abigail)
Re: total newbie (Abigail)
Re: Where is my script (Abigail)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 25 Apr 2001 22:29:04 +0200
From: Simon Stiefel <SiStie@nuclear-network.com>
Subject: Re: [Regex] Number of Matches THANKS!
Message-Id: <3AE73390.491F6F1A@nuclear-network.com>
Hi,
thanks to all of you.
It works perfect.
Ren Maddox wrote:
> On Wed, 25 Apr 2001, SiStie@nuclear-network.com wrote:
>
> > $line ="# # # 4 6 # # 7 # 45 # 43 # 65 56 2 # 4345 # # 23";
> >
> > $counter += ($line =~ m/\s\d+\s/g); #won't work. :(
> > ^^
[snip]
> perl <<'__END__'
> $line ="23 # # # 4 6 # # 7 # 45 # 43 # 65 56 2 # 4345 # # 23 #47 48# 59";
> $counter += () = ($line =~ m/(?:^|\s)\d+(?=\s|$)/g);
> print "$counter\n";
> __END__
> 12
> Ren Maddox
> ren@tivoli.com
cu later...
--
Mit freundlichen Grüßen, .~. Open Minds.
with best regards /V\ Open Sources.
// \\ Open Future!
Simon Stiefel /( )\_ I N U X
^ ~ ^
--
|Simon Stiefel | Zwerbachstrasse 17 | 72555 Metzingen-Glems | Germany |
|SimonStiefel@nuclear-network.com | http://www.nuclear-network.com |
|ICQ#: 20196644 | phone: +49(0)7123/379070 | fax: +49(0)179/335990106 |
|Tux#: 114751 | PingoS - Linux-User helfen Schulen | Powered by LiNUX |
------------------------------
Date: Thu, 26 Apr 2001 10:00:05 +0000
From: Milton Road <miltonroad@btinternet.com>
Subject: Re: [Very OT] Sex and apathy
Message-Id: <osRF6.136726$HR6.15535238@nnrp4.clara.net>
Uri Guttman wrote:
> sounds as if you haven't had enough sex yourself.
Whatever.
> why don't you go into
> the corner and masturbate for an hour or so?
Please. An hour? Won't take me that long... Thirty seconds should
suffice, surely - and that includes set-up and mop-up. Hmm, the tone is
unnecessarily lowering here...
> i am sure you do it better
> than you code perl and the chill will do you good.
Ooh! Casting aspersions on my sex life and my Perl code. I must
attempt to defend both!!
Ah, fuck it. Who cares, really?
Milton.
------------------------------
Date: 26 Apr 2001 11:55:41 +0100
From: Paul the Nomad <taka@yarn.demon.co.uk>
Subject: Appending to files and flock.
Message-Id: <87oftk0w2a.fsf@euterpe.yarn.demon.co.uk>
I've just been looking at someone's code for a very basic survey/poll
cgi. You know, the sort of thing that you see on Slashdot.
Every time someone votes the result is appended to a file...something
like this:
open (FH, ">> results.txt");
print FH $result;
close FH;
However, the author of this code doesn't lock the file at all. Surely
as a CGI you might get many attempts to append to the file at the same
time. My question is shouldn't flock be used here? Or is there
something about 'print FH ...' that makes it atomic?
Cheers...
--
-----------
Paul
http://www.seditiousdiaries.com/Donald10.html
------------------------------
Date: Thu, 26 Apr 2001 13:40:43 +0100
From: Malte Ubl <ubl@schaffhausen.de>
Subject: Re: Appending to files and flock.
Message-Id: <3AE8174B.759C28C6@schaffhausen.de>
Paul the Nomad schrieb:
> open (FH, ">> results.txt");
> print FH $result;
> close FH;
>
> However, the author of this code doesn't lock the file at all. Surely
> as a CGI you might get many attempts to append to the file at the same
> time. My question is shouldn't flock be used here?
Yes it should,
Cheers,
->malte
------------------------------
Date: Thu, 26 Apr 2001 11:49:24 +0000 (UTC)
From: abigail@foad.org (Abigail)
Subject: Re: Appending to files and flock.
Message-Id: <slrn9eg2q4.qli.abigail@tsathoggua.rlyeh.net>
Paul the Nomad (taka@yarn.demon.co.uk) wrote on MMDCCXCV September
MCMXCIII in <URL:news:87oftk0w2a.fsf@euterpe.yarn.demon.co.uk>:
;;
;;
;; I've just been looking at someone's code for a very basic survey/poll
;; cgi. You know, the sort of thing that you see on Slashdot.
;;
;; Every time someone votes the result is appended to a file...something
;; like this:
;;
;; open (FH, ">> results.txt");
;; print FH $result;
;; close FH;
;;
;; However, the author of this code doesn't lock the file at all. Surely
;; as a CGI you might get many attempts to append to the file at the same
;; time. My question is shouldn't flock be used here? Or is there
;; something about 'print FH ...' that makes it atomic?
No, it's something about the open mode.
Did you study perlopentut?
Abigail
--
sub f{sprintf$_[0],$_[1],$_[2]}print f('%c%s',74,f('%c%s',117,f('%c%s',115,f(
'%c%s',116,f('%c%s',32,f('%c%s',97,f('%c%s',0x6e,f('%c%s',111,f('%c%s',116,f(
'%c%s',104,f('%c%s',0x65,f('%c%s',114,f('%c%s',32,f('%c%s',80,f('%c%s',101,f(
'%c%s',114,f('%c%s',0x6c,f('%c%s',32,f('%c%s',0x48,f('%c%s',97,f('%c%s',99,f(
'%c%s',107,f('%c%s',101,f('%c%s',114,f('%c%s',10,)))))))))))))))))))))))))
------------------------------
Date: Thu, 26 Apr 2001 12:56:17 +0000
From: Milton Road <miltonroad@btinternet.com>
Subject: Re: Appending to files and flock.
Message-Id: <B1UF6.68$PP3.76538@nnrp3.clara.net>
> > However, the author of this code doesn't lock the file at all. Surely
> > as a CGI you might get many attempts to append to the file at the same
> > time. My question is shouldn't flock be used here?
>
> Yes it should,
Not necessarily. The author may have been trying to achieve cross-platform
compatibility. Some platforms do not support the flock function.
Doesn't mean that some other locking mechanism ( i.e. lock files _couldn't
have been used though.
Milton
------------------------------
Date: Thu, 26 Apr 2001 19:06:31 +1000
From: "Gregory Toomey" <gtoomey@usa.net>
Subject: Re: Browsing Directories by CGI
Message-Id: <hlRF6.11832$482.55224@newsfeeds.bigpond.com>
You can use cuteftp (which now unfortunately comes with Autate spyware); you
can change directories up/down and list all the files. Download cuteftp from
download.com.
But Stuart you really do need more. You need telnet access to the FreeBSD
shell.
(Ask your ISP how much this is. It shold be a one off cost, not a cost per
month).
Unix has file permissions that you really need to know about to get Perl
sizzling.
There are zillions of intro Unix books - try to find a FreeBSD one.
gtoomey
----------
"Stuart Moore" <stumo@bigfoot.com> wrote in message
news:paJF6.5040$lq1.389278@news6-win.server.ntlworld.com...
> Clinton Munden <clinton.munden@alcatel.com> wrote in message
> news:3AE70176.619CFB83@alcatel.com...
> > What OS are you using?
> >
> >
> > Stuart Moore wrote:
> >
> > > Is there a module that handles browsing directories (and if possible
> > > uploading/downloading) through a CGI interface? My ISP insists I dial
> through
> > > them to upload through FTP, this'd be a useful way of getting through
that.
>
> My ISP (what I want it for) is FreeBSD (I presume a form of unix, I'm
afraid I'm
> Dos/Win only ;-)
>
>
------------------------------
Date: Thu, 26 Apr 2001 10:37:29 +0200
From: Philip Newton <pne-news-20010426@newton.digitalspace.net>
Subject: Re: checking case in perl
Message-Id: <rimfeto8n1gctbgs26mdssj1ut44afvgut@4ax.com>
On Wed, 25 Apr 2001 20:44:27 GMT, Uri Guttman <uri@sysarch.com> wrote:
> >>>>> "kn" == kelli norman <kellikellin@netscape.net> writes:
>
> kn> if ($var EQ uc($var))
> kn> { print "$var is upper\n"; }
> kn> if ($var EQ lc($var))
> kn> { print "$var is lower\n"; }
>
> umm, what perl operator is EQ?
The same as eq. Did you try it out? :P
> in fact do you know of any perl functions whose names are upper case?
I know of some whose names *were* upper case: EQ, NE, GT, LT, GE, LE.
Apparently for backwards compatibility for ex-Fortran programmers. I
believe this was not documented, but have a look at an "older" toke.c
(for example, line 5079 in 5.6.0:
if (strEQ(d,"EQ")) { deprecate(d); return -KEY_eq;}
).
The use of these was deprecated for a while (a warning under -w); they
were removed as change 6454 (which was backed out as 6458) and finally
removed in change 6466 on 30 July 2000.
So they're still in 5.6.0 but not in 5.6.1 or 5.7.1.
Cheers,
Philip
--
Philip Newton <nospam.newton@gmx.li>
Yes, that really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.
------------------------------
Date: Thu, 26 Apr 2001 09:12:14 +0200
From: "Paul Kersey" <mk@ticklets.com>
Subject: Re: file uploading
Message-Id: <9c8hsf$r83$1@news1.xs4all.nl>
> Hi I'm using the following to upload a file to a server. But anything over
a
> 1 meg does not go thru. Does anyone know why? I have increased the buffer
> size to more than 1024.
I don't know if you're using CGI.pm (since you didn't tell), but if so:
check if the $CGI::POST_MAX value isn't set to a low value. Otherwise: check
you server specs.
------------------------------
Date: Thu, 26 Apr 2001 09:07:24 +0200
From: Philip Newton <pne-news-20010426@newton.digitalspace.net>
Subject: Re: Good editor for perl
Message-Id: <68ifetgmrp826avvgp5p6kib6b00iqg50l@4ax.com>
On 25 Apr 2001 21:12:14 GMT, anno4000@lublin.zrz.tu-berlin.de (Anno
Siegel) wrote:
> Slightly more on topic, yet still going on about vim: what I miss
> more than any syntax hilighter (which I don't trust enough) is
> the ability to use the QuickFix feature[1].
[snip]
> Hmm "use Unix::QuickFix;" sounds snappy...
Why "Unix"? Doesn't vim's QuickFix feature work on other platforms,
too?
Cheers,
Philip
--
Philip Newton <nospam.newton@gmx.li>
Yes, that really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.
------------------------------
Date: Thu, 26 Apr 2001 13:54:12 +0200
From: "Remko Lems" <rle@keygene_dot_com>
Subject: Re: Good editor for perl
Message-Id: <3ae80910@nfeed.intouch.net>
ActiveState Komodo is just released (begin of april), it's a full featured
IDE for Perl (XML, Python, and so on). And it's free for non-commercial
users!
See the site of ActiveState (www.activestate.com) for more details.
Remko
-----------
Tom Scheper wrote in message ...
>On Mon, 23 Apr 2001 16:08:42 +0200, "Super-Simon"
><simon@super-simon.com> shed a beam of light on us:
>
>>Hi all,
>>
>>I'm searching for a good, fast editor with syntax highlighting for perl
>>(CGI) for use under Windows 2000 / Windows 98 (I use windowz only for
>>editing scripts, scripts runs on Linux-server). It has to be free (I'm a
>>poor student ;-)
>>
>>Grtz,
>>
>>Super-Simon
------------------------------
Date: Thu, 26 Apr 2001 08:38:05 GMT
From: "Tuan Ngo" <tuan.ngo1@home.com>
Subject: Help Me Obi One You're my Only Hope
Message-Id: <N7RF6.3914$9X6.318353@news1.bnapk1.occa.home.com>
Need assistance with writing a Perl Script for the following problem... Any
help will be much appreciated... I may be able to provide compensation.....
You've just loaded a CD's worth of reference images from an outside company.
The images are grouped in "packets" of ten frames each, and are named
"DSCN-1.JPG, DSCN-2.JPG ... DSCN-10.JPG," then jump up by a count of 90 to
the next "hundreds" place-marker: "DSCN-101.JPG, DSCN-102.JPG ...
DSCN-110.JPG," and continue up through the sequence "DSCN-2301.JPG,
DSCN-2302.JPG ... DSCN-2310.JPG" giving a total of 240 frames. The frames
were brought online in somewhat of a "random" order, so that frame 8 may
have been loaded before frame 2, and "packet" 801-810 may have loaded before
301-310.
Although the frames were stored in separate "folders" on the CDROM from
which they were loaded, all of the frames have now been placed into a single
directory named: /shots/spi/home/pix/out/home_test_v1/misc_bg8/
The structure of the directory you've loaded them into is this:
/shots/$SHOWNAME/$SHOTNAME/pix/out/$ELEMENTNAME/$RESOLUTION_$COLORSPACE
----------------------------------------------------------------------------
----
Your task is to rename the frames in accordance with SPI standard naming
conventions. These include:
1. No capital letters in the filenames
2. No dashes are allowed in the filenames
3. Frame numbers need to be "padded" to four-digits. ie, "1" becomes "0001"
This is denoted by the symbol # so a range of 1-240 would read 1-240#.
4. The frames should be renamed to match the directory in which they are
placed in the following manner:
$ELEMENTNAME_$RESOLUTION_$COLORSPACE.#.$EXTENSION
So, in other words, each frame should read:
/shots/spi/home/pix/out/home_test_v1/misc_bg8/home_test_v1_misc_bg8.0001.jpg
/shots/spi/home/pix/out/home_test_v1/misc_bg8/home_test_v1_misc_bg8.0002.jpg
/shots/spi/home/pix/out/home_test_v1/misc_bg8/home_test_v1_misc_bg8.0003.jpg
...
/shots/spi/home/pix/out/home_test_v1/misc_bg8/home_test_v1_misc_bg8.0240.jpg
You have a limited timeframe to rename these frames, as they are going to be
sent overseas to another house before the end of their working day. You also
have good reason to suspect that there will be many more requests just like
this one.
----------------------------------------------------------------------------
----
The challenge is, then:
Sitting at a UNIX (Irix 6.5.8) terminal, use whatever methods you prefer to
rename and resequence these frames into their acceptable naming conventions
and proper sequential order. You may use any means at your disposal,
including most basic scripting languages.
------------------------------
Date: Thu, 26 Apr 2001 12:04:40 +0200
From: "Paul Kersey" <mk@ticklets.com>
Subject: Re: Help Me Obi One You're my Only Hope
Message-Id: <9c8rvp$m70$1@news1.xs4all.nl>
> Need assistance with writing a Perl Script for the following problem...
Any
> help will be much appreciated... I may be able to provide
compensation.....
Why don't you do your own work?
If you're not smart enough yourself: hire somebody who is :-)
------------------------------
Date: Thu, 26 Apr 2001 16:27:33 +0800
From: "Pally Kuo" <pally@axtronics.com.tw>
Subject: Re: Help! How to down size perl interperator ?
Message-Id: <9c8m22$1g8j$1@ccreader.nctu.edu.tw>
I don't need all of perl function but can work in common programs..
How can I get "Microperl"?
"brian d foy" <comdog@panix.com> ¼¶¼g©ó¶l¥ó
news:comdog-E24480.00515526042001@news.panix.com...
> In article <3g82UE$W1y@openbazaar.net>, Pally.bbs@openbazaar.net
> (Pally) wrote:
>
> > Is there any way to down size perl interperator (/usr/bin/perl)
> >
> > from 500k to below 200k ?
> >
> > I need this way to put perl interperator into flash rom .
>
> do you need all of perl or can you get away with microperl?
>
> --
> brian d foy <comdog@panix.com>
>
------------------------------
Date: Thu, 26 Apr 2001 16:18:03 +0800
From: "Pally Kuo" <pally@axtronics.com.tw>
Subject: How to down size /usr/bin/perl ?
Message-Id: <9c8lg8$1fsq$1@ccreader.nctu.edu.tw>
Hello,
I wanna down size perl interpreter /usr/bin/perl
the original size is about 502k
I must make it to below 200k, in order to post into flash rom...
Is there any way to do that ?
------------------------------
Date: Thu, 26 Apr 2001 09:50:00 +0200
From: "JWP" <question_1@hetnet.nl>
Subject: how to open http://www.domain.com
Message-Id: <upl0KWizAHA.85@net037s.hetnet.nl>
Hello
How can i open a file from the internet .
Something like
open http://www.domain.com/file.html
Mij server dosn't have a LWP modul installed
Thanks
Sjaak
------------------------------
Date: Thu, 26 Apr 2001 18:53:28 +1000
From: "Gregory Toomey" <gtoomey@usa.net>
Subject: Re: how to open http://www.domain.com
Message-Id: <39RF6.11827$482.56176@newsfeeds.bigpond.com>
Just copy (ftp) LWP from cpan.org to one fo your own subdirectories.
Use INC to include right directory.
Then you can use all the LWP functions - you probably need get() .
You dont need to be root to do this - it works with just about any ISP.
gtoomey
----------
"JWP" <question_1@hetnet.nl> wrote in message
news:upl0KWizAHA.85@net037s.hetnet.nl...
> Hello
>
> How can i open a file from the internet .
> Something like
>
> open http://www.domain.com/file.html
>
>
> Mij server dosn't have a LWP modul installed
>
> Thanks
> Sjaak
>
>
------------------------------
Date: Thu, 26 Apr 2001 09:26:26 GMT
From: "Owen Sullivan" <owen.sullivan@worldzap.com>
Subject: HTTP POST to Apache web server
Message-Id: <6RRF6.28850$PF4.50488@news.iol.ie>
I am using the code fragment below to post a binary file to a server. When
I use this to perform a HTTP post to a test application running on Windows
2000 using IIS web server it works fine. However, when I post this to a
Java servlet on an Apache web server, the servlet does not appear to be able
to handle the content correctly. Instead it performs a default action of
returning to me a HTML form to allow me to upload a file. When I then use
the HTML form to upload the same file (using Internet Explorer as the
browser), the file gets uploaded correctly. The parameters specified in the
form match those in the code below.
Has anyone encountered such a problem? I am aware this is more likely to be
due to an issue with the servlet than the Perl code fragment below, but I
don't have access to the servlet. Thanks for any help.
my $ua = LWP::UserAgent->new();
my $req = HTTP::Request::Common::POST $recipientHost,
Content_Type => 'multipart/form-data',
Content => [
sms => $smsText,
file_name => [ $contentToDeliver, $contentToDeliver ],
];
my $response = $ua->request($req);
if ($response->is_success()) {
print LOGFILE "Success.";
} else
print LOGFILE "Success: " . $response->as_string . "\n";
&dienice("HTTP post failed: $!");
}
------------------------------
Date: Thu, 26 Apr 2001 10:21:36 +0200
From: David Bouman <david.bouman@nl.xo.com>
Subject: Re: match a range of number
Message-Id: <3AE7DA90.6DE3C6A2@nl.xo.com>
Abigail wrote:
> sub strictly_sorted {
> strictly_sorted (scalar (@_), 2) ||
> $_ [0] < $_ [1] && strictly_sorted @_ [1 .. $#_];
> }
Ehm.., doesn't this spell "infinite recursion" ?
--
David Bouman (running perl, version 5.005_03)
------------------------------
Date: Thu, 26 Apr 2001 11:35:58 +0000 (UTC)
From: abigail@foad.org (Abigail)
Subject: Re: match a range of number
Message-Id: <slrn9eg20u.qli.abigail@tsathoggua.rlyeh.net>
David Bouman (david.bouman@nl.xo.com) wrote on MMDCCXCV September
MCMXCIII in <URL:news:3AE7DA90.6DE3C6A2@nl.xo.com>:
?? Abigail wrote:
??
?? > sub strictly_sorted {
?? > strictly_sorted (scalar (@_), 2) ||
?? > $_ [0] < $_ [1] && strictly_sorted @_ [1 .. $#_];
?? > }
??
?? Ehm.., doesn't this spell "infinite recursion" ?
We were talking how a mathematician would do it. Certainly smart math
people won't limit themselves to evaluate an expression in just one way!
They'll pick the right path.
Abigail
--
# Perl 5.6.0 broke this.
%0=map{reverse+chop,$_}ABC,ACB,BAC,BCA,CAB,CBA;$_=shift().AC;1while+s/(\d+)((.)
(.))/($0=$1-1)?"$0$3$0{$2}1$2$0$0{$2}$4":"$3 => $4\n"/xeg;print#Towers of Hanoi
------------------------------
Date: Thu, 26 Apr 2001 11:37:07 +0000 (UTC)
From: abigail@foad.org (Abigail)
Subject: Re: match a range of number
Message-Id: <slrn9eg233.qli.abigail@tsathoggua.rlyeh.net>
John W. Krahn (krahnj@acm.org) wrote on MMDCCXCV September MCMXCIII in
<URL:news:3AE78BCE.2548238F@acm.org>:
;; DT wrote:
;; >
;; > Can I use a single matching to do:
;; >
;; > (($i > 123) && ($i < 456))
;;
;;
;; use Quantum::Superpositions;
;;
;; if ( $i == any( 123 .. 456 ) { ... }
And that works if $i == 200.5 ?
Abigail
--
perl -MLWP::UserAgent -MHTML::TreeBuilder -MHTML::FormatText -wle'print +(
HTML::FormatText -> new -> format (HTML::TreeBuilder -> new -> parse (
LWP::UserAgent -> new -> request (HTTP::Request -> new ("GET",
"http://work.ucsd.edu:5141/cgi-bin/http_webster?isindex=perl")) -> content))
=~ /(.*\))[-\s]+Addition/s) [0]'
------------------------------
Date: Thu, 26 Apr 2001 12:06:33 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: match a range of number
Message-Id: <9c3get061ss4fmhqsppoerm2cgke9tkrjn@4ax.com>
Ren Maddox wrote:
>Furthermore, neither can be readily extended to handle things like:
>
> 0 < $i < $j < 100
And that's where it would *really* become interesting.
0 < $i < 100
would have to be equivalent to either
(0 < $i) < 100
or to
0 < ($i < 100)
if the associativity of the < operator were either left or right
associative. (The value of such a comparison is 1 for true, and 0 for
false, with Perl.) But now, it is nonassoc (see perlop), and
0 < $i < 100
is simply a syntax error.
So, in principle, Perl's expression parser could be extended to treat
combinations of multiple comparison operators as a special case, and do
the right thing from a mathematician's point of view.
But the above expressions with the parens would still have to be treated
as they are now.
--
Bart.
------------------------------
Date: Thu, 26 Apr 2001 09:51:31 +0200
From: Anders =?iso-8859-1?Q?S=F8nderberg?= Mortensen <sondberg@indexdata.dk>
Subject: Multipage Perl CGI script
Message-Id: <3AE7D383.1E85AFEA@indexdata.dk>
Hi,
I've been trying to implement a perl script, which is passed - among
others - an URL and checks on the net if that URL is still existing.
The problem is that it can take quite a long time to perform this check,
and the users are complaining that their browser screen is empty until a
respons is received (or timeout).
My plan was to let the CGI script generate a waiting screen until a
respons is received.
Depending on whether the URL exists or not, the CGI script should
generate an OK-screen or an error screen.
I'm not quite sure how to let a single CGI script show more than one
HTML-page.
Have anybody some experience on this field?
Thanx in advance!
Cheers,
Anders.
--
"Alcohol and calculus don't mix. Never drink and derive."
--------------------------------------------------------
Anders Sønderberg Mortensen
sondberg@indexdata.dk http://www.indexdata.dk
Index Data Ph.: +45 3341 0105 Fax: +45 3341 0101
--------------------------------------------------------
------------------------------
Date: Thu, 26 Apr 2001 09:56:06 +0100
From: Malte Ubl <ubl@schaffhausen.de>
Subject: Re: Question: Storable dumps in code
Message-Id: <3AE7E2A5.93172694@schaffhausen.de>
Shay Harding schrieb:
>
> Problem is I am getting a dump when retrieving an object saved via
> Storable::store.
>
> I have attemped to use Storable::freeze/thaw but with the same results. I
> have also tried FreezeThaw but, again, same kind of dump. I am certain the
> connection will close once attempting to serialize the object, but have
> tried everything I can think of. I just thought the dump was curious.
I dont think its the intend of those modules is the to make a database connection
persist. mod_perl would, indeed, be the way to go (I'm assuming you're
doing CGI
now). There are also special modules for Apache for the very purpose to
share db
connections between processes.
Bye,
->malte
------------------------------
Date: Thu, 26 Apr 2001 13:47:00 +0100
From: Andrew Boswell <graham@dragroup.com>
Subject: re-sizing a GIF image on the fly
Message-Id: <zDWOeoAEjB66EAGh@dragroup.com>
I want to write a Perl script that examines a GIF file to determine the
image size (width and height in pixels), then creates a thumbnail of it
on the fly. Writing the script poses few problems, but how do you
determine the size of a GIF image? I have downloaded the CompuServe
GIF89a Spec but that doesn't seem to help much. I know that binary files
are not meant to be read by humans, only computers, so how and with what
do I read a (binary) GIF file on the fly, and extract the information I
want?
--
Graham Stow
DENIS ROONEY ASSOCIATES
graham@dragroup.com
http://www.dragroup.com
------------------------------
Date: Thu, 26 Apr 2001 08:40:09 +0000
From: Milton Road <miltonroad@btinternet.com>
Subject: Re: Running Command Line Commands
Message-Id: <988270808.194505@dionysos>
bowman wrote:
[snip]
> you should be able to run many of your scripts cross platform. At the end
> of the day, though, Windows isn't Linux and some things just won't work as
> expected.
In this guy's case, the Perl functions rename and unlink would do the trick
for cross-platform compatibility.
That, and a quick OS check to determine the path delimiter.
I really need more sleep.
Milton.
------------------------------
Date: Thu, 26 Apr 2001 11:55:56 +0000 (UTC)
From: abigail@foad.org (Abigail)
Subject: Re: SGI IRIX fork() syscall: child process doesn't terminate after exit
Message-Id: <slrn9eg36c.qli.abigail@tsathoggua.rlyeh.net>
Matthew Black (black@csulb.edu) wrote on MMDCCXCIV September MCMXCIII in
<URL:news:9c7guh$f2q$1@hatathli.csulb.edu>:
## PROBLEM:
## We are having trouble with the fork() system call in Perl. When a
## child process exits, the process lingers as <defunct> rather than
## disappearing. These lingering <defunct> processes disappear only after
## the parent process gets terminated.
That's neither a problem with Perl, nor with IRIX.
The problem lies in the programs author not understanding the Unix
process model.
Please consult the perlipc man page and find out why parents need to
reap their children, lest they become zombies.
Abigail
--
perl -MTime::JulianDay -lwe'@r=reverse(M=>(0)x99=>CM=>(0)x399=>D=>(0)x99=>CD=>(
0)x299=>C=>(0)x9=>XC=>(0)x39=>L=>(0)x9=>XL=>(0)x29=>X=>IX=>0=>0=>0=>V=>IV=>0=>0
=>I=>$==-2449231+gm_julian_day+time);do{until($=<$#r){$_.=$r[$#r];$=-=$#r}for(;
!$r[--$#r];){}}while$=;$,="\x20";print+$_=>September=>MCMXCIII=>=>=>=>=>=>=>=>'
------------------------------
Date: Thu, 26 Apr 2001 09:31:37 GMT
From: harri@tolppa.kotisivupalvelu.fi (Harri Haataja)
Subject: Re: Tcl is faster then perl.
Message-Id: <slrn9efqs2.o8a.harri@tolppa.kotisivupalvelu.fi>
Anno Siegel wrote:
>According to Wenzel, Joel [CAR:VS11:EXCH] <coopvs14@americasm01.nt.com>:
>
>> Everyone was ignoring my question when I said perl was faster then Tcl
>> so I switched it around. Perl is in fact faster then Tcl according to
>
>What do you hope to achieve with that maneuver? Perhaps nobody here
>has the expertise in both Perl and Tcl to answer your questions? Or
>nobody cares?
Such maneuver would commonly be called "trolling".
--
md5 sum: 07394dd242eb331be403826f2df92bbf
------------------------------
Date: Thu, 26 Apr 2001 11:47:26 +0000 (UTC)
From: abigail@foad.org (Abigail)
Subject: Re: Tcl is faster then perl.
Message-Id: <slrn9eg2me.qli.abigail@tsathoggua.rlyeh.net>
Joel [CAR:VS11:EXCH] (coopvs14@americasm01.nt.com) wrote on MMDCCXCIV
September MCMXCIII in <URL:news:3AE7492D.3D7DEC91@americasm01.nt.com>:
;; I meant to ask why perl is fast...not why Tcl is slow. Sorry for the
;; misconception
Because Perl always choose a road leading downhill.
Abigail
--
$_ = "\x3C\x3C\x45\x4F\x54";
print if s/<<EOT/<<EOT/e;
Just another Perl Hacker
EOT
------------------------------
Date: Thu, 26 Apr 2001 11:43:55 +0000 (UTC)
From: abigail@foad.org (Abigail)
Subject: Re: total newbie
Message-Id: <slrn9eg2fr.qli.abigail@tsathoggua.rlyeh.net>
Greg Bacon (gbacon@HiWAAY.net) wrote on MMDCCXCIV September MCMXCIII in
<URL:news:teel765v1tds8b@corp.supernews.com>:
[]
[] No, I don't mean that an interpreter compiles on the fly. Your perl
[] binary contains at least two compilers: a Perl compiler (that uses a
[] parser generated from perly.y) and a Perl regular expression compiler.
And compilers for all other mini languages in Perl: (s)printf, (un)pack
and formats.
Abigail
------------------------------
Date: Thu, 26 Apr 2001 12:02:54 +0000 (UTC)
From: abigail@foad.org (Abigail)
Subject: Re: Where is my script
Message-Id: <slrn9eg3je.qli.abigail@tsathoggua.rlyeh.net>
Rudolf Polzer (eins@durchnull.de) wrote on MMDCCXCIV September MCMXCIII
in <URL:news:slrn9eeauf.22e.eins@www42.t-offline.de>:
??
?? BTW: is it possible to get the filename from a handle?
No.
After all, after opening the file (and getting a handle returned), the
filename might have been removed. Or that could be 47 different filenames
for the same file.
Consider:
open my $fh => "/path/to/file" or die;
unlink "/path/to/file" or die;
my $name1 = function_returning_name_from_handle $fh;
rename "/another/file", "/path/to/file" or die;
my $name2 = function_returning_name_from_handle $fh;
print "$name1 $name2\n";
What should it print, and why?
Abigail
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 771
**************************************