[18621] in Perl-Users-Digest
Perl-Users Digest, Issue: 789 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Apr 28 09:05:37 2001
Date: Sat, 28 Apr 2001 06:05:08 -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: <988463108-v10-i789@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sat, 28 Apr 2001 Volume: 10 Number: 789
Today's topics:
Re: Appending to files and flock. (Abigail)
Re: Appending to files and flock. (Gwyn Judd)
Re: First and last element in list loop <bart.lateur@skynet.be>
Re: First and last element in list loop (Gwyn Judd)
Re: First and last element in list loop <gellyfish@gellyfish.com>
Re: Foreing Newbie: How can I convert a perl source cod <gellyfish@gellyfish.com>
Re: help me <gtoomey@usa.net>
Re: help me <renes@hot.ee>
Re: Help! How to down size perl interperator ? <gellyfish@gellyfish.com>
Re: How to down size /usr/bin/perl ? <gellyfish@gellyfish.com>
Re: Image representation of a binary string <gellyfish@gellyfish.com>
Re: Installing Perl on Win98 <gellyfish@gellyfish.com>
Re: Needing Help! <gellyfish@gellyfish.com>
Re: Perl embeded on tcl scripts <gellyfish@gellyfish.com>
Re: Procmail Help <gellyfish@gellyfish.com>
Re: re-sizing GIF images on the fly <gellyfish@gellyfish.com>
Re: re-sizing GIF images on the fly <graham@letsgouk.com>
Re: re-sizing GIF images on the fly <graham@letsgouk.com>
Running procs on NT <up4u2@hotmail.com>
Re: Separate syslog file? <gellyfish@gellyfish.com>
Re: Single character reads on sockets <gellyfish@gellyfish.com>
Re: Things written to socket not flushed? <gellyfish@gellyfish.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 28 Apr 2001 11:01:17 +0000 (UTC)
From: abigail@foad.org (Abigail)
Subject: Re: Appending to files and flock.
Message-Id: <slrn9el8nt.9mf.abigail@tsathoggua.rlyeh.net>
Gwyn Judd (tjla@guvfybir.qlaqaf.bet) wrote on MMDCCXCVII September
MCMXCIII in <URL:news:slrn9ekmjm.978.tjla@thislove.dyndns.org>:
%%
%% Well, here is a patch. I'm not really sure how best to submit it. Should
%% I just post it to p5p with the word "[PATCH]" in the subject?
Yes, but I would mention 'perlfaq' en the version against which the
patch is made as well.
%% +If you are on a system that correctly implements flock() and you use
%% +the example appending code from "perldoc -f flock" everything will be
%% +OK even if the OS you are on doesn't implement append mode correctly.
%% +So if you are happy to restrict yourself to OSs that implement flock()
%% +(and that's not really much of a restriction) then that is what you
%% +should do.
I actually do not agree. Don't give the impression Unices that don't
implement O_APPEND are any other than extremely rare, you've got to have
something at least 15 years old. Also, what do you mean by implementing
it incorrectly? O_APPEND was invented to have these atomic seek & write
actions. It wasn't an afterthought for O_APPEND. What's next, defending
yourself against systems that implement write incorrectly? In extreme
cases you might want to, but it is not a reasonable default.
Using flock() if you don't have to, can easily lead to a bottleneck.
Specially if you have many processes doing writes to the same file.
Even more so if you also have processing doing reads on the file
(note that Perl isn't able to lock records; you either lock the
entire file, or nothing at all)
Cross OS-family combatibility is nice is some cases, but for the majority
of the programs totally irrelevant, and often not worth sacrifising
efficiency for.
%% +If you know are only writing code to run on an OS and filesystem that
%% +does implement append mode correctly (a local filesystem on a modern
%% +Unix for example), and you keep the file in block-buffered mode and
%% +you write less than one buffer-full of output between each manual
%% +flushing of the buffer then each bufferload is almost garanteed to be
%% +written to the end of the file in one chunk without getting
%% +intermingled with anyone else's output.
Or else there is always syswrite(), which is just a wrapper around
write(2).
Abigail
------------------------------
Date: Sat, 28 Apr 2001 12:21:30 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: Appending to files and flock.
Message-Id: <slrn9elhar.3cj.tjla@thislove.dyndns.org>
"mein Luftkissenfahrzeug ist voll von den Aalen"
said Abigail (abigail@foad.org) in
<slrn9el8nt.9mf.abigail@tsathoggua.rlyeh.net>:
>Gwyn Judd (tjla@guvfybir.qlaqaf.bet) wrote on MMDCCXCVII September
>MCMXCIII in <URL:news:slrn9ekmjm.978.tjla@thislove.dyndns.org>:
>%% +OK even if the OS you are on doesn't implement append mode correctly.
>
>implement O_APPEND are any other than extremely rare, you've got to have
>something at least 15 years old. Also, what do you mean by implementing
>it incorrectly? O_APPEND was invented to have these atomic seek & write
I think nobull was referring to Win32 systems as being the ones that
don't implement O_APPEND correctly.
--
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
"I had to censor everything my sons watched ... even on the Mary Tyler
Moore show I heard the word 'damn'!"
-- Mary Lou Bax
------------------------------
Date: Sat, 28 Apr 2001 10:06:05 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: First and last element in list loop
Message-Id: <mc5let4gedihvojf3o5j6323uq8sia2jr8@4ax.com>
Gregory Toomey wrote:
>One alternative is to use
>foreach $i {0 .. $#list)
>{ ... }
>
>and test $i, but this introduces a new variable $i and is a bit clunky.
I think I'd remove $list[0] and $list[-1] from the list, using shift and
pop respectively, and simply write different code for them.
my @animals = qw( birds cats dogs);
my $first = shift @animals ;
my $last = pop @animals ;
my $sentence = "There are $first";
foreach (@animals) {
$sentence .= ", $_";
}
$sentece .= "and $last.";
--
Bart.
------------------------------
Date: Sat, 28 Apr 2001 10:56:40 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: First and last element in list loop
Message-Id: <slrn9elcbq.3cj.tjla@thislove.dyndns.org>
"mein Luftkissenfahrzeug ist voll von den Aalen"
said Uri Guttman (uri@sysarch.com) in
<x7bsphh48f.fsf@home.sysarch.com>:
>>>>>> "GJ" == Gwyn Judd <tjla@guvfybir.qlaqaf.bet> writes:
> GJ> I dunno though, wouldn't this break programs that do stuff like:
>
> GJ> print "The index of the last item is $#array\n";
>
>he means plain $# as the perl special variable that would track the
>index of a foreach loop. it has been bandied about in both p5p and perl6
>lists.
I know what he means. I was just pointing out that that particular
variable name might cause problems with existing code (that uses the
$#array variable as the index of the last item in an array).
--
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
Alone, adj.:
In bad company.
-- Ambrose Bierce, "The Devil's Dictionary"
------------------------------
Date: 28 Apr 2001 11:38:48 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: First and last element in list loop
Message-Id: <9cea48$fbj$4@neptunium.btinternet.com>
Uri Guttman <uri@sysarch.com> wrote:
>>>>>> "GJ" == Gwyn Judd <tjla@guvfybir.qlaqaf.bet> writes:
>
> GJ> "mein Luftkissenfahrzeug ist voll von den Aalen"
> GJ> said Anno Siegel (anno4000@lublin.zrz.tu-berlin.de) in
> GJ> <9cd06s$qtc$1@mamenchi.zrz.TU-Berlin.DE>:
>
> >> Maybe one day we will get $# to mean the loop index in foreach. Then
> >> this will be more convenient.
>
> GJ> I dunno though, wouldn't this break programs that do stuff like:
>
> GJ> print "The index of the last item is $#array\n";
>
> he means plain $# as the perl special variable that would track the
> index of a foreach loop. it has been bandied about in both p5p and perl6
> lists.
>
Er wouldnt this break programs that already use '$#' to mean something else
altogether ?
If my patch to make $# behave the same for zero as for another numbers
was rejected on the grounds that it might break ten year old programs
then I am absolutely convinced then a proposal to reuse the variable
for something else will be rejected :)
/J\
--
Jonathan Stowe |
<http://www.gellyfish.com> | This space for rent
|
------------------------------
Date: 28 Apr 2001 10:47:31 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Foreing Newbie: How can I convert a perl source code in a binary file
Message-Id: <9ce743$d0i$3@neptunium.btinternet.com>
Gian Paulo Rondanelli <mececo99@tamarugo.cec.uchile.cl> wrote:
> How I can transform the source code of a Perl program , so that it is
> possible to be executed,
> but not possible to view his source code.
>
use the Pony module available from CPAN.
/J\
--
Jonathan Stowe |
<http://www.gellyfish.com> | This space for rent
|
------------------------------
Date: Sat, 28 Apr 2001 21:24:41 +1000
From: "Gregory Toomey" <gtoomey@usa.net>
Subject: Re: help me
Message-Id: <JyxG6.13323$482.66636@newsfeeds.bigpond.com>
You can't do this using Perl/cgi as it isn't supported bu the HTTP protocol.
I always assume 720 pixels horizontally (about right on the basic 800 x 600
screen).
gtoomey
-----
"RS" <renes@hot.ee> wrote in message news:3aea065e@news.estpak.ee...
> HI
>
> I 'm writing counter for my site and I would like to log my guests display
> settings (resolution).
>
> Is this possible???
>
> I have Apache -> UNIX
>
> stuffweb@hot.ee
>
>
------------------------------
Date: Sat, 28 Apr 2001 14:24:22 +0300
From: "RS" <renes@hot.ee>
Subject: Re: help me
Message-Id: <3aeaa850$1@news.estpak.ee>
Bob Walton wrote in message <3AEA157A.1C65BD86@rochester.rr.com>...
>RS wrote:
>...
>> I 'm writing counter for my site and I would like to log my guests
display
>> settings (resolution).
>>
>> Is this possible???
>>
>> I have Apache -> UNIX
>>
>> stuffweb@hot.ee
>perldoc -q increment the counter
This won't help me
I want to know monitor resolution of my guests (like 800x600 and 1024x768)
------------------------------
Date: 28 Apr 2001 11:47:54 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Help! How to down size perl interperator ?
Message-Id: <9ceala$fbj$6@neptunium.btinternet.com>
[dejeopardized]
Pally Kuo <pally@axtronics.com.tw> wrote:
> "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?
>>
>
> I don't need all of perl function but can work in common programs..
> How can I get "Microperl"?
>
In the development perl source distribution there is a file Makefile.micro
you build microperl with :
make -f Makefile.micro
Mind you a stripped microperl on this machine is 850K ...
/J\
--
Jonathan Stowe |
<http://www.gellyfish.com> | This space for rent
|
------------------------------
Date: 28 Apr 2001 11:21:45 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: How to down size /usr/bin/perl ?
Message-Id: <9ce949$fbj$1@neptunium.btinternet.com>
Pally Kuo <pally@axtronics.com.tw> wrote:
> what should I do if all I want is socket function ?
Write the functinality you want in C.
/J\
--
Jonathan Stowe |
<http://www.gellyfish.com> | This space for rent
|
------------------------------
Date: 28 Apr 2001 11:33:40 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Image representation of a binary string
Message-Id: <9ce9qk$fbj$3@neptunium.btinternet.com>
Benjamin Goldberg <goldbb2@earthlink.net> wrote:
> It came up in sci.crypt that one might want to create an image which
> represents [the hash of] a binary string, as a sort of visual
> fingerprint. Someone posted the URL
> http://www.horde.net/~jwm/software/hex/ which does that, *but* the perl
> glue used doesn't want to download (the server is trying to run the
> script when one tries to dl it), and furthermore, the program first
> generates the md5hash with one program, makes the picture (as a ppm)
> with another, then converts to jpg, and stores that as a file (to
> eventually be cleaned up, I suppose). It would be much better to have a
> perl cgi which did all the steps in one program, and returned the image
> directly (ie, using content-type: image/whatever).
>
> A smart version would even test if there's an if-modified-since field in
> the http request header, and respond that the image is good if it's more
> recent than the file modification date of the cgi script (so caches will
> work right -- there are so many cgis which stupidly always regenerate
> data no matter what, even if it's not needed).
>
Er, right. So how can we help you precisely ? And you have looked at the
steganography stuff in Image::Magick ?
/J\
--
Jonathan Stowe |
<http://www.gellyfish.com> | This space for rent
|
------------------------------
Date: 28 Apr 2001 11:29:18 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Installing Perl on Win98
Message-Id: <9ce9ie$fbj$2@neptunium.btinternet.com>
T.Hopkins <boa@freemail.c3.hu> wrote:
> On Wed, 04 Apr 2001 05:43:37 GMT, "Evelyn Okec" <eokec@mediaone.net>
> wrote:
>
>>I downloaded Perl Software on my Win98 machine. There are several install
>>files which show up in a format I am not familiar with. Which install file
>>do I use and what program do I associate that install file with?
>>
> I think you would be better to use Indigoperl (www.indigostar.com) and
> you will get an Apache server with it too. The Activestate doesn't
> work on my Win32 in my case (I don't know why), but IndigoPerl is
> okay.
>
But perhaps the OP doesnt want an Apache server as well - I dont even
why you would want one on Win98 - its not as if Perl benefits from its
presence or anything.
Another drawback I envisage of IndigoPerl (aside from the awful bloat) is
that doesnt have the same range of Pre built modules as ActivePerl.
/J\
--
Jonathan Stowe |
<http://www.gellyfish.com> | This space for rent
|
------------------------------
Date: 28 Apr 2001 11:41:39 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Needing Help!
Message-Id: <9cea9j$fbj$5@neptunium.btinternet.com>
MJ <lowendz@home.com> wrote:
> I was wondering if any one of you can give me some sort of advice of
> creating a skeleton of a program. I've never programmed in Perl before and
> haven't been back to programming for the last 5 years! So I was wondering
> how to set up a program that will extract info out of two SQL tables (the
> name from one and a date from the other) and also info from an Access table
> (the address) and query it so that it takes the matching selected info and
> spits it out to a document (say something like a notepad base).
> Then to get a bit more complicated, have it also set up to send out the
> collected info out to selected people through an exchange server...
> Thanks in advance for your responses and help.
>
Would you like fries with that too ?
I think you will want to start by looking at the DBI module.
/J\
--
Jonathan Stowe |
<http://www.gellyfish.com> | This space for rent
|
------------------------------
Date: 28 Apr 2001 10:19:54 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Perl embeded on tcl scripts
Message-Id: <9ce5ga$o6c$9@uranium.btinternet.com>
novastar <root@novastar.dtdns.net> wrote:
> I have some system tools (windows) writen in perl that must be given to
> operators but on a gui version . My first thought was start learning tcl. I
> found some info for embeding java code to tcl but not for perl . Is there
> any faq or tutorial around explaining the interaction between tcl and perl ?
> Thanks in Advanced.
>
I know you belatedly read the FAQ, but for the benefit of readers of the
archives of this newsgroup who might otherwise be confused I think you mean
Tk not TCL.
There is a Perl/Tk and there is a newsgroup specifically for the discussion
of this - comp.lang.perl.tk.
/J\
--
Jonathan Stowe |
<http://www.gellyfish.com> | This space for rent
|
------------------------------
Date: 28 Apr 2001 10:49:59 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Procmail Help
Message-Id: <9ce78n$d0i$4@neptunium.btinternet.com>
John Smith <j2lab@my-deja.com> wrote:
> I know this is a Perl newsgroup but I'm having some problems with
> Procmail. I'm trying to pass information from my mail header to a Perl
> script. I am trying to pass the Subject and From information. If there
> is another place I should post this, please let me know.
>
Apart from Johan's excellent suggestion - you might consider just piping
the whole message to the program and using Mail::Internet to pick the
bits you want from it - I have posted a small example of this already today.
/J\
--
Jonathan Stowe |
<http://www.gellyfish.com> | This space for rent
|
------------------------------
Date: 28 Apr 2001 10:51:20 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: re-sizing GIF images on the fly
Message-Id: <9ce7b8$d0i$5@neptunium.btinternet.com>
Paul Kersey <mk@ticklets.com> wrote:
>> 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?
>
> Try using the Image::Size module...
>
To perform the resizing the OP will want to use the Image::Magick module.
/J\
--
Jonathan Stowe |
<http://www.gellyfish.com> | This space for rent
|
------------------------------
Date: Sat, 28 Apr 2001 13:44:22 +0100
From: Graham Stow <graham@letsgouk.com>
Subject: Re: re-sizing GIF images on the fly
Message-Id: <viZWdJAmsr66Ew3y@letsgouk.com>
Thanks Paul. The Image::Size module works a treat...
(and I must remember to check CPAN before I post).
--
Graham Stow
------------------------------
Date: Sat, 28 Apr 2001 13:51:16 +0100
From: Graham Stow <graham@letsgouk.com>
Subject: Re: re-sizing GIF images on the fly
Message-Id: <3CRQVXAEzr66EwWH@letsgouk.com>
I think this means that ImageMagick must be installed on the ISPs
server. This is unnecessary as the Image::Size module can determine the
original size, and a simple script can then be written to do the
resizing. Why use a torque wrench when a spanner will do!
--
Graham Stow
------------------------------
Date: Sat, 28 Apr 2001 10:57:43 GMT
From: "Peter" <up4u2@hotmail.com>
Subject: Running procs on NT
Message-Id: <HmxG6.27335$Kt6.5506037@amsnews03.chello.com>
Hi,
I am a newbee for perl so forgive me if I am at the wrong place.
Q1. How can I find out with perl which processes are running on an NT
system?
Maybe a code example? Would be nice.
Q2. Is nsPerl a good choice? --> http://people.netscape.com/richm/nsPerl/
Specially for a wide range of systems.
--
Groeten / Regards,
Peter de Jong, Barendrecht
The Netherlands, Europe ?
------------------------------
Date: 28 Apr 2001 10:46:01 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Separate syslog file?
Message-Id: <9ce719$d0i$2@neptunium.btinternet.com>
Pat Traynor <pat@ssih.com> wrote:
> I'm successfully logging output to my syslog file like this:
>
> use Sys::Syslog qw(:DEFAULT setlogsock);
> setlogsock('unix');
> syslog('info', "Test message to syslog filel\n");
>
> I understand how to send different levels of priority messages to
> different log files via syslog.conf, but is there a way to have a
> program log output to a custom log level? e.g.:
>
> syslog('mytest', "Test message to syslog filel\n");
Surely that is an issue of the capability of your syslog daemon ?
/J\
--
Jonathan Stowe |
<http://www.gellyfish.com> | This space for rent
|
------------------------------
Date: 28 Apr 2001 10:43:22 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Single character reads on sockets
Message-Id: <9ce6sa$d0i$1@neptunium.btinternet.com>
David J. Marcus <djmarcus@ex-pressnet.com> wrote:
> Hi
>
> I am trying to write a client and a server that communicate using the
> following simple protocol:
> - length of content-length field (1 character)
> - length of content
> - content
> For example, when sending the string 'hello', the message actually sent is:
> 211hello there
>
> where the '2' is the length of the '11', and 11 is the length of 'hello
> there'.
> This allows fixed length reads and writes.
>
> On the both the reader and listener side I have used $| = 1 but to no avail.
>
> On the reader side I do:
>
> read ( $sock, $lenlen, 1 );
> read ( $sock, $len, $lenlen );
> read ( $sock, $msg, $len );
>
> It seems that the first read hangs.
>
> Am I doing things correctly?
> Any suggestions? hints? advice? etc?
>
Are you sure that the problem is not in your server code ? What do you
get when you telnet to the appropriate port ?
Anyhow here is code that does work as you describe :
SERVER :
#!/usr/bin/perl
use warnings;
use strict;
use IO::Socket;
my $server = IO::Socket::INET->new(
Proto => 'tcp',
LocalPort => '1234',
Listen => SOMAXCONN,
Reuse => 1
);
if ( $server )
{
while (my $client = $server->accept() )
{
$client->autoflush(1);
print $client "211hello there";
close $client;
}
}
CLIENT :
#!/usr/bin/perl
use warnings;
use strict;
use IO::Socket;
my $sock = IO::Socket::INET->new(
Proto => 'tcp',
PeerAddr => 'localhost',
PeerPort => 1234
);
if ( $sock )
{
my ( $lenlen, $len, $msg );
read $sock, $lenlen, 1;
read $sock, $len, $lenlen;
read $sock, $msg, $len;
close $sock;
print $msg;
}
I would take it from there.
/J\
--
Jonathan Stowe |
<http://www.gellyfish.com> | This space for rent
|
------------------------------
Date: 28 Apr 2001 10:16:22 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Things written to socket not flushed?
Message-Id: <9ce59m$o6c$8@uranium.btinternet.com>
In comp.lang.perl.misc kalasend at YAHOO dot COM <dontuspamme@nospammers.com> wrote:
> hi,
> I'm very new to Perl. (best defender anyway :-)
> I wrote a simple program to just grab the index page of any web server
> given. It uses socket to connect to port 80 of a host, and then do this:
>
> my $EOL = "\015\012";
> print SOCK "GET / HTTP/1.1", $EOL;
>
> Then it hangs there forever...I think it could be that the buffer for
> that socket is not flushed? (I can read things from the socket without
> problems, by the way).
>
Here is a rudimentary, obsolete but working HTTP client that I prepared
earlier:
#!/usr/bin/perl
use warnings;
use strict;
use Socket;
my $host = 'localhost';
my $proto = getprotobyname('tcp') || die " getprotobyname - $!\n";
socket(SOCK, PF_INET, SOCK_STREAM, $proto) || die " socket : $!\n";
my $sin = sockaddr_in(80,inet_aton($host)) || die "sockaddr : $!";
connect(SOCK,$sin) || die "connect : $!\n";
my $request="GET / HTTP/1.0 \r\n\r\n" || die "$!";
send(SOCK,$request,0) || die "send : $!\n";
binmode SOCK;
local $/ = "\r\n\r\n";
chomp(my $header = <SOCK>);
my @header_lines = split /\r\n/,$header;
my ($ver,$status,$stat_text) = (shift @header_lines) =~ /^(\S+)\s+(\d+)(.+)$/;
if ($status == 200)
{
my %headers = map { split /: */ } @header_lines;
if (exists $headers{'Content-Length'})
{
my $content;
read(SOCK,$content,$headers{'Content-Length'}) || die "read - $!\n";
print $content;
}
}
else
{
warn "HTTP status $status - $stat_text\n";
}
close SOCK;
Now go and install LWP and do what most sensible people would do.
/J\
--
Jonathan Stowe |
<http://www.gellyfish.com> | This space for rent
|
------------------------------
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 789
**************************************