[17620] in Perl-Users-Digest
Perl-Users Digest, Issue: 5040 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Dec 5 18:10:38 2000
Date: Tue, 5 Dec 2000 15:10:15 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <976057814-v9-i5040@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 5 Dec 2000 Volume: 9 Number: 5040
Today's topics:
R: print, CGI and socket! <artax@shineline.it>
regular expression puzzle <nospam@nospam.com>
Re: regular expression puzzle (Chris Fedde)
Removing leading spaces <jmilley@tera.engr.mun.ca>
Re: Retrieving Files from a Linux Parition to DOS/NT (Lou Hevly)
sorting an array of hashes (cont'd) <kcount@ardenhouse.com>
Re: sorting an array of hashes <kcount@ardenhouse.com>
Re: Statistics for comp.lang.perl.misc (Philip 'Yes, that's my address' Newton)
Re: Triva Game via Perl (Chris Fedde)
Re: which linux for Perl 5.6? (Tim Hammerquist)
Re: which linux for Perl 5.6? <godoy@conectiva.com>
Re: Your help please <peter.sundstrom@eds.com>
Zip files in a directory by zipping directory aldenave@hotmail.com
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 5 Dec 2000 22:34:30 +0100
From: "Federico" <artax@shineline.it>
Subject: R: print, CGI and socket!
Message-Id: <3a2d5f99_1@news.telnetwork.it>
.. ho interesting but how can i know that the image on the bottom of the pae
has been downloaded from that IP-user??? How can i create e file with al the
reports of the downloaded images?
Thank you,
Federico.
<nobull@mail.com> wrote in message u9u28i7lz4.fsf@wcl-l.bham.ac.uk...
> "Federico" <artax@shineline.it> writes:
>
> > I need to know ('cause i have to do a statistics report) if the
> > print in CGI environment of a HTML page, ie to a browser, has been
> > well finished or in other words if the final user has receive all
> > the page or went away before cause for example a long
> > delay. Somebody know how to do?
>
> I would suggest employing a private detective to stand behind the user
> and look over this shoulder.
>
> Actaully, a small <IMG> at the bottom of the page is probably the
> simplest solution. If the image gets loaded then you know the page
> got though to a user-agent. You'll also need a <IMG> at the top of
> the page as a control so that you can exclude users with image loading
> disabled from your stats.
>
> > i have thought to write in a file at the end of the print as follow:
>
> No that's useless. All that proves is that the data was printed by
> the CGI script.
>
> --
> \\ ( )
> . _\\__[oo
> .__/ \\ /\@
> . l___\\
> # ll l\\
> ###LL LL\\
------------------------------
Date: Tue, 5 Dec 2000 14:50:48 -0500
From: "Martin" <nospam@nospam.com>
Subject: regular expression puzzle
Message-Id: <90jgup$6di$1@bmerhc5e.ca.nortel.com>
Hi,
I have a string with new line characters (\n).
Is it possible to use regexp on this string? Problem is that .* (dot star)
does not match a new line.
Martin
------------------------------
Date: Tue, 05 Dec 2000 20:18:34 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: regular expression puzzle
Message-Id: <u4cX5.76$T3.170846720@news.frii.net>
In article <90jgup$6di$1@bmerhc5e.ca.nortel.com>,
Martin <nospam@nospam.com> wrote:
>Hi,
>
>I have a string with new line characters (\n).
>
>Is it possible to use regexp on this string? Problem is that .* (dot star)
>does not match a new line.
>
>Martin
>
Read about the 'm' and 's' modifyers in the perlre manual page.
Good Luck
chris
--
This space intentionally left blank
------------------------------
Date: 5 Dec 2000 22:13:49 GMT
From: Jonathan MILLEY <jmilley@tera.engr.mun.ca>
Subject: Removing leading spaces
Message-Id: <90jpat$eta$1@coranto.ucs.mun.ca>
I'm trying to find an effective way to trim leading spaces from
a string.
What I'm doing is I have a script which reads a html page source
file and a template file and fills in the appropriate feilds,
but I allways end up with an extra space at the beginning of each
of my feilds. so instead of getting "./school.html" I get
" ./school.html" this isn't such a big problem, except it prevents
my cgi scripts from executing properly.
Any and all suggestions are welcome.
Thanks,
Jonathan Milley
--
=================================================================
Jonathan Milley jmilley@engr.mun.ca CE Class of 2003
Memorial University of Newfoundland
St. John's, Newfoundland, Canada
Visit my website @ http://jmilley.cjb.net
=================================================================
------------------------------
Date: Tue, 05 Dec 2000 22:29:52 GMT
From: lou@visca.com (Lou Hevly)
Subject: Re: Retrieving Files from a Linux Parition to DOS/NT
Message-Id: <3a2d8897.214656275@news.wanadoo.es>
Wayne Watson <mtn_view@sirius.com> wrote:
>Let me simplify the question.
No need. Though not an expert, I believe I can safely say that the
answer to your Perl question is, "No, Perl can't do this."
<OT>Do a search on Google for explore2fs, the Linux file system
explorer for Windows NT (and 9x) by John Newbigin.</OT>
--
All the best,
Lou Hevly
lou@visca.com
http://www.visca.com
------------------------------
Date: Tue, 5 Dec 2000 16:58:40 -0500
From: "kcount" <kcount@ardenhouse.com>
Subject: sorting an array of hashes (cont'd)
Message-Id: <90jo9c$jju$1@news.warwick.net>
"my @sorted = sort { $a->{'last'} cmp $b->{'last'} }
map { my ($last) = ($_->{'MemberName'} =~ /(\w+$)/);
$_->{'last'} = $last;
$_; } @array_of_hashes;"
Thank you very much! that worked perfectly. Next question....
When I sort on my regexed last name, a few times i have a name that's
similar to Kelly Smith III, (like Kelly Smith the 3rd.). The regex i am
using now is /(\S+$)/. what kind of regex can i use to extract the last
name, but take the next one to the left if the case turns out like the
example above? i suppose i'd have to disregard any combination of Roman
numerals. Any input would be greatly appreciated. Thanks Again!!!
Kip
------------------------------
Date: Tue, 5 Dec 2000 15:39:03 -0500
From: "kcount" <kcount@ardenhouse.com>
Subject: Re: sorting an array of hashes
Message-Id: <90jjmv$kra$1@news.warwick.net>
Thank you very much. that worked perfectly. Next question....
When I sort on my regexed last name, a few times i have a name that's
similar to Kelly Smith III, (like Kelly Smith the 3rd.). The regex i am
using now is /(\S+$)/. what kind of regex can i use to extract the last
name, but take the next one to the left if the case turns out like the
example above? i suppose i'd have to disregard any combination of Roman
numerals. Any input would be greatly appreciated. Thanks Again!!!
Kip
------------------------------
Date: Tue, 05 Dec 2000 20:21:49 GMT
From: nospam.newton@gmx.li (Philip 'Yes, that's my address' Newton)
Subject: Re: Statistics for comp.lang.perl.misc
Message-Id: <3a2d3171.250709579@news.tiscalinet.de>
On Mon, 04 Dec 2000 16:34:40 -0000, Greg Bacon <gbacon@cs.uah.edu>
wrote:
> Following is a summary of articles spanning a 7 day period,
> beginning at 27 Nov 2000 16:50:04 GMT and ending at
> 04 Dec 2000 13:17:01 GMT.
>
> Top 10 Posters by Number of Posts
> =================================
>
> (kb) (kb) (kb) (kb)
> Posts Volume ( hdr/ body/ orig) Address
> ----- -------------------------- -------
>
> 80 152.0 ( 59.8/ 81.1/ 49.7) Tad McClellan <tadmc@metronet.com>
> 47 74.1 ( 34.2/ 36.4/ 22.7) nobull@mail.com
> 33 45.1 ( 28.4/ 16.5/ 10.0) Bart Lateur <bart.lateur@skynet.be>
> 31 62.3 ( 29.0/ 33.3/ 9.8) "John Boy Walton" <johngros@Spam.bigpond.net.au>
> 27 45.8 ( 22.6/ 22.8/ 12.5) Joe Schaefer <joe+usenet@sunstarsys.com>
> 27 45.4 ( 19.6/ 24.8/ 14.2) Chris Fedde <cfedde@fedde.littleton.co.us>
> 25 97.5 ( 18.7/ 77.9/ 77.9) PerlFAQ Server <faq@denver.pm.org>
Number 7. Will it go higher?
> Bottom 10 Posters by OCR (minimum of five posts)
> =================================================
>
> (kb) (kb)
> OCR orig / body Posts Address
> ----- -------------- ----- -------
>
> 0.431 ( 5.2 / 12.1) 8 OTR Comm <otrcomm***NO-SPAM***@wildapache**NO-SPAM***.net>
> 0.429 ( 1.5 / 3.5) 6 "Philip 'Yes, that's my address' Newton" <nospam.newton@gmx.li>
> 0.412 ( 6.9 / 16.7) 9 "Ed Grosvenor" <secursrver@hotmail.com>
> 0.410 ( 5.2 / 12.6) 13 abigail@foad.org
Now that Abigail seems to use nearly only ++ as a quote prefix, she's
dropped quite a bit in the OCR scale (number 7) -- though I note that
being number 9 is not so hot, either. (On the other hand, I'm probably
not doing much to improve my score with this post.)
Cheers,
Philip
--
Philip Newton <nospam.newton@gmx.li>
If you're not part of the solution, you're part of the precipitate.
------------------------------
Date: Tue, 05 Dec 2000 20:14:35 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: Triva Game via Perl
Message-Id: <L0cX5.75$T3.170846720@news.frii.net>
In article <0k0q2t8e99j07vvqbkqoql8i0psanf6fdc@4ax.com>,
Lou Moran <lmoran@wtsg.com> wrote:
>---I have this idea I will write a trivia game with perl.
>
>#!/usr/bin/perl -w
>use strict;
>
>print "Welcome to the Trivia Game\n\n";
>print "Answer questions with one uppercase number, \n\n";
>
>
>---The perl question is I would want to maintain the question and
>answer database somewhere else to add and subtract questions. I know
>how to read a list (ala Secret Word List in LP on Win32 Syetems) but I
>don't know how to get list info to display <print> (or better yet make
>it "become" HTML code, in fact I have no idea how to make anything
>HTML in perl.) I have looked in perldoc but like find in *nix I
>haven't really mastered that (and I lent someone who can actually do
>useful things with perl my LPOW32S book.)
>
Unless I've missed the mark, it seems that you have a bit of learning
ahead of you before you can comfortably tackle this project. Get
your Learning Perl book back and keep at it. It's realy not all
that hard. In the mean time take a look at the code below.
BTW. What's an "uppercase number"?
chris
#!/usr/bin/perl
use Term::ReadKey;
ReadMode('cbreak');
$SIG{__DIE__} = sub{ReadMode(0)};
$/="";
while (true){
last if (eof(DATA));
my $question = <DATA>;
my $answer = <DATA>;
REDO:
print "$question\n";
my $guess = ReadKey 0;
print "$guess\n";
if ($guess == $answer) {
print "Got it right!\n";
} else {
print "~guess again\n";
goto REDO;
}
}
ReadMode(0);
__DATA__
What is my favorite color?
1: Blue
2: Green
3: Red
4: Yellow
3
How many fingers am I holding up?
1: 3
2: 4
3: 5
2
How much wood would a wood chuck chuck?
1: a cord
2: a board
3: as much as a wood chuck could
3
--
This space intentionally left blank
------------------------------
Date: Tue, 05 Dec 2000 22:00:40 GMT
From: tim@degree.ath.cx (Tim Hammerquist)
Subject: Re: which linux for Perl 5.6?
Message-Id: <slrn92qps9.tl0.tim@degree.ath.cx>
Dela Lovecraft <dela@nospam.ukonline.co.uk> wrote:
> > So, which is the best linux dist for me so I ca play with the latest and
> > greatest Perl?
>
> Mandrake Linux comes with 5.6, and is a very good distro. You say you
> are new to Linux as well...? Mandrake is a very good first one to use, and
> helps a lot with configuration of hardware etc. Worth a look.
FYI: Mandrake Linux (MDK) version 7.0 comes with Perl 5.005_03. The
latest (MDK 7.2) _does_ have Perl 5.6.
Please include all applicable version numbers when asking or answering
questions. Many stores still have obsolete Linux distros; I saw RH 5
right in a rather well-known chain of bookstores a couple weeks ago.
Good luck to all!
--
-Tim Hammerquist <timmy@cpan.org>
Life is too serious to be taken seriously.
-- Mike Leonard
------------------------------
Date: 05 Dec 2000 20:00:20 -0200
From: Jorge Godoy <godoy@conectiva.com>
Subject: Re: which linux for Perl 5.6?
Message-Id: <kpelzmlea3.fsf@dagon.conectiva>
On Tue, 05 Dec 2000, dela@nospam.ukonline.co.uk wrote:
>
>> I want to choose a linux dist for my desktop, and want one with the
>> current perl release. I see the stable debian only has up to
>> 5.004...
>
> Well, I am using Storm Linux 2000 which comes with Perl 5.004. But I
> have downloaded and installed the Perl 5.6 packages from debian.org
> unstable branch, and I have found no problems at all with it.
You can also get Conectiva Linux 6.0 with Perl 5.6.0 (optionally with
5.00503 and even both together at same time).
It's available at ftp://ftp.conectiva.com or several mirrors (such as
nl.linux.org, and ibiblio.org).
You'll get a bonus of having apt with RPM available. ;-)
(See freshmeat.net and slashdot.org on this subject)
See you,
--
Godoy. <godoy@conectiva.com>
Departamento de Publicações Conectiva S.A.
Publishing Department Conectiva Inc.
------------------------------
Date: Wed, 6 Dec 2000 10:04:21 +1300
From: "Peter Sundstrom" <peter.sundstrom@eds.com>
Subject: Re: Your help please
Message-Id: <90jl8p$cnu$1@hermes.nz.eds.com>
Katie Foster <katie.foster@bt.com> wrote in message
news:90if3b$61i$1@pheidippides.axion.bt.co.uk...
> I haven't been doing Perl very long, so I was hoping someone on here could
> help me, please.
>
> My group have upgraded from Perl 3 to Perl 5.05. Some of our scripts no
> longer work, I have fixed some of them, but have come accross a problem
with
> one particular script.
Are you absolutely sure you had Perl 3? I would be *very* surprised if that
was the case.
------------------------------
Date: Tue, 05 Dec 2000 18:58:08 GMT
From: aldenave@hotmail.com
Subject: Zip files in a directory by zipping directory
Message-Id: <90jdrr$hjo$1@nnrp1.deja.com>
I am looking for PERL code that will enable me to zip individual files
within a directory by just zipping the directory proper. e.g. I have
a directoy with 5 thousand files. I want each file to be zipped but I
do not want to go in and zip each file one at a time. Ask suggestions
or recomendations? Zipping the entire directory proper is not an
option. Each file must be seperately zipped. Thanks
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
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 5040
**************************************