[18560] in Perl-Users-Digest
Perl-Users Digest, Issue: 728 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Apr 20 14:05:59 2001
Date: Fri, 20 Apr 2001 11:05:13 -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: <987789912-v10-i728@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 20 Apr 2001 Volume: 10 Number: 728
Today's topics:
(do not read, only a test) (echo 'Rudolf Polzer'>/dev/null)
Re: [Apache] PUT method ... cgi to "receive"? <cam2@cornell.edu>
Anyone know how i can extract <Title> </title> from htm <abcd@ntlworld.com>
Building 5.6.1 on darwin ... no Makefile? <keepberthasurfin@hotmail.com>
Re: Building 5.6.1 on darwin ... no Makefile? James.Cummings@uea.ac.uk
Calling an ASP from a Perl CGI <mdtorre@freemail.it>
Re: Can't open file, dies (Jim Kroger)
Re: Cookie/Hash help needed <dan@nospam_dtbakerprojects.com>
Dynamic graphics generation <SiStie@nuclear-network.com>
Re: Dynamic graphics generation <stefan@wirelessopinion.com>
File path not getting resolved correctly. tmerenes.dontspam@sybase.com
Re: File path not getting resolved correctly. (Steven M. O'Neill)
Formmail Doesn't always email <chrisb@netvertising.com>
Re: Formmail Doesn't always email <hillr@ugs.com>
Re: gmtime and daylight savings time? <mess@dds.nl>
Grabbing file date and time (Cosmic Cruizer)
Re: Grabbing file date and time (John Joseph Trammell)
Re: help for a basic hash value access question nobull@mail.com
Re: hitcounter <gsilvestris@selin.it>
Re: How to deal with function pointers? <ak@dasburo.de>
Re: https module <smilepak@hotmail.com>
Re: https module nobull@mail.com
Idiom: the expression of a copied & substituted string <johnlin@chttl.com.tw>
LWP, getting the default index page name from a web dir (Steve)
Re: LWP, getting the default index page name from a web nobull@mail.com
Re: Multi dimensional array dimensions <bart.lateur@skynet.be>
Re: Multi dimensional array dimensions nobull@mail.com
Net::POP3 <jc@nospampraud.com>
openfile <adustipujo1@mediaone.net>
Re: openfile nobull@mail.com
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 20 Apr 2001 19:14:31 +0200
From: rpolzer@www42.t-offline.de (echo 'Rudolf Polzer'>/dev/null)
Subject: (do not read, only a test)
Message-Id: <slrn9e0rjn.6t6.rpolzer@www42.t-offline.de>
Sorry for this, but I am trying to make fetchnews get this NG again.
So I cannot use test NGs for this.
------------------------------
Date: Fri, 20 Apr 2001 09:57:21 -0400
From: Chris Manly <cam2@cornell.edu>
Subject: Re: [Apache] PUT method ... cgi to "receive"?
Message-Id: <cam2-F0B715.09572120042001@newsstand.cit.cornell.edu>
In article <9bliov$1tpf$1@news.tht.net>, scrappy@hub.org (Marc G.
Fournier) wrote:
>I've been trying to implement a PUT method using PHP, and either the docs
>are wrong, or PHP is broken ... I'm figuring to try it using Perl instead,
>since then I'd at least have the ability to deal with non-nobody directory
>permissions ...
>
>I've searched Google, and came up dry .. can someone point me to a sample
>cgi, or docs on doing this?
I've got a perl script that implements it. I think I got it from an old
issue of WebTechniques, so you might want to grovel their site.
However, at this point, I'd suggest just installing mod_dav, which
supports all of webDAV (www.webdav.org), in addition to just the PUT
method. More and more client applications are supporting WebDAV.
--
Christopher Manly
cam2@cornell.edu
------------------------------
Date: Fri, 20 Apr 2001 18:57:12 +0100
From: "Chile" <abcd@ntlworld.com>
Subject: Anyone know how i can extract <Title> </title> from html source
Message-Id: <ON_D6.1509$HQ4.243304@news2-win.server.ntlworld.com>
Hi,
I have the html source but i am not very good at those =~ yet so if anyone
knows how i could extract the webpages title in between the <title> </title>
tags then it would be great.
Thanks,
Scott
------------------------------
Date: Fri, 20 Apr 2001 11:16:29 -0400
From: "Thelonious Georgia" <keepberthasurfin@hotmail.com>
Subject: Building 5.6.1 on darwin ... no Makefile?
Message-Id: <9bpjsd$8g$1@news.panix.com>
Aloha all-
I downloaded the stable source release of Perl 5.6.1 and am compiling them
for both my MacOS X box and a Linux 2.4 box. The Linux box has seemingly had
no problem with the configure script ... at the end it asked if I wanted to
run make depend, which I said yes to, then I ran make and it's compiling as
we speak.
MacOS X, on the other hand, has not worked because of one very odd problem
... it doesn't generate a Makefile! Runing ./Configure correctly detected
darwin, and it didn't seem to complain about anything during the actual
script. Running ./Configure -S creates the appropriate files, all but the
actual Makefile. I can verify that all the other files are there.
Needless to say, no Makefile, no joy. Has anyone else heard of this? Is
there any way to "force" it out? It's not a permissions thing ... I'm
running as root on both boxes. I also don't have a disk space issue :)
Thanks for any information
------------------------------
Date: 20 Apr 2001 15:32:52 GMT
From: James.Cummings@uea.ac.uk
Subject: Re: Building 5.6.1 on darwin ... no Makefile?
Message-Id: <9bpkr4$6po$1@cpca14.uea.ac.uk>
Thelonious Georgia <keepberthasurfin@hotmail.com> wrote:
> Aloha all-
> I downloaded the stable source release of Perl 5.6.1 and am compiling them
> for both my MacOS X box and a Linux 2.4 box. The Linux box has seemingly had
> no problem with the configure script ... at the end it asked if I wanted to
> run make depend, which I said yes to, then I ran make and it's compiling as
> we speak.
> MacOS X, on the other hand, has not worked because of one very odd problem
> ... it doesn't generate a Makefile! Runing ./Configure correctly detected
> darwin, and it didn't seem to complain about anything during the actual
> script. Running ./Configure -S creates the appropriate files, all but the
> actual Makefile. I can verify that all the other files are there.
> Needless to say, no Makefile, no joy. Has anyone else heard of this? Is
> there any way to "force" it out? It's not a permissions thing ... I'm
> running as root on both boxes. I also don't have a disk space issue :)
> Thanks for any information
Search the archives for the macosx@perl.org mailing list...they've
just had a discussion about this. That isn't my problem though... I'm
trying it on Mac OS X server (rhapsody) and it configures fine, it just
dies while trying to make ernno.pm
*sigh*
-James
--
James Cummings | james@cursus.uea.ac.uk | http://www.cursus.uea.ac.uk/~james
CURSUS Project, School of Music, University of East Anglia,
Norwich, Norfolk, NR4 7TJ,UK
------------------------------
Date: Fri, 20 Apr 2001 17:35:44 +0200
From: Matteo <mdtorre@freemail.it>
Subject: Calling an ASP from a Perl CGI
Message-Id: <3AE05750.E752C590@freemail.it>
I have to call a page at the enf of a Perl CGI (in the specific
case is an ASP, but I think HTML is the same).
How can I do?
Thank you very much,
Matteo
------------------------------
Date: Fri, 20 Apr 2001 10:58:23 -0400
From: minorseventhSPAMBLOCK@earthlink.net (Jim Kroger)
Subject: Re: Can't open file, dies
Message-Id: <minorseventhSPAMBLOCK-2004011058230001@tritone.csbmb.princeton.edu>
In article <slrn9dv0pg.4i6.tadmc@tadmc26.august.net>, tadmc@augustmail.com
wrote:
> Jim Kroger <minorseventhSPAMBLOCK@earthlink.net> wrote:
>
> >then that is just a typo from my
> >transcription of my code..
>
>
> Don't go zipping right past another lesson that can be learned
> from that.
>
>
> >sorry bout that.
>
>
> Typos waste your time.
>
> They waste the time of hundreds of others too.
>
> Typos are bad bad bad, so...
>
> ... do not retype code!
>
> Always use copy/paste or "import" or something, else you'll just end
> up getting comments about your typos instead of about your real problem.
Of course you are right. I didn't appreciate how bad it is. I mean, how
bad, bad, bad it is.
Will do, thanks.
Jim
------------------------------
Date: Fri, 20 Apr 2001 17:10:10 GMT
From: Dan Baker <dan@nospam_dtbakerprojects.com>
Subject: Re: Cookie/Hash help needed
Message-Id: <3AE06C24.E856C51B@nospam_dtbakerprojects.com>
Bryan Coon wrote:
>
> Thanks, that is very helpful. I will take another look to see about the
> array/value thing.
>
> Where can I find an example of the public API however?
--------------------
the docs on cookie() for the CGI module really are very good. It sould
be available from your installation of perl, or you can get the online
docs at http://www.perl.com/CPAN-local/doc/FAQs/FAQ/PerlFAQ.html
D
------------------------------
Date: Fri, 20 Apr 2001 17:00:54 +0200
From: Simon Stiefel <SiStie@nuclear-network.com>
Subject: Dynamic graphics generation
Message-Id: <3AE04F26.6B08036B@nuclear-network.com>
Hi,
Does someone have a howto of dynamic graphics generation with perl?
Background:
I have a picture of 800x400 pixels with 100 items to be generated
dynamically.
--
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: Fri, 20 Apr 2001 15:12:22 GMT
From: "s.petersson" <stefan@wirelessopinion.com>
Subject: Re: Dynamic graphics generation
Message-Id: <qlYD6.5635$sk3.1637177@newsb.telia.net>
> Does someone have a howto of dynamic graphics generation with perl?
use GD; # Instructions comes with the package...
> Background:
> I have a picture of 800x400 pixels with 100 items to be generated
> dynamically.
------------------------------
Date: 20 Apr 2001 15:59:24 GMT
From: tmerenes.dontspam@sybase.com
Subject: File path not getting resolved correctly.
Message-Id: <9bpmcs$3r5$1@news.netmar.com>
I'm running MKS perl in a WinNT 4.0 SP 6a DOS session.
The file path in the following statement does not get resolved correctly:
system ("isql -SDB2SOL -Utmerenes -PCOGRULES
-iD:\DC\12.00.03\236669\repro.sql");
I get this error:
Unable to open input file 'D:DC'.
[1] + Done(134) ?
461 Abort isql
epro.sql: not found
The following works OK if I copy repro.sql to the directory where I'm running
my perl script:
system ("isql -SDB2SOL -Utmerenes -PCOGRULES -irepro.sql");
Thanks in advance for your help,
Tom
----- Posted via NewsOne.Net: Free (anonymous) Usenet News via the Web -----
http://newsone.net/ -- Free reading and anonymous posting to 60,000+ groups
NewsOne.Net prohibits users from posting spam. If this or other posts
made through NewsOne.Net violate posting guidelines, email abuse@newsone.net
------------------------------
Date: 20 Apr 2001 16:08:14 GMT
From: steveo@panix.com (Steven M. O'Neill)
Subject: Re: File path not getting resolved correctly.
Message-Id: <9bpmte$178$1@news.panix.com>
<tmerenes.dontspam@sybase.com> wrote:
>I'm running MKS perl in a WinNT 4.0 SP 6a DOS session.
>
>The file path in the following statement does not get resolved correctly:
>
>system ("isql -SDB2SOL -Utmerenes -PCOGRULES
>-iD:\DC\12.00.03\236669\repro.sql");
>
>I get this error:
>
>Unable to open input file 'D:DC'.
it's the double quotes
--
Steven O'Neill steveo@panix.com
www.cars-suck.org
------------------------------
Date: Fri, 20 Apr 2001 10:24:57 -0400
From: Chris <chrisb@netvertising.com>
Subject: Formmail Doesn't always email
Message-Id: <3AE046B9.314DFE@netvertising.com>
Running Linux 2.2, Sendmail 8.9.3, and Apache 1.3.9..
Linux is configured with approx 12 virtual IP addresses. Apache is
configured to
use Virtual Hosting.
One of the web sites uses formmail. We were notified not all of the
emails are
being received. No clues in any log file, no dead.letter, no trace of
the
missing emails.
Upon further investigation I see sometimes the emails get sent sometimes
not
with no real pattern. Perhaps having to do with the entered 'email' on
the form
?. I did put every IP address in the server in the referers with no
effect.
When it doesn't send the maillog only records one entry. See log entries
below.
Apr 18 12:09:52 myhost sendmail[9673]: MAA09673: from=webuser, size=0,
class=0,
pri=0, nrcpts=0, msgid=<200104181609.MAA09673@myhost.mydomain.com>,
relay=webuser@localhost
When it does work I get both of the expected maillog entries.
Apr 18 12:15:33 dolcom2 sendmail[9733]: MAA09733: from=webuser,
size=408,
class=0, pri=30408, nrcpts=1,
msgid=<200104181615.MAA09733@myhost.mydomain.com>,
relay=webuser@localhost
Apr 18 12:15:34 dolcom2 sendmail[9735]: MAA09733:
to=boyd@kidney.nlm.nih.gov,
ctladdr=webuser (200/200), delay=00:00:01, xdelay=00:00:00,
mailer=esmtp,
relay=mail.nlm.nih.gov. [108.212.607.336], stat=Sent (Message queued)
I am stuck. Please help.
Thank you very much, Chris
------------------------------
Date: Fri, 20 Apr 2001 07:33:52 -0700
From: Ron Hill <hillr@ugs.com>
Subject: Re: Formmail Doesn't always email
Message-Id: <3AE048D0.ADAAE790@ugs.com>
Chris wrote:
[snipped]
> One of the web sites uses formmail. We were notified not all of the
> emails are being received. No clues in any log file, no dead.letter, no trace of
> the missing emails.
[snipped]
I would suggest contacting the author of formmail for this.
Ron
------------------------------
Date: Fri, 20 Apr 2001 15:58:17 +0200
From: "aaoaoaoaoaaaaaa" <mess@dds.nl>
Subject: Re: gmtime and daylight savings time?
Message-Id: <_fXD6.25296$XO5.2259960@news.soneraplaza.nl>
%day_counts =
(1,31,2,28,3,31,4,30,5,31,6,30,7,31,8,31,9,30,10,31,11,30,12,31);
($sec,$min,$hour,$day,$month,$year,$dayname,$daysbeen,$isdst) = gmtime();
$month+=1;
$year = $year + 1900;
if (int(($year-1600)/4) eq (($year-1600)/4)) {$day_counts{2}=29};
$hour += 2;
if($hour > 23) {$hour-=24;$day+=1};
if($day > $day_counts{$month}) {$day=1;$month+=1};
if($month > 12) {$month=1;$year+=1};
"Andrew Zhilenko" <andrew@nextra.cz> wrote in message
news:3AE00FE4.93DE4BD9@nextra.cz...
> Hello!
>
> Something is weird on my server (Solaris8). I want to convert
> local time into GMT time. Somehow it seems that perl functions
> ignore daylight savings time settings (even if it seems to be
> ok in OS):
> (I'm in Praha, it's Central European Time, which is now GMT+2):
>
> andrew@heimdall:/var/rrdtool$echo $TZ
> CET
> andrew@heimdall:/var/rrdtool$zdump GMT CET
> GMT Fri Apr 20 10:22:21 2001 GMT
> CET Fri Apr 20 12:22:21 2001 CEST
>
> andrew@heimdall:/var/rrdtool$perl test.pl
> Fri Apr 20 11:22:24 2001 GMT
> ^^ I was expecting 10 to be there...
> Fri Apr 20 12:22:24 2001 CEST
>
> andrew@heimdall:/var/rrdtool$cat test.pl
> #!/usr/bin/perl -w
> use locale;
> use POSIX qw(strftime);
> print strftime('%c GMT', gmtime)."\n";
> print strftime('%c %Z', localtime)."\n";
>
> Any suggestions?
>
> WBR, Andrew
> --
> Andrew Zhilenko, AZ283-RIPE
> System Manager
> Nextra Czech Republic, s.r.o. http://www.nextra.cz
> V Celnici 10 / CZ - 117 21 Praha 1 / Czech Republic
> Tel: +420/2/96 355 169
> E-Mail: andrew.zhilenko@nextra.com
> see Disclaimer http://www.nextra.cz/disclaimer/
------------------------------
Date: Fri, 20 Apr 2001 17:35:16 -0000
From: c_cruizer@my-deja.com_nospam (Cosmic Cruizer)
Subject: Grabbing file date and time
Message-Id: <Xns90896B80A232ccruizermydejacom@207.126.101.100>
I am reading file names from a unix directory into an array. I would also
like to read the date and time info into an array. I am using the following
to collect the file info:
push( @fileArray, $_) if (-f $_ );
I could do the same using either -M or -C to collect the time info, but I
would rather have the time listed as in the directory. I've created what
appears to be a very overly complicated regexp that reads each field in the
directory listing then grabs all the ones used for the date and time, but
there must be a way that is cleaner and quicker. Is there a flag that will
return the actual date and time or does anybody know of a sub I can use to
convert either -M or -C to a date format? The docs on localtime do not seem
to apply to what I'm trying to do.
------------------------------
Date: Fri, 20 Apr 2001 17:46:20 GMT
From: trammell@bayazid.hypersloth.invalid (John Joseph Trammell)
Subject: Re: Grabbing file date and time
Message-Id: <slrn9e0r9s.kk3.trammell@bayazid.hypersloth.net>
On Fri, 20 Apr 2001 17:35:16 -0000, Cosmic Cruizer wrote:
> I am reading file names from a unix directory into an array. I would also
> like to read the date and time info into an array.
You'd probably save some time if you used the builtin stat()
function, or perhaps the File::stat module.
------------------------------
Date: 20 Apr 2001 17:44:35 +0100
From: nobull@mail.com
Subject: Re: help for a basic hash value access question
Message-Id: <u966fzed1o.fsf@wcl-l.bham.ac.uk>
anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) writes:
> According to Gwyn Judd <tjla@guvfybir.qlaqaf.bet>:
>
> > to the list. Actually I'm not really sure you can take a reference to a
> > list, I think it would always be converted to an array reference.
>
> You get a list of references. The "\" operator distributes over
> a list. I have yet to find that useful...
The only place I often find it usefull is in subroutines that what to
modify their arguments.
sub foo {
my ($this,$that,$other) = \(@_);
$$this += $$that;
$$that = $$other;
}
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Fri, 20 Apr 2001 14:21:03 GMT
From: "Giorgio Silvestris" <gsilvestris@selin.it>
Subject: Re: hitcounter
Message-Id: <jBXD6.60234$s93.6025365@news.infostrada.it>
You can try with:
<a href="http://myserver/cgi-bin/catchme?link=foo>foo</a>
where catchme is a simple script that do what you want.
hello!
------------------------------
Date: Fri, 20 Apr 2001 15:01:45 +0200
From: Alexander Knack <ak@dasburo.de>
To: John Lin <johnlin@chttl.com.tw>
Subject: Re: How to deal with function pointers?
Message-Id: <3AE03339.CA215831@dasburo.de>
i don't know if this works with win32::API, but funcion pointers in perl
work like this:
my $bar = \&a;
&$bar(); # calls a()
sub a {
print "hello\n";
}
> use Win32::API;
> my $caller = new Win32::API('MyDLL','foo',[],P) or die $!;
> my $bar = $caller->Call;
> my $three = $bar->(); # This is not the code
------------------------------
Date: Fri, 20 Apr 2001 17:13:18 GMT
From: "smilepak" <smilepak@hotmail.com>
Subject: Re: https module
Message-Id: <O6_D6.1177$J74.161373@newsread1.prod.itd.earthlink.net>
The use of LWP::UserAgent should get me to connect to https and grab the
data I need?
<ros@ros.com> wrote in message news:3ae00999.501441@news.mundo-r.com...
> Should't work, or at least would be very agent-dependant
>
>
> You should use lwpcook. It has a module that works as a
> breeze.
>
> use LWP::UserAgent
>
> The documentation is in
> http://www.perldoc.com/perl5.6/lib/lwpcook.html
>
> Best wishes
> David Pardo
>
> On Fri, 20 Apr 2001 08:00:37 +0100, "Ciaran McCreesh"
> <keesh@users.pleaseremovethisbit.sourceforge.net> wrote:
>
> >In article <bsND6.600618$Pm2.9966350@news20.bellglobal.com>, "G. White"
> ><whiteg2000@hotmail.com> wrote:
> >> http://username:password@mysite.com
> >>
> >> I've never tried this with https but I'm guessing it should work.
> >
> >Probably not. It might, but it shouldn't. If the site is using https for
> >security, they should _require_ encrypted transactions. There's a big
> >diffence between supplying a username and password through HTTP (rfc2616)
> >using the authorisation stuff in rfc2617 and a full-blown https (rfc2260)
> >transaction.
> >
> >Essentially, https is http with some more headers thrown in. The problem
> >is, the http message usually contains another http message, which can be
> >encrypted in a number of ways, which contains the stuff you'd actually
> >want...
> >
> >Regards,
> >Ciaran
> >
> >--
> >Ciaran McCreesh
> >mail: keesh@users.sourceforge.net
> >web: http://www.opensourcepan.com/
>
>
------------------------------
Date: 20 Apr 2001 18:22:49 +0100
From: nobull@mail.com
Subject: Re: https module
Message-Id: <u9r8yncwpi.fsf@wcl-l.bham.ac.uk>
> Newsgroups: comp.lang.perl,comp.lang.perl.misc
comp.lang.perl does not exist.
"smilepak" <smilepak@hotmail.com> upside down and enigmatically:
> The use of LWP::UserAgent should get me to connect to https and grab the
> data I need?
Er, yes.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Fri, 20 Apr 2001 13:18:05 +0800
From: "John Lin" <johnlin@chttl.com.tw>
Subject: Idiom: the expression of a copied & substituted string
Message-Id: <9boir8$2ra@netnews.hinet.net>
Dear all,
I have encountered this problem for many times.
I would like to learn the idiomatic way of expressing this:
my $original = 'Good %, sir.';
my $copied1 = 'Good morning, sir.'; # s/%/morning/;
my $copied2 = 'Good afternoon, sir.'; # s/%/afternoon/;
I learned this from the book:
(my $copied = $original) =~ s/%/morning/;
But, actually this expression is "half done". Because
print ((my $copied = $original) =~ s/%/morning/);
the result is "1". If we push it to an array, or pass it as a parameter,
whatever, we are dealing with the "1" not the copied string.
So, the "fully done" expression should be
print do { (my $copied = $original) =~ s/%/morning/; $copied };
This is what I mean by "the expression of a copied & substituted string."
Oh, what a long and complex expression. Does Perl have an idiom for this?
Thank you very much.
John Lin
------------------------------
Date: 20 Apr 2001 15:05:28 GMT
From: steve@zeropps.uklinux.net (Steve)
Subject: LWP, getting the default index page name from a web directry.
Message-Id: <slrn9e0jup.u5v.steve@zero-pps.localdomain>
Hi
Using LWP, I can get content from web servers and parse it with
HTML::Parser etc, but the one thing that I can't get is the
name of the page that I'm getting if the input is just something
like "http://www.perl.com".
What I want to know is how to get the file name of the file that
the server gives me preferably without having to save the file
to disk.
I've tried a lot of stuff from the man pages for HTTP and LWP,
but havn't found anything that gives me what I want yet.
I'd be grateful for any suggestions.
--
Cheers
Steve email mailto:steve@zeropps.uklinux.net
%HAV-A-NICEDAY Error not enough coffee 0 pps.
web http://www.zeropps.uklinux.net/
or http://start.at/zero-pps
12:46pm up 77 days, 13:31, 2 users, load average: 1.00, 1.00, 1.00
------------------------------
Date: 20 Apr 2001 18:05:35 +0100
From: nobull@mail.com
Subject: Re: LWP, getting the default index page name from a web directry.
Message-Id: <u9zodbcxi8.fsf@wcl-l.bham.ac.uk>
steve@zeropps.uklinux.net (Steve) writes:
> Using LWP, I can get content from web servers and parse it with
> HTML::Parser etc, but the one thing that I can't get is the
> name of the page that I'm getting if the input is just something
> like "http://www.perl.com".
But the name of the page _is_ http://www.perl.com/
This has nothing to do with Perl.
The fact that the server may implement this by reading from a file
called index.html is none of your buisness.
This has nothing to do with Perl.
If the resource that is returned could also identified be more
precisely by another URI and the HTTP server chooses to give you this
information it can do so by putting it in the "Content-Location:"
header.
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.14
This has nothing to do with Perl.
If the HTTP server chooses not to give you this information then you
do not have this information. Most servers do not give out this
information.
This has nothing to do with Perl.
> I've tried a lot of stuff from the man pages for HTTP and LWP,
> but havn't found anything that gives me what I want yet.
This has nothing whatever to do with Perl or the implementation of the
HTTP protocol by LWP. This is a question about the HTTP protocol
itself.
> I'd be grateful for any suggestions.
I suggest that when you have questions about using a
module/library/tool that basically is just an implementation of a
protocol (such as LWP implementing HTTP) you should be prepared to
seek answers in the documentation of the protocol as well as the
documentation of the interface to the module/library/tool.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Fri, 20 Apr 2001 13:12:53 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Multi dimensional array dimensions
Message-Id: <sad0et03tvcbc03qvdfi19lfvej8c8of7d@4ax.com>
Randal L. Schwartz wrote:
>It's VERY RARE to ever need an array slice (@...[]) with a single element
>in the slice. It's so rare that it's a warnable (-w) offense.
It also triggers this very annoying warning for
@them = @foo{qw'ONE TWO THREE'};
(still in 5.6.0), i.e. thinking that qw'A B C' is just one item.
I don't see ANY reason for this warning, if the expression is evaluated
in list context. Ever. Not even if I do
@baz = map { something } @foo{BAR};
which means that my slice happens to contain just one item, but that
might change in the future.
--
Bart.
------------------------------
Date: 20 Apr 2001 18:14:16 +0100
From: nobull@mail.com
Subject: Re: Multi dimensional array dimensions
Message-Id: <u9y9svcx3r.fsf@wcl-l.bham.ac.uk>
merlyn@stonehenge.com (Randal L. Schwartz) writes:
> >>>>> "Jonas" == Jonas Nilsson <jonni@ifm.liu.se> writes:
>
> Jonas> $length_horizontal=@{@muxxer[0]};
>
> That's @{$muxxer[0]}.
>
> It's VERY RARE to ever need an array slice (@...[]) with a single element
> in the slice. It's so rare that it's a warnable (-w) offense.
As has been pointed out elsewhere in this thread that sometimes you
may be write code that currently needs only a single array element
but anticpates needing more in future.
However, returning to Jonas' example surely it's even more rare to
intensionally use a slice in a scalar context. Yet that doesn't yield
a warning.
I bet even most Perl programmers couldn't with certainty what the
semantics of a slice are in a scalar context without checking.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Fri, 20 Apr 2001 15:32:39 GMT
From: "JC Praud" <jc@nospampraud.com>
Subject: Net::POP3
Message-Id: <rEYD6.491$TA5.646249@nnrp1.proxad.net>
Hi all,
I've a trouble with Net::POP3 module: I can read emails from my server
(a QMail on Linux), but not from other servers...
Here the source:
$pop=Net::POP3->new($popserver);
$nbmesg=$pop->login($popaccount,$poppasswd);
## returned message number is empty
($nbmesg,$size)=$pop->popstat;
## returned info are also empty
$messages=$pop->list;
foreach $themail(keys(%$messages)){
...
What did I miss ?
------------------------------
Date: Fri, 20 Apr 2001 13:29:17 GMT
From: "Pujo C A" <adustipujo1@mediaone.net>
Subject: openfile
Message-Id: <NQWD6.29418$uh5.890129@typhoon.mw.mediaone.net>
Guys, I am new in perl , but struggling to know this powrfull langguage.
I want to open a file contain a data and create a hash from that table.
I can do it in perl script but when I do it in CGI it doesnt work?
file testfil contain sid, firstname and lastnake seperate with tab.
perl code:
#!/usr/bin/perl
# ttt.pl
# Displays your data in a Web browser.
use warnings;
use strict;
use CGI qw( :standard);
my $word = param("userid");
my ($sid,$fname,$lname);
open(GRADES, "+<testfil") or die "can not open grades: $!\n";
while ( defined( my $record = <GRADES>) ) {
($sid,$fname,$lname) = split (" ", $record);
$grades{$sid} .= $fname . " ";
my @grades = split (" ", $grades{$sid});
my $name = "$fname, $lname";
}
close(GRADES);
print header(), start_html (' Hello baru');
print p ( 'Your record is');
print start_form(), textfield("word");
print submit ("SUBMIT"),end_form();
if($sid == $word){
print p( ' HALLO', $name) if $sid;
print "your Student ID is: $sid\t yourname is: $fname\t$lname\n";}
print end_html();
any suggestion?
thanks
PUJO
------------------------------
Date: 20 Apr 2001 18:29:52 +0100
From: nobull@mail.com
Subject: Re: openfile
Message-Id: <u9oftrcwdr.fsf@wcl-l.bham.ac.uk>
"Pujo C A" <adustipujo1@mediaone.net> writes:
> Guys, I am new in perl , but struggling to know this powrfull
> langguage.
But not everything you experience while using Perl will be related to
Perl.
> I want to open a file contain a data and create a hash from that table.
> I can do it in perl script but when I do it in CGI it doesnt work?
So your first though should be that the reason will not be related to
your choice of programming language.
When it "doesn't work" does soemthing happen or does the univers
simply end? Do you see errors in the log?
> open(GRADES, "+<testfil") or die "can not open grades: $!\n";
Random shot in the dark: Your web server s/w is running the script
with a different current directory or with a user ID that lacks write
permission to 'testfil'.
> while ( defined( my $record = <GRADES>) ) {
> ($sid,$fname,$lname) = split (" ", $record);
> $grades{$sid} .= $fname . " ";
> my @grades = split (" ", $grades{$sid});
> my $name = "$fname, $lname";
> }
> close(GRADES);
BTW: Why did you open the file read/write?
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
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 728
**************************************