[18146] in Perl-Users-Digest
Perl-Users Digest, Issue: 314 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Feb 19 09:05:33 2001
Date: Mon, 19 Feb 2001 06:05:11 -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: <982591511-v10-i314@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 19 Feb 2001 Volume: 10 Number: 314
Today's topics:
[Perl] How to find the Perl FAQ <rootbeer&pfaq*finding*@redcat.com>
Re: DB_File Please help (Anno Siegel)
delete lock file, possible race condition or dead lock? <johnlin@chttl.com.tw>
Re: directing system() output to a var (Anno Siegel)
Re: directing system() output to a var (Helgi Briem)
Re: directing system() output to a var (Anno Siegel)
How to get ProcesID <miha.andrejasic@ijs.si>
Re: How to get ProcesID (Anno Siegel)
Re: Invisible code? <bart.lateur@skynet.be>
Re: Invisible code? (Anno Siegel)
Re: Invisible code? (Anno Siegel)
Re: Linda, this is cool! <fellowsd@cs.man.ac.uk>
Linux, Perl, CommPort - 28800 baud <nic@pierwsza.pl>
Need help creating a simple class. <c.manley@chello.nl>
Re: Need help creating a simple class. <beable@my-deja.com>
newbie regex linebreaks problem <"goodrow"@opencity. com>
Re: newbie regex linebreaks problem <beable@my-deja.com>
Re: PERL Request (Abigail)
Re: PERL Request <bart.lateur@skynet.be>
Re: PerlScript documentation and reference ? <miguenther@lucent.com>
Programmers needed for creating the best chat program f <mark@mediamedia.nl>
Re: PROPOSAL: Graphics::ColorNames (Abigail)
Re: PROPOSAL: Graphics::ColorNames <iltzu@sci.invalid>
Re: Specifying the length of regular expression <ianb@ot.com.au>
Re: Stat and dir test help needed (Martien Verbruggen)
Treating chat server array <mark@mediamedia.nl>
Wanted: Image Magic for dummies <founder@pege.org>
Re: Wanted: Image Magic for dummies <tom_perkin@nospamplease.hotmail.com>
Re: Wanted: Image Magic for dummies <founder@pege.org>
Re: When is an array @f allowed in a string? (Eric Bohlman)
Re: When is an array @f allowed in a string? <wizard@bostonhot.com>
Re: Why can't I grab this URL? (Anno Siegel)
Re: Writing a Perl Server <bart.lateur@skynet.be>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 19 Feb 2001 11:20:35 GMT
From: Tom Phoenix <rootbeer&pfaq*finding*@redcat.com>
Subject: [Perl] How to find the Perl FAQ
Message-Id: <pfaqmessage982581840.25087@news.teleport.com>
Archive-name: perl-faq/finding-perl-faq
Posting-Frequency: weekly
Last-modified: 29 Apr 2000
[ That "Last-modified:" date above refers to this document, not to the
Perl FAQ itself! The last _major_ update of the Perl FAQ was in Summer
of 1998; of course, ongoing updates are made as needed. ]
For most people, this URL should be all you need in order to find Perl's
Frequently Asked Questions (and answers).
http://www.cpan.org/doc/FAQs/
Please look over (but never overlook!) the FAQ and related docs before
posting anything to the comp.lang.perl.* family of newsgroups.
For an alternative way to get answers, check out the Perlfaq website.
http://www.perlfaq.com/
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
Beginning with Perl version 5.004, the Perl distribution itself includes
the Perl FAQ. If everything is pro-Perl-y installed on your system, the
FAQ will be stored alongside the rest of Perl's documentation, and one
of these commands (or your local equivalents) should let you read the FAQ.
perldoc perlfaq
man perlfaq
If a recent version of Perl is not properly installed on your system,
you should ask your system administrator or local expert to help. If you
find that a recent Perl distribution is lacking the FAQ or other important
documentation, be sure to complain to that distribution's author.
If you have a web connection, the first and foremost source for all things
Perl, including the FAQ, is the Comprehensive Perl Archive Network (CPAN).
CPAN also includes the Perl source code, pre-compiled binaries for many
platforms, and a large collection of freely usable modules, among its
560_986_526 bytes (give or take a little) of super-cool (give or take
a little) Perl resources.
http://www.cpan.org/
http://www.perl.com/CPAN/
http://www.cpan.org/doc/FAQs/FAQ/html/
http://www.perl.com/CPAN/doc/FAQs/FAQ/html/
You may wish or need to access CPAN via anonymous FTP. (Within CPAN,
you will find the FAQ in the /doc/FAQs/FAQ directory. If none of these
selected FTP sites is especially good for you, a full list of CPAN sites
is in the SITES file within CPAN.)
California ftp://ftp.cdrom.com/pub/perl/CPAN/
Texas ftp://ftp.metronet.com/pub/perl/
South Africa ftp://ftp.is.co.za/programming/perl/CPAN/
Japan ftp://ftp.dti.ad.jp/pub/lang/CPAN/
Australia ftp://cpan.topend.com.au/pub/CPAN/
Netherlands ftp://ftp.cs.ruu.nl/pub/PERL/CPAN/
Switzerland ftp://sunsite.cnlab-switch.ch/mirror/CPAN/
Chile ftp://ftp.ing.puc.cl/pub/unix/perl/CPAN/
If you have no connection to the Internet at all (so sad!) you may wish
to purchase one of the commercial Perl distributions on CD-Rom or other
media. Your local bookstore should be able to help you to find one.
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
Comments and suggestions on the contents of this document
are always welcome. Please send them to the author at
<pfaq&finding*comments*@redcat.com>. Of course, comments on
the docs and FAQs mentioned here should go to their respective
maintainers.
Have fun with Perl!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 19 Feb 2001 08:28:38 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: DB_File Please help
Message-Id: <96qlfm$f2v$1@mamenchi.zrz.TU-Berlin.DE>
Paul Dortman <paul@pco.iis.nsk.su> wrote in comp.lang.perl.misc:
>Thank you for help, Chris.
>
> But could you give little more information on how can I get information on
>version of Berkeley DB.
>And how can I get documentation on Berkeley DB ?
www.sleepycat.com has all you need.
[full quote of article deleted]
Please, when you reply to an article, put your reply below the quoted
material you are replying to and trim what you are not replying to
(at least, trim the signature).
Anno
------------------------------
Date: Mon, 19 Feb 2001 20:54:01 +0800
From: "John Lin" <johnlin@chttl.com.tw>
Subject: delete lock file, possible race condition or dead lock?
Message-Id: <96r54a$kr7@netnews.hinet.net>
Dear all,
For some reason (to keep the directory clean) I have to delete
the lock file after locking. So I adapt the traditional
open-flock-close sequence into test-open-flock-close-unlink:
use strict;
use Fcntl ':flock';
my $lockfile = 'lock.file';
$| = 1;
for(1..3) {
fork; # to simulate multi-access
if(-f $lockfile) { print "$lockfile exists\n"; next }
local *F;
if(not open F,"+>$lockfile") { print "can't open\n"; next }
if(not flock F,LOCK_EX) { print "can't lock\n"; next }
print sleep 1 for 1..3; # do something here
close F;
unlink $lockfile;
}
Could this extra action (delete the lock file) cause race condition
or dead lock? I am not sure by eye-checking, but experiments seem
to show that it is OK.
What is your opinion?
Thank you very much.
John Lin
------------------------------
Date: 19 Feb 2001 10:41:41 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: directing system() output to a var
Message-Id: <96qt95$nu3$2@mamenchi.zrz.TU-Berlin.DE>
Rudolf Polzer <grauezellen@gibts.net> wrote in comp.lang.perl.misc:
>my $out = `perl -e "systen '$cmd';"`;
The typo in "systen" and the single quotes around the variable tell me
this is probably not a joke.
Anno
------------------------------
Date: Mon, 19 Feb 2001 11:08:16 GMT
From: helgi@NOSPAMdecode.is (Helgi Briem)
Subject: Re: directing system() output to a var
Message-Id: <3a90fd5a.848921684@news.itn.is>
On Sun, 18 Feb 2001 08:31:45 GMT, dave <dave@netterra.com>
wrote:
>Ok I'm stuck on this one. I'm writing a script to ping a host and report
>back the avg ping. I'v been calling ping with
>
>system("ping -c 1 $host |grep time") #the grep is to get the output
>down to the line I want.
>
>but system() outputs to <STDOUT> and I can assign its output to a var,
>how can I get this to work.
>
You can direct output from an external command to
a variable using backticks: my $output = `$command`; or
the qx operator, for example: my @output = qx/$command/;
However, in this particular case you are probably better
off using the Net::Ping module. It gives you more portable
and robust code.
Regards,
Helgi Briem
------------------------------
Date: 19 Feb 2001 11:21:55 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: directing system() output to a var
Message-Id: <96qvkj$nu3$3@mamenchi.zrz.TU-Berlin.DE>
Helgi Briem <helgi@NOSPAMdecode.is> wrote in comp.lang.perl.misc:
>On Sun, 18 Feb 2001 08:31:45 GMT, dave <dave@netterra.com>
>wrote:
>
>>Ok I'm stuck on this one. I'm writing a script to ping a host and report
>>back the avg ping. I'v been calling ping with
>>
>>system("ping -c 1 $host |grep time") #the grep is to get the output
>>down to the line I want.
>>
>>but system() outputs to <STDOUT> and I can assign its output to a var,
>>how can I get this to work.
>>
>You can direct output from an external command to
>a variable using backticks: my $output = `$command`; or
>the qx operator, for example: my @output = qx/$command/;
>
>However, in this particular case you are probably better
>off using the Net::Ping module. It gives you more portable
>and robust code.
Net::Ping is *not* a one-to-one replacement of the system ping. With
Net::Ping you have the choice of three ping methods: icmp, udp and tcp.
While icmp is what the ping command uses, it needs root privilege to
run (that's why /bin/ping is set-uid to root), something you don't
want to impose on a random script without good reason. The other two
are different methods and give different results in general. Moreover,
the udp implementation of Net::Ping suffers from a bug.
While it is generally true that using a dedicated module is preferable
to calling an external command, Net::Ping is one of the exceptions.
Anno
------------------------------
Date: Mon, 19 Feb 2001 10:16:26 +0100
From: Miha Andrejasic <miha.andrejasic@ijs.si>
Subject: How to get ProcesID
Message-Id: <3A90E46A.27A8C17F@ijs.si>
--------------EF28F524743EE068622C2F8B
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Hello!
I got one simple question. If I start a background process with one of
my perl scripts using command 'system',
how can I get a PID (process ID) of that process. I would need that if I
would like to terminate that
process using perl script.
Thanx for answers!
--
miha
--------------EF28F524743EE068622C2F8B
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Hello!
<p>I got one simple question. If I start a background process with one
of my perl scripts using command 'system',
<br>how can I get a PID (process ID) of that process. I would need that
if I would like to terminate that
<br>process using perl script.
<p>Thanx for answers!
<pre>--
miha</pre>
</html>
--------------EF28F524743EE068622C2F8B--
------------------------------
Date: 19 Feb 2001 09:59:31 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: How to get ProcesID
Message-Id: <96qqq3$nu3$1@mamenchi.zrz.TU-Berlin.DE>
Miha Andrejasic <miha.andrejasic@ijs.si> wrote in comp.lang.perl.misc:
>-=-=-=-=-=-
>
>Hello!
>
>I got one simple question. If I start a background process with one of
>my perl scripts using command 'system',
>how can I get a PID (process ID) of that process.
You can't and you don't need to. system() only returns when the
background process has terminated, so the PID would be useless
once you get it.
> I would need that if I
>would like to terminate that
>process using perl script.
You don't get a chance to do so. If you want to control a process
while it is running, use fork or an equivalent open. These *do* give
you the PID.
Anno
------------------------------
Date: Mon, 19 Feb 2001 08:48:07 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Invisible code?
Message-Id: <fbn19tgsar67pfj0ma0l0kta979r2jsgaq@4ax.com>
Jim Kroger wrote:
>open(DATA, "file");
>open(SPLIT, ">airfilelist");
>while (<DATA>) { <
> $temp = "func_an/${_}"; <
> @ffile = (@ffile, $temp); <
>} <
>@ffile = ($ffile[0], @ffile);
>print SPLIT @ffile;
The only reason why it should skip that loop, is because either the file
never got opened (check the return vcalue of the open(), and print out
$! if it failed), or that it is empty.
Besides:
> @ffile = (@ffile, $temp); <
This is the same as
push @ffile, $temp;
>@ffile = ($ffile[0], @ffile);
This is the same as
unshift @ffile, $ffile[0];
I'm not sure why you want to duplicate the first item, anyway.
--
Bart.
------------------------------
Date: 19 Feb 2001 09:03:26 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Invisible code?
Message-Id: <96qngu$f2v$2@mamenchi.zrz.TU-Berlin.DE>
Chris Fedde <cfedde@fedde.littleton.co.us> wrote in comp.lang.perl.misc:
>In article <minorseventhSPAMBLOCK-1802012249330001@tritone.csbmb.princeton.edu>,
>Jim Kroger <minorseventhSPAMBLOCK@earthlink.net> wrote:
>>> You need to use some name other then DATA for the filehandle -- this is a
>>> 'global special filehandle', which refers to anything following the __END__
>>> token in the file containing the script.
[...]
>>Wow, I found a bug. I think I could put this on my resume.
>>
>>Thanks much! I certainly appreciate your help...
>>
>>Jim
>>
>
>While this might have been a problem in previous Perls it does not appear
>to be a problem in 5.6.0. Here at least the code works as expected, once
>the extranious '<' characters are removed. The DATA handle looses it's
>special meaning when it is used in an open.
The only thing special about the DATA filehandle is that it is pre-opened
to the Perl source file and pre-positioned to the place after __DATA__ (or
__END__). You can re-open it any time and after that it isn't special
in any way. To my knowledge there has never been a problem with this.
Anno
------------------------------
Date: 19 Feb 2001 09:08:33 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Invisible code?
Message-Id: <96qnqh$f2v$3@mamenchi.zrz.TU-Berlin.DE>
Damian James <damian@qimr.edu.au> wrote in comp.lang.perl.misc:
[about the DATA filehandle]
>OK. I guess I had assumed that you'd have to localise it or something. But
>even so, with the OP's code above the filehandle would still try to read
>from after __END__ without an error should the first open() ever fail, not so?
Not so. Either a test or a look at perldoc -f open would have told
you so.
When a filehandle is re-opened, the currently open file is closed first,
before the error on the new open is detected.
Anno
------------------------------
Date: Mon, 19 Feb 2001 10:52:09 +0000
From: "Donal K. Fellows" <fellowsd@cs.man.ac.uk>
Subject: Re: Linda, this is cool!
Message-Id: <3A90FAD9.B54BCFF6@cs.man.ac.uk>
Hartmann Schaffer wrote:
> frankly, i doubt this. most of those spams are so inept that i would be
> surprised if it generates any sales. the only thing that seems to generate
> sales are those spam generators (to clueless idiots)
Every time I think I've finally discovered just how stupid some people can
be, I'm unpleasantly surprised by some new asininity...
Donal.
--
Donal K. Fellows http://www.cs.man.ac.uk/~fellowsd/ fellowsd@cs.man.ac.uk
-- If somebody in a suit or a uniform can sit you down and have you believe
every word he says, you've just surrendered your license to be a thinking
human being and traded it in for a zombie suit. -- mhoye@prince.carleton.ca
------------------------------
Date: Mon, 19 Feb 2001 14:59:42 +0100
From: Jacek Chmielewski <nic@pierwsza.pl>
Subject: Linux, Perl, CommPort - 28800 baud
Message-Id: <3A9126CE.4040609@pierwsza.pl>
Witam Mam problem, jak pod Linuxem w Perlu ustawic szybkosc portu na
28800 bodow? setserial czy stty pozwalaja na ustawienie tylko
standardowych predkosci i 28800 nie przyjmuja... Poza tym potrzebowalbym
konstukcji pozwalajacej na stworzenie waktu oczekujacego i odbierajacego
przychodzace na port dane.
Hi
How to set comm port (serial, RS) speed to 28800 baud.
'setserial' & 'stty' allow only to choose standard speeds, but no 28800.
I'm using RedHat 7.0
Thanks in advance
Jacek
------------------------------
Date: Mon, 19 Feb 2001 14:50:00 +0100
From: Craig Manley <c.manley@chello.nl>
Subject: Need help creating a simple class.
Message-Id: <3A912488.756FC4DF@chello.nl>
Hi all,
I've been trying to create a test class called Person that works as
shown in the example below but can't get it right (using tie etc). Could
somebody please supply me with a simple class to get going.
Thanks,
Craig Manley
use strict;
use Person;
my $dude = new Person(0); # Parameter is age
$dude->{'age'} = 10; # Setting $dude->{'age'} must cause
$dude->{'height'} to be set to 10 * $dude->{'age'}.
print "Person's height is now " . $dude->{'height'} . "\n";
$dude->{'age'} = 20;
print "Person's height is now " . $dude->{'height'} . "\n";
$dude->{'age'} = -1; # This should cause $dude to croak.
print "Person's height is now " . $dude->{'height'} . "\n";
------------------------------
Date: Mon, 19 Feb 2001 14:09:55 GMT
From: Beable van Polasm <beable@my-deja.com>
Subject: Re: Need help creating a simple class.
Message-Id: <m3d7ceojox.fsf@beable.van.polasm.bigpond.net.au>
Craig Manley <c.manley@chello.nl> writes:
> Hi all,
>
> I've been trying to create a test class called Person that works as
> shown in the example below but can't get it right (using tie etc). Could
> somebody please supply me with a simple class to get going.
Have you seen the example in "Tom's object-oriented tutorial for perl"?
Read this:
perldoc perltoot
cheers
Beable van Polasm
--
I'm bloody tired of you nut-jobs always whining about Einstein.
-- Daniel Buettner
IQC 78189333
http://members.nbci.com/_______/index.html
------------------------------
Date: Mon, 19 Feb 2001 07:28:31 -0500
From: Jason Goodrow <"goodrow"@opencity. com>
Subject: newbie regex linebreaks problem
Message-Id: <96r3h0$74q$1@news.panix.com>
Hey Newsgroup -
Sorry if this should be in comp .... cgi but it seems more perl (and
they
respond less to newbies) - apologies also if this is sitting in front of
me in a FAQ
(my eyes have crossed)
Feeding <textarea> field from form into .cgi to update html.
Line breaks are killing me.
On submit browser sends -
the.cgi?input=hello%0D%0Aworld
(POST doesn't help)
I've tried s/%0D%0A/<br>/ and lots of variations.
viewing output in vi reveals a ^M which I can't get rid of or match.
Camel books says "To match a caret, don't put it first."
I pulled
$mess =~ s/([^\w\s])/<br>/ge;
out of a FAQ but still can't get rid of ^M
I'm lost
(thanks for any help)
newbie@opencity.com
------------------------------
Date: Mon, 19 Feb 2001 14:07:14 GMT
From: Beable van Polasm <beable@my-deja.com>
Subject: Re: newbie regex linebreaks problem
Message-Id: <m3hf1qoju2.fsf@beable.van.polasm.bigpond.net.au>
Jason Goodrow <"goodrow"@opencity. com> writes:
> Hey Newsgroup -
HELLO SHAWN!
> the.cgi?input=hello%0D%0Aworld
> (POST doesn't help)
>
> I've tried s/%0D%0A/<br>/ and lots of variations.
>
> viewing output in vi reveals a ^M which I can't get rid of or match.
> Camel books says "To match a caret, don't put it first."
But you see, it's not a caret. The caret in this case means "control",
so it's a Control-M.
Try this, which matches "\r\n":
$mess =~ s|\r\n|<blink>THIS IS A PENCIL!|g;
If that doesn't work, try this which uses the octal values for the same
thing:
$mess =~ s|\015\012|<blink>THIS IS A PENCIL!|g;
If that doesn't work, I dunno.
cheers
Beable van Polasm
--
"I hate leonardo dacapprio I thin he is a little bitch and a whiner.
I would pay my life savinge to beable to kick his
ass!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" -- Mark Sharpe
http://members.nbci.com/_______/index.html IQC 78189333
------------------------------
Date: 19 Feb 2001 09:06:41 GMT
From: abigail@foad.org (Abigail)
Subject: Re: PERL Request
Message-Id: <slrn991oh1.dct.abigail@tsathoggua.rlyeh.net>
Mindfield (mindfield@badgers.emulationnet.com) wrote on MMDCCXXIX
September MCMXCIII in <URL:news:sa619t8hu6576v120epkpakpuun7l57qu4@4ax.com>:
:} Okay, I'm a total novice at Perl. At best I can sort of read a perl
:} script and pick out bits here and there and figure out what they're
:} supposed to do, but I never got round to learning to program in it.
:}
:} Now what I want to do is pretty obscure, so I doubt a premade script
:} exists for it, but I'm wondering if someone could point me to a place
:} that could help me figure out how to do a pretty simple script.
:} Actually, two very simple scripts.
Your first task would be to learn Perl.
Abigail
--
print v74.117.115.116.32;
print v97.110.111.116.104.101.114.32;
print v80.101.114.108.32;
print v72.97.99.107.101.114.10;
------------------------------
Date: Mon, 19 Feb 2001 09:26:38 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: PERL Request
Message-Id: <i2p19tg9hk536g2utue8u0ssp0tiddh96c@4ax.com>
Mindfield wrote:
>Basically what I want is a script that gets executed every time a
>particular page is loaded, or every time a specific button is pressed
>(I haven't decided yet how I want it executed). What this script will
>do is check for the existence of a directory and, if it doesn't exist,
>create it, and if it does, do nothing. The directory it will be
>checking for is basically the day's date. (i.e. a directory named
>021701 for today's date) The pupose of the script is that things will
>get uploaded to a site on a fairly regular basis, but will only be
>kept online for 7 days, after which it will be purged manually from
>the system.
You can use mkdir(). If the directory it's trying to make, already
exists, nothing will happen, except that this function,'s return value
indicates failure (false).
As for the date, getting selected items from the return value (as list)
of localtime, that will get you there.
my($d, $m, $y) = (localtime)[3, 4, 5];
$m++; # months are zero based
# years are relative to 1900
$dir = sprintf "%02d%02d%02d", $y%100, $m, $d;
mkdir "/upload/directory/$dir", 0777;
Contrary to your description, I've put the date in order year/month/day,
because then alphabetical order and chronological order are always the
same. That makes manual management easy.
There's no reason now to use 4 digit years, the first two digits aren't
going to change any time soon.
>The second script is the upload script.
Well, if this one is a Perl script, simply incorporate the first action
into this upload script. It's not like creating that directory is taking
so much time and CPU power.
Using a module like CGI.pm, you get a temporary file on the server
anyway, all you need to do is copy it to its final destination
directory. But do check if the file already exists, and if you want to
overwrite it in that case.
--
Bart.
------------------------------
Date: Mon, 19 Feb 2001 13:57:34 +0100
From: "Michael Guenther" <miguenther@lucent.com>
Subject: Re: PerlScript documentation and reference ?
Message-Id: <96r52o$105@nntpa.cb.lucent.com>
Hi
http://www.perl.com/pub/v/documentation
but this is what shoul d have this as man perldoc and perldoc when you run
linux.
John Robson <as646@FreeNet.Carleton.CA> wrote in message
news:96ksp4$9vj$1@freenet9.carleton.ca...
>
> I'm looking for a comprehensive online reference and documentation
> on PerlScript.
>
> The documentation that comes downloaded with ActivePerl (activestate.com)
is
> very basic and incomplete.
>
> Does anyone know of good books, online manuals, web sites on PerlScript ?
>
------------------------------
Date: Mon, 19 Feb 2001 11:29:23 +0100
From: "Mark Bakker" <mark@mediamedia.nl>
Subject: Programmers needed for creating the best chat program for websites ever anounced...!
Message-Id: <96qsk8$1jdl$1@buty.wanadoo.nl>
Hello there,
I am seeking for some people who are looking for a good Chat server/client
solution which they can use commecialy.
I have written such an program, now i want to make version 2.
For this this version i am going to make the best possible Chat for an
website.
The Chat has to have the possebility to have multiple pictures users can
submit to some channel.
And which they can use while chatting.
So if they type //dog they see some dog.
This is nog very new. The new thing will be that everyone whith op rights on
some Channel can create or delete there pictures. If some picture is created
it will be send to all users of the channel.
The pictures will not go through the Chat server but they will go bye some
web server. This because the performance problems.
The server will be some server that can have an array of servers that are
connected to each other.
Every server has some pool of other servers (0 or more) and a pool of
clients(the java clients).
The pool of servers has to be 1 treat and the pool of children have to be
multiple treats with +/- 100 clients a treat. This way 1 server can handle
about 2000 clients.
At the moment i use a non treating perl chat server that can handle about
1000 clients.
I am seeking for people who ar interested in the project.
The project will not be open source.
But can only be used bye the partisipants of the project.
They may use it for demo or they may sell it to other companies, the price
they earn for the chat server/applet. Will be devided bye the percentage of
programming time they have offered into the project.
At the moment i have a lot of demo code in java/perl.
I hope there are people that are interested in this kind of project.
If so please send me a mail message.
With kind regards,
--
Mark Bakker
AtLast
t: +31-(0)20-6163011 w: www.atlast.nl
f: +31-(0)20-4272444 m: mark@atlast.nl
------------------------------
Date: 19 Feb 2001 09:09:10 GMT
From: abigail@foad.org (Abigail)
Subject: Re: PROPOSAL: Graphics::ColorNames
Message-Id: <slrn991olm.dct.abigail@tsathoggua.rlyeh.net>
Robert Rothenburg (wlkngowl@unix.asb.com) wrote on MMDCCXXIX September
MCMXCIII in <URL:news:3A90B1AF.7E8A61C2@unix.asb.com>:
^^
^^ I prefer the triplets, but hex strings do take less memory. Hm...
Don't forget that you are programming in *Perl*. If such
microoptimalization is important to you, forget Perl exists. Use C.
Abigail
--
perl -wle 'eval {die [[qq [Just another Perl Hacker]]]};; print
${${${@}}[$#{@{${@}}}]}[$#{${@{${@}}}[$#{@{${@}}}]}]'
------------------------------
Date: 19 Feb 2001 11:56:10 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: PROPOSAL: Graphics::ColorNames
Message-Id: <982582551.26010@itz.pp.sci.fi>
In article <slrn991olm.dct.abigail@tsathoggua.rlyeh.net>, Abigail wrote:
>Robert Rothenburg (wlkngowl@unix.asb.com) wrote on MMDCCXXIX September
>MCMXCIII in <URL:news:3A90B1AF.7E8A61C2@unix.asb.com>:
>^^
>^^ I prefer the triplets, but hex strings do take less memory. Hm...
>
>Don't forget that you are programming in *Perl*. If such
>microoptimalization is important to you, forget Perl exists. Use C.
These are pretty big hashes we're talking about, and one extra array
and three scalars for each color is going to increase their size by an
order of magnitude.
How many colors are we talking about anyway? I just checked the SVG
recommendation, and it only lists about 150. Maybe it isn't worth
optimizing after all -- I was thinking of something like Unicode
character names, where it definitely would start to matter.
I'd still prefer the hash values to be hex strings just because they
are so convenient to interpolate. If you want an array, it's easy to
call a utility function for that, but interpolating function calls is
a real pain.
--
Ilmari Karonen - http://www.sci.fi/~iltzu/
"To use these conventions makes it too much like every other pseudo-
medieval fantasy set in an oversized English garden."
-- Phideaux in rec.arts.sf.composition
Please ignore Godzilla and its pseudonyms - do not feed the troll.
------------------------------
Date: Mon, 19 Feb 2001 22:46:51 +1100
From: Ian Boreham <ianb@ot.com.au>
Subject: Re: Specifying the length of regular expression
Message-Id: <3A9107AA.4294F72F@ot.com.au>
Well, I've finally made it back. Since Google took over Deja and screwed it
up, I haven't been able to post. I've tried other avenues, and none were
successful until now.
Greg Bacon wrote:
> In article <t88253lulv9uf1@corp.supernews.com>,
> Greg Bacon <gbacon@hiwaay.net> wrote:
>
> : In article <960ji8$l4t$1@nnrp1.deja.com>,
> : Ian Boreham <iboreham@my-deja.com> wrote:
> :
> : : You don't need the comma after the "10".
> :
> : Yes you do; the original spec was length greater than ten.
Sigh. You didn't try it, did you? The lookahead expression is not anchored
at the end, so it is sufficient for the lookahead to check that it matches
the minimum number. The body of the expression will actually match the full
string.
And I thought I would have a flood of people telling me I wouldn't need
it...
> ...and the 10 should be 11. :-)
Yes, you are right. I obviously didn't read the post carefully enough.
> : When matching strings from non-regular languages, I find that
> : verifying the match with additional checks, e.g.,
> :
> : if (/^(A+B*C+)$/ && length($1) > 10) { ... }
> :
> : as Dominus wrote, makes for much clearer code than doing it all in the
> : regular expression.
And I agree(d). However, you don't always have a choice, so it is nice to
know how to do fancy things such as specifying the length, inverting
matches, matching numerical ranges etc within a single regex.
> To be pedantic,
> the word 'haiku' has three
> not two syllables
> -- Neko
In Japanese, yes; in English, no (if I'm not being too pedantic).
Regards,
Ian
------------------------------
Date: Mon, 19 Feb 2001 22:45:27 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Stat and dir test help needed
Message-Id: <slrn9921qn.c8o.mgjv@martien.heliotrope.home>
[removed comp.lang.perl. Group no longer exists. Please inform your news
admin]
On Sun, 18 Feb 2001 16:02:16 GMT,
afshin akbari <afshin.akbari@sympatico.ca> wrote:
> All,
>
> I have souple of questions about dir tests and wornder if someone could
> help me with the following questions.
Sure.
> 1) can you use "stat" function on DIRECTORIES as well as FILES ??
>=A0=A0=A0 If the anser is YES, do you have to have the dir. open before "=
> stat"
>=A0=A0=A0 can return anything ????
Yes. No.
What's with all those oddball characters there?
> 2) I tried to test on a dir (-w $directoryName) it seems that I have
>=A0=A0=A0 to have the dir open before I could get the correct result ????=
How did you conclude that you had to? Error messages? Spurious sparks
from the back of your computer? Nasal daemons? Ballistic missiles being
fired at random? "It didn't work"?
>=A0=A0=A0 Has anyone seen this ?
Maybe, but not me.
$ perl -wle 'my @f = stat("/tmp"); print "@f"'
769 191233 17407 18 0 0 0 16384 982515908 982515832 982515832 4096 32
See? No problem at all. I suspect you might have a bug at line 13.
Martien
--
Martien Verbruggen |
Interactive Media Division | Hi, Dave here, what's the root
Commercial Dynamics Pty. Ltd. | password?
NSW, Australia |
------------------------------
Date: Mon, 19 Feb 2001 10:40:36 +0100
From: "Mark Bakker" <mark@mediamedia.nl>
Subject: Treating chat server array
Message-Id: <96qpoq$1dga$1@buty.wanadoo.nl>
Hello,
Can someone tell me how i can write some program that has 2 diverent treats,
one for a server pool and one for a client pool.
In the server pool i want to keep track of communication between the chat
servers and in the client treat the server keeps track of the various
clients.
With kind regards,
Mark Bakker
AtLast
t: +31-(0)20-6163011 w: www.atlast.nl
f: +31-(0)20-4272444 m: mark@atlast.nl
------------------------------
Date: Mon, 19 Feb 2001 11:35:37 +0100
From: "Mösl Roland" <founder@pege.org>
Subject: Wanted: Image Magic for dummies
Message-Id: <3a90f787$0$19152@SSP1NO25.highway.telekom.at>
I have heared my best chance to controll
a graphic programm by perl would
be Image Magic.
This Image Magic is now on my harddisk
and I have absolut no clue how to install
and use it.
I am one of this click on "Install.exe
Is there a simple step by step instuctions
how to install it and to use it by Perl?
--
Mösl Roland founder@pege.org
http://www.pege.org clear targets for a confused civilization
http://www.BeingFound.com web design starts at the search engine
------------------------------
Date: Mon, 19 Feb 2001 13:12:54 -0000
From: "Tom Perkin" <tom_perkin@nospamplease.hotmail.com>
Subject: Re: Wanted: Image Magic for dummies
Message-Id: <96r5vr$mvi$1@pegasus.csx.cam.ac.uk>
Mösl Roland <founder@pege.org> wrote in message
news:3a90f787$0$19152@SSP1NO25.highway.telekom.at...
> I am one of this click on "Install.exe
> Is there a simple step by step instuctions
> how to install it and to use it by Perl?
>
Have you read the readme that comes in the distribution? Have you been to
www.imagemagick.org? Have you downloaded the manual?
What platform are you on? Is it a binary distribution you have downloaded?
Perhaps you would get a more helpful response if you had asked a specific
question and demonstrated some evidence of having read around that problem
first.
-Tom
--
Tom Perkin > Pembroke College > tom_perkin@NOSPAMPLEASEhotmail.com
"Freedom is the by-product of economic surplus" - Aneurin Bevan
------------------------------
Date: Mon, 19 Feb 2001 14:51:27 +0100
From: "Mösl Roland" <founder@pege.org>
Subject: Re: Wanted: Image Magic for dummies
Message-Id: <3a9124d3$0$18874@SSP1NO25.highway.telekom.at>
"Tom Perkin" <tom_perkin@nospamplease.hotmail.com> wrote in message
news:96r5vr$mvi$1@pegasus.csx.cam.ac.uk...
> Mösl Roland <founder@pege.org> wrote in message
> news:3a90f787$0$19152@SSP1NO25.highway.telekom.at...
> > I am one of this click on "Install.exe
> > Is there a simple step by step instuctions
> > how to install it and to use it by Perl?
> >
>
> Have you read the readme that comes in the distribution? Have you been to
> www.imagemagick.org? Have you downloaded the manual?
>
> What platform are you on?
Windows 98 SE.
I develop HTA applications with PerlScript
and CGI with Perl
> Is it a binary distribution you have downloaded?
Yes, I think so.
> Perhaps you would get a more helpful response if you had asked a specific
> question and demonstrated some evidence of having read around that problem
> first.
I have only the download and in the readme.txt is so much
what I can not understand, that I do not know to start.
I only want to install this and to know how to
open, resize, cut from x,y to x,y, save picture
nothing more.
So this readme.txt could be in chinese characters and I would
understand as much as I understand now :-)
--
Mösl Roland founder@pege.org
http://www.pege.org clear targets for a confused civilization
http://www.BeingFound.com web design starts at the search engine
------------------------------
Date: 19 Feb 2001 10:56:49 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: When is an array @f allowed in a string?
Message-Id: <96qu5h$kc$1@bob.news.rcn.net>
Bertilo Wennergren <bertilow@chello.se> wrote:
> Good arguments. But then a language that makes cheating impossible
> would seem more appropriate, wouldn't you say? Having to fire
> people because they've botched up, due to the unstrict nature of
> perl (it's so easy to leave out the strictures!), can be very,
> very costly!
Larry's philosophy, as I understand it, is that programming discipline is
supposed to be something that comes from the programmer, not the
programming language. Perl, as I see it, isn't an "undisciplined"
language, it's a "bring your own discipline (BYOD)" language. The problem
with having the programming language enforce discipline is that there are
many styles of programming discipline, all of which are more-or-less
equally effective (because they really do differ in style rather than
substance), but if you try to build it into the language, you force the
choice of some style (usually the one the language designer prefers) over
all the rest, because computers simply aren't as flexibile as humans.
This is consistent with the idea that the purpose of a computer is to take
care of the repetitive mindless tasks, not to compensate for a human not
knowing what he/she is doing.
------------------------------
Date: Mon, 19 Feb 2001 12:59:04 GMT
From: "BostonHot.com" <wizard@bostonhot.com>
Subject: Re: When is an array @f allowed in a string?
Message-Id: <sM8k6.4494$lx.2033338@typhoon2.ba-dsg.net>
"Eric Bohlman" <ebohlman@omsdev.com> wrote in message
news:96qu5h$kc$1@bob.news.rcn.net...
> Larry's philosophy, as I understand it, is that programming discipline is
> supposed to be something that comes from the programmer, not the
> programming language.
That's true to an extent, but the real question is "Is this the product that
I'm being paid for?". I have to admit, that when I'm writing a script just
for me, that I almost never 'use strict'. However, when I'm writing for
somebody else, not only will I 'use strict', but I'll often write several
test scripts using '-w'. With me it's a matter of pride more than anything
else. I'd much rather defend my programming style than some obscure bug that
I inadvertantly wrote into my app.
As a sidenote, I had included a call to FindBin in one of my own modules,
and then used the -w flag on my test script, only to see several warnings
displayed about a redefinition (?) within the Cwd module. I then when back
and used DProf on the module and found that those calls were taking more
than 50% of the entire runtime of the calls to the module.
Final say:
1.> do whatever you wish when writing stuff for yourself
2.> "use strict" when you're being paid to "use strict"
3.> "use strict" when you care about what you're writing.
4.> test with the -w flag (at least once).
5.> If time allows, DProf the test script, and optimize.
You can follow the advice or not, it's up to you, but I don't do code with
warnings.
Grant M.
wizard@bostonhot.com
http://www.NeonEdge.com/perl_tools/Config/
------------------------------
Date: 19 Feb 2001 12:08:05 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Why can't I grab this URL?
Message-Id: <96r2b5$nu3$4@mamenchi.zrz.TU-Berlin.DE>
What A Man ! <whataman@home.com> wrote in comp.lang.perl.misc:
>is that perl book author Randall Schwartz didn't give the
That's because this author is a myth. He doesn't exist.
Anno
------------------------------
Date: Mon, 19 Feb 2001 08:56:48 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Writing a Perl Server
Message-Id: <djn19t4279a64e4g7hgotrjja4p962d46v@4ax.com>
Scotty99 wrote:
>Unlike a web server,
>this server will need to accept sockets and communicate with multiple
>clients for extended periods of time. My current server listens for
>incoming connections and
>accepts each connection and puts it on a separate thread.
I haven't used it, or even tried it out, but it sure sounds as if you
should check out POE, available on CPAN. There's an introduction article
at <http://www.perl.com/pub/2001/01/poe.html>
--
Bart.
------------------------------
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 V10 Issue 314
**************************************