[10967] in Perl-Users-Digest
Perl-Users Digest, Issue: 4567 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jan 6 21:07:11 1999
Date: Wed, 6 Jan 99 18:00:18 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 6 Jan 1999 Volume: 8 Number: 4567
Today's topics:
Additional questions about spawning a new script and CG <gbc1@axe.humboldt.edu>
Re: background server <gellyfish@btinternet.com>
Re: Cant modify my files (Martien Verbruggen)
Re: change perl script process name <gellyfish@btinternet.com>
CPAN not working on Win NT (perl 5.00502) (Dave LeBlanc)
Re: Dynamic gifs on the fly <gellyfish@btinternet.com>
Re: How do I create a unique (reproducible) identifier? (Jeffrey Drumm)
Re: If Larry Wall's listening out there.... (Snowhare)
line continuation; the switch statement <andrew@geac.co.nz>
Re: OO Perl Persistence Problem (Martien Verbruggen)
Re: Perl Commands at regular intervals? <david@kasey.umkc.edu>
Re: Perl Commands at regular intervals? <david@kasey.umkc.edu>
Re: Perl Criticism <chatmaster@c-zone.net>
Re: Perl Criticism (brian d foy)
Re: Perl Criticism <jeromeo@atrieva.com>
perl schools or classes???? (jm)
Perlshop cjraiss@uswest.net
Re: recursive directory copy perl module (Ilya Zakharevich)
Re: subroutine declaration in a loop and lexical variab <metcher@spider.herston.uq.edu.au>
Re: What happened to mox.perl.com <chatmaster@c-zone.net>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 06 Jan 1999 16:08:16 -0800
From: Greg Coit <gbc1@axe.humboldt.edu>
Subject: Additional questions about spawning a new script and CGI.pm
Message-Id: <3693FAF0.2E341C38@axe.humboldt.edu>
Thanks for the replies. Adding a close of STDERR and STDOUT helped
greatly
by allowing the browser to show the new page even while the old script
is
waiting for the new script to finish:
#subroutine and variable names changed to avoid confusion (no innocents
to
protect here!):
sub spawn_program_and_generate_next_page
{ &get_data_from_old_webpage;
&generate_new_web_page;
close(STDERR);
close(STDOUT);
`new_scipt.pl $param`; #Don't worry, $param was not derived
from
any user input
}
My next question is why do I need fork after all? If I understand fork
correctly (which is unlikely), my parent program will still be active
until
the child dies (which is how the above snippet of code behaves even
though
it's not technically forking). I could probably kill the parent, but
wouldn't that require a new script to clean up zombies after the child
dies? Should I use fork because it allows me to makes sure the firing
off
of the new script really worked?
Thanks for the help on this one, I banged my head against the computer
screen for 3 days on this one.
Greg Coit
gbc1@axe.humboldt.edu
P.S. Playing with STDERR and STDOUT has me wondering. Would it be
possible to redirect the output of CGI.pm such that I could use the
awesome functionality of CGI.pm to create static pages rather than
dynamic pages? Basically, can I redirect STDOUT to a file?
------------------------------
Date: 6 Jan 1999 23:32:11 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: background server
Message-Id: <770rpr$19s$1@gellyfish.btinternet.com>
On 5 Jan 1999 00:34:56 GMT Eric Hammervold wrote:
> Hello
>
> I need some information on generating background servers for windows NT.
<snip>
You need to run the program as a service - You will need the NT resource kit
to do this. An article that fully describes how to achieve this can be seen
on DejaNews at:
<URL:http://www.dejanews.com/getdoc.xp?AN=381273730>
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Thu, 07 Jan 1999 00:23:09 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Cant modify my files
Message-Id: <N7Tk2.142$5P1.5992@nsw.nnrp.telstra.net>
In article <770s61$f2t$1@nnrp1.dejanews.com>,
dragnovich@my-dejanews.com writes:
> I cant make that a perl script running under NT modify any file
>
> Lets say that I have a file with nothing on it, the commands:
> open(FILE,">some.txt");
Always, always check the return value of an open:
open(FILE, ">some.txt") || die "Cannot open file some.txt for write: $!";
> print FILE "Hello";
> close(FILE);
To have full knowledge about everything, you can check the return
values of the print and close staments as well.
open(FILE, ">some.txt") || die "Cannot open file some.txt for write: $!";
print FILE "Hello" or die "Cannot print to FILE: $!";
close(FILE) || die "Cannot close FILE: $!";
(I'm using 'or' for the print to avoid having to use parentheses).
> Why is happening this???
If you include the above, you might be able to find out.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | You can't have everything, where would
Commercial Dynamics Pty. Ltd. | you put it?
NSW, Australia |
------------------------------
Date: 6 Jan 1999 19:43:44 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: change perl script process name
Message-Id: <770edg$18g$1@gellyfish.btinternet.com>
On Tue, 05 Jan 1999 02:10:06 GMT witthawat@my-dejanews.com wrote:
> In article <3690F4AE.2A716D8B@yournews.nl>,
> "Bas A. Schulte" <bas@yournews.nl> wrote:
>> Hi,
>>
>> > How can i change "/usr/local/bin/perl abc" to other process name such as
>> > "bcd"?
>>
>> $0 = 'bcd';
>>
>> Not sure how portable this is; it works on our Linux boxes, but does not
>> seem to work on our HP/UX 10.20's.
>>
>> Ciao.
>
> My system is solaris 2.6. Setting $0 = 'bcd' didn't work too.
> Anyone have any other way to solve this?
>
You might have some success if you exec() yourself thus:
if ( $0 ne 'bcd' )
{
exec $0 'bcd';
}
Though I cant test this on Solaris right now.
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Thu, 07 Jan 1999 01:07:46 GMT
From: whisper@accessone.com (Dave LeBlanc)
Subject: CPAN not working on Win NT (perl 5.00502)
Message-Id: <3694030e.248412046@news.accessone.com>
Hi;
I just installed perl 5.00502, and i'm trying to use CPAN to get
and/or update stuff and i'm having problems.
When I do reload index, I get:
Issuing "C:\WINNT\system32\ftp.exe -n"
Local directory now D:\user\davel\.cpan\sources\authors
GOT D:\user\davel\.cpan\sources\authors/01mailrc.txt.gz
Going to read D:\user\davel\.cpan\sources\authors/01mailrc.txt.gz
Issuing "C:\WINNT\system32\ftp.exe -n"
Local directory now D:\user\davel\.cpan\sources\modules
GOT D:\user\davel\.cpan\sources\modules/02packages.details.txt.gz
Going to read
D:\user\davel\.cpan\sources\modules/02packages.details.txt.gz
There's a new CPAN.pm version (v1.43) available!
You might want to try
install Bundle::CPAN
reload cpan
without quitting the current session. It should be a seamless
upgrade
while we are running...
Issuing "C:\WINNT\system32\ftp.exe -n"
Local directory now D:\user\davel\.cpan\sources\modules
GOT D:\user\davel\.cpan\sources\modules/03modlist.data.gz
Going to read D:\user\davel\.cpan\sources\modules/03modlist.data.gz
c:\usr\binw\gunzip: stdout: Broken pipe
cpan> install Bundle::CPAN
Going to read D:\user\davel\.cpan\sources\authors/01mailrc.txt.gz
Going to read
D:\user\davel\.cpan\sources\modules/02packages.details.txt.gz
Scanning cache D:\user\davel\.cpan\build for sizes
Going to read D:\user\davel\.cpan\sources\modules/03modlist.data.gz
CPAN: MD5 security checks disabled because MD5 not installed.
Please consider installing the MD5 module.
CPAN-1.43/
CPAN-1.43/lib/
CPAN-1.43/lib/CPAN/
CPAN-1.43/lib/CPAN/Nox.pm
CPAN-1.43/lib/CPAN/FirstTime.pm
C:\usr\binw\tar.exe: couldn't change access and modification times of
CPAN-1.43/lib/CPAN/FirstTime.pm: : Permission denied
CPAN-1.43/lib/Bundle/ CPAN-1.43/lib/Bundle/CPAN.pm
C:\usr\binw\tar.exe: couldn't change access and modification times of
CPAN-1.43/lib/Bundle/CPAN.pm: : Permission denied
CPAN-1.43/lib/CPAN.pm
C:\usr\binw\tar.exe: couldn't change access and modification times of
CPAN-1.43/lib/CPAN.pm: :Permission denied
CPAN-1.43/Todo
C:\usr\binw\tar.exe: couldn't change access and modification times of
CPAN-1.43/Todo: : Permission denied
CPAN-1.43/README
C:\usr\binw\tar.exe: couldn't change access and modification times of
CPAN-1.43/README: : Permission denied
CPAN-1.43/t/
CPAN-1.43/t/loadme.t C:\usr\binw\tar.exe: couldn't change access and
modification times of CPAN-1.43/t/loadme.t: : Permission denied
CPAN-1.43/MANIFEST
C:\usr\binw\tar.exe: couldn't change access and modification times of
CPAN-1.43/MANIFEST: : Permission denied
CPAN-1.43/Changes C:\usr\binw\tar.exe: couldn't change access and
modification times of CPAN-1.43/Changes: : Permission denied
CPAN-1.43/Makefile.PL C:\usr\binw\tar.exe: couldn't change access and
modification times of CPAN-1.43/Makefile.PL: :Permission denied
Removing previously used D:\user\davel\.cpan\build\CPAN-1.43
Couldn't find a Bundle file in D:\user\davel\.cpan\build\CPAN-1.43 at
F:\perl\5.00502\lib/CPAN.p
m line 1533
cpan> o conf
CPAN::Config options from F:\perl\5.00502\lib/CPAN/Config.pm:
commit Commit changes to disk
defaults Reload defaults from disk
init Interactive setting of all options
build_cache 10
build_dir D:\user\davel\.cpan\build
cpan_home D:\user\davel\.cpan
ftp C:\WINNT\system32\ftp.exe
ftp_proxy
getcwd cwd
gzip c:\usr\binw\gunzip.exe
http_proxy
inactivity_timeout 0
index_expire 1
inhibit_startup_message 0
keep_source_where D:\user\davel\.cpan\sources
lynx
make E:\devstudio\vc\bin\nmake.exe
make_arg
make_install_arg
makepl_arg
ncftp
no_proxy
pager C:\usr\binw\more.exe
shell sh.exe
tar C:\usr\binw\tar.exe
unzip
urllist
ftp://ftp.cdrom.com/pub/perl/CPAN/
ftp://ftp.duke.edu/pub/perl/
ftp://ftp.perl.org/pub/perl/CPAN/
ftp://ftp.orst.edu/pub/packages/CPAN/
wait_list
wait://ls6.informatik.uni-dortmund.de:1404
the reload index and reload cpan commands work, and bundles i've not
previously downloaded are fetched via ftp.
It looks to me like my gunzip.exe and tar.exe programs aren't
compatible with what CPAN wants, but they've always worked befored.
Hope someone can help
Replies copied to whisper@accessone.com appreciated.
Dave LeBlanc
------------------------------
Date: 6 Jan 1999 23:52:14 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Dynamic gifs on the fly
Message-Id: <770sve$1a0$1@gellyfish.btinternet.com>
On Wed, 06 Jan 1999 11:14:06 -0500 Leonord Wertzberger wrote:
> Hi thanks for your reply!
> Can you please direct me to the question topic where this was discussed - I am still very new to
> perl. Also what does DejaNews mean and where can I find it?
DejaNews is a web-based usenet service that provides a searchable archive
of newsgroup postings. Using the 'power search' facility you can search
this newsgroup for Image::Magick to come up with postings that mention it.
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Thu, 07 Jan 1999 01:38:51 GMT
From: drummj@mail.mmc.org (Jeffrey Drumm)
Subject: Re: How do I create a unique (reproducible) identifier?
Message-Id: <36940404.168649809@news.mmc.org>
[posted and mailed]
On Wed, 06 Jan 1999 17:24:25 +0100, Staffan Liljas <staffan@ngb.se> wrote:
>Hi!
>
>> >Oops! How do you write a hash to a file, and then retrieve it such
>> >that it's still a hash? Is there a quick way, other than iterating
>> >through the whole thing, turning it into some kind of array or
>> >something?
>>
>> Use a tied hash. See the documentation on tie and/or dbmopen.
>
>But how does this work if two processes access the same file at the same
>time (as might _very_ well be the case over the internet). Maybe this
>was a stupid question.
Poorly, unless you open the dbm read-only or take the (necessary)
precaution of locking it when opening with read/write access.
--
Jeffrey R. Drumm, Systems Integration Specialist
Maine Medical Center Information Services
420 Cumberland Ave, Portland, ME 04101
drummj@mail.mmc.org
"Broken? Hell no! Uniquely implemented." -me
------------------------------
Date: Thu, 07 Jan 1999 00:12:54 GMT
From: snowhare@devilbunnies.org (Snowhare)
Subject: Re: If Larry Wall's listening out there....
Message-Id: <a_Sk2.4423$hN4.58627@typhoon-sf.snfc21.pbi.net>
Nothing above this line is part of the signed message.
In article <770eg0$g3u@netline.jpl.nasa.gov>,
Peter Scott <psl@euclid.jpl.nasa.gov> wrote:
>In article <76urmk$ncd$1@news.akl.netlink.net.nz>,
> "Andrew Mayo" <andrew@geac.co.nz> writes:
>
>> Has anyone out there had experience in maintaining large (>10,000
>> line) Perl programs or program suites, and if so, what techniques
>> would you recommend to maximise maintainability, other than the
>> obvious recourse of commenting every line, which is currently what
>> I am doing?.
>
>I have created several large Perl suites, including one comprising,
>lessee... 8291 LOC, although no-one should confuse LOC with power.
>
>Techniques? Object-oriented. Document - especially POD. Plus
>design documents and other docs separate from the code. I have done
>similar-sized projects in C and find Perl slightly better for
>maintainability (C has no built-in documentation language, although
>there are some third party ones out there), just that the LOC shrinks
>due to the power of Perl.
A current Perl project is circa 30K LOC (and it will probably double
before completion).
1) Document.
Document data structures.
Document system design.
Document data flow.
Document program flow.
Document the inputs and ouputs of *EVERY* subroutine.
Provide *EXAMPLES* of calling the routines in the docs.
Discusss with profuse verbosity what the system is supposed
to do and how it is supposed to do it.
2) Modularize.
Figure out the natural cleavage lines and cleave that code.
A module of more than 50K should be looked at *VERY* carefully
- it may be two modules pretending they are only one.
Packages and OO are your friends - use them liberally.
3) Use meaningful module, sub-routine and variable names.
4) Don't use globals or side-effects.
Don't use globals or side-effects.
Don't use globals or side-effects.
5) Keep sub-routines *SMALL*.
If you have to page down 3 times to go through a routine, it needs
to have chunks turned into sub-sub-routines. Repeat as necessary.
6) Check all inputs to sub-routines for sanity. Be paranoid.
Be *VERY* paranoid.
7) Check any success result codes if available. Generate success result
codes when needed.
8) Maximize code re-use. Use libaries when possible: Don't re-invent
the wheel unless you absolutely have to.
9) Don't use 'super-clever' Perl tricks. They are as good as having
encrypted your code.
10) 'use strict;' and '#!/usr/bin/perl -w' are your friends.
Benjamin Franz
Version: 2.6.2
iQCVAwUBNpP8OujpikN3V52xAQGyKwP/aMYEwt1kESaMEyPlhQtsn1fbJgSt4m+C
a2ouTgnJjgzHetnOGfSzZQ5Zs7zLZn31BBpJy7QLl0oaXyFXvWqk2cXbvXda7Zoj
JcKqmSl6b0AhVTCLqZ1G4MH7wP5NZDEoSJgksZ4EUgN8Q36B5rVlSk2iyIyQs7Ej
VB3yMWOY5ZU=
=+7hA
-----END PGP SIGNATURE-----
------------------------------
Date: Thu, 7 Jan 1999 14:33:05 +1300
From: "Andrew Mayo" <andrew@geac.co.nz>
Subject: line continuation; the switch statement
Message-Id: <7713e3$m9c$1@news.akl.netlink.net.nz>
Ok. I've read the FAQ and browsed through Programming Perl a couple of
times. I still don't know how to do this:-
start with a simple regex e.g
if (m/a|b/)
{
do stuff...
}
and then after much hacking a|b has grown into several lines of alternatives
i.e
foo|bar|pow|splat|dopey|grumpy|sleepy|kirk|picard|scotty|...... etc
I cannot figure out how to split this neatly over several lines so as to
preserve indentation at that point i.e
{
do stuff
{
more stuff
.....
{
deeply indented more stuff
if (m/foo|bar|pow........ etc,)
I would like to say
if (m
/foo|bar|pow|
splat|dopey|grumpy|
sleepy|kirk|picard|
....and so on
but if I do this, the newlines and whitespace become part of the pattern. I
know I could create a string containing this mess but then the assignment
would *still* have to be on a single line.
How do I split this sort of thing over several lines to preserve readability
without inserting unwanted whitespace etc.
PS: I'd like to do that for print statements too e.g
print "twas brillig and the slithy toves did gyre and gimble in the wabe.
All mimsy were the borogroves and the mome raths outgrabe\n";
How do I split this over multiple lines without whitespace etc. intruding
yet still having indentation?
PPS: unrelated question; I whinged at Perl for not having a switch statement
and not unreasonably, several people pointed me to both Programming Perl and
CPAN for examples. I kind of liked this form, from the available choices (it
maps reasonably well to both ksh and C idioms, though not VB, inasmuch as
you don't drop through to the next CASE entry in VB, but that's life...):-
SWITCH:
{
if (conditional1)
{
do stuff;
last SWITCH;
}
if (conditional2)
{
do other stuff;
last SWITCH;
}
}
BUT.... if there were more than one of these in my program, the second one
would have to have a different label at the top, not SWITCH. (AFAIK).That
could get ugly quite quickly. Is there an elegant variant of this type of
construct which would avoid this problem given that as I understand it
'last' requires a label here otherwise the interior block scope is the only
thing exited.
I assume label scope is global, btw.
------------------------------
Date: Thu, 07 Jan 1999 00:18:32 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: OO Perl Persistence Problem
Message-Id: <s3Tk2.141$5P1.5992@nsw.nnrp.telstra.net>
In article <3693EFA2.26CC31BD@cisco.com>,
user <user@cisco.com> writes:
> I have a problem in retrieving information I stored in 6 Perl Objects.
> The objects have a bunch of set and get methods.
>
> Here's what I am trying to do:
> for ($i=0;$i<6;$i++){
> # I instantiate the new object.
> my $rec = new Record();
> # Invoke method
> $rec->setAttribute($data);
> #Store object referance in a Hash
> $recHash{$i} = $rec;
> }
If you are using numeric keys that start at 0 and increment with 1,
like in this example, you're probably better off using an array.
> # Retrieving the records
> foreach $key (keys %recHash){
> $record = $recHash{$key};
> $val = $record->getAttribute();
> }
>
> When I print out the values of recHash I get different memory addresses
> but all of them point to the data of the last object - in this case the
> sixth one. What am I doing wrong? Can someone point my error?
Well, you set all six record attributes to the same value ($data).
Maybe that is the problem. If not:
You fail to show us the code for the Record class. I suspect that it
has something to do with that; hard to tell without seeing it's
implementation. A simple implementation could be:
#!/usr/local/bin/perl5.00404 -w
use strict;
package Record;
# Simple constructor. No worries about inheritance. A real one would be
# much more robust
sub new
{
my $class = shift;
bless {}, $class;
}
sub setAttribute
{
my $self = shift;
$self->{attribute} = shift;
}
sub getAttribute
{
my $self = shift;
return $self->{attribute};
}
package main;
my %recHash = ();
my @data = qw( one two three four five six );
for (my $i = 0; $i < 6; $i++)
{
my $rec = new Record();
$rec->setAttribute($data[$i]);
$recHash{$i} = $rec;
}
# Note that the use of the each function would be better here
foreach my $key (keys %recHash)
{
my $rec = $recHash{$key};
my $val = $rec->getAttribute();
print "$rec - $val\n";
}
OUTPUT:
Record=HASH(0xc7850) - one
Record=HASH(0xce3a4) - two
Record=HASH(0xcc0c8) - three
Record=HASH(0xcc0ec) - four
Record=HASH(0xcc110) - five
Record=HASH(0xcc134) - six
See? No problems.
Now, another thing that you could be doing is storing the attribute in
a package wide global, or a lexially scoped variable. You will need to
store it in the object itself, as displayed above.
The perltoot documentation explains all of this quite well:
# perldoc perltoot
> I am using Perl 5.004 on a solaris box.
That is hardly the problem :)
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | I'm desperately trying to figure out
Commercial Dynamics Pty. Ltd. | why kamikaze pilots wore helmets - Dave
NSW, Australia | Edison
------------------------------
Date: Thu, 07 Jan 1999 01:14:04 +0000
From: David L Nicol <david@kasey.umkc.edu>
To: arvindk@pa.dec.com
Subject: Re: Perl Commands at regular intervals?
Message-Id: <36940A5C.597D7AE1@kasey.umkc.edu>
Arvind Krishnaswamy wrote:
>
> Is there a way of executing a command inside a Perl script , say , every
> 30 seconds?
perldoc -f alarm
______________________________________________________________________
David Nicol 816.235.1187 UMKC Network Operations david@news.umkc.edu
"The screen has just turned blue, and there's nothing I can do."
------------------------------
Date: Thu, 07 Jan 1999 01:30:56 +0000
From: David L Nicol <david@kasey.umkc.edu>
To: arvindk@pa.dec.com
Subject: Re: Perl Commands at regular intervals?
Message-Id: <36940E50.90BDF775@kasey.umkc.edu>
Arvind Krishnaswamy wrote:
>
> Is there a way of executing a command inside a Perl script , say , every
> 30 seconds?
[david@lucy idiotsdelight]$ cat alarmtest.pl
alarm 2;
# alarm test
sub GotIt{
$SIG{ALRM} = sub{ alarm 5; &GotIt };
print "Got it in $busywaitcounter busywaits\n";
$busywaitcounter = 0;
$DidIt++;
};
$SIG{ALRM} = sub{ alarm 3; &GotIt };
while($DidIt < 5){
$busywaitcounter++;
};
[david@lucy idiotsdelight]$ perl alarmtest.pl
Got it in 571933 busywaits
Got it in 928775 busywaits
Got it in 1548112 busywaits
The perldocs say "sleep" is implemented with "alarm" so you can't sleep
to
waste time or the sleep will catch the alarm -- but then will GotIt
catch the
alarm that was supposed to wake the process up? Let's see -- adding
sleep 1;
inside the while gives
[david@lucy idiotsdelight]$ perl alarmtest.pl
Got it in 2 busywaits
Got it in 3 busywaits
Got it in 5 busywaits
Got it in 5 busywaits
Got it in 5 busywaits
[david@lucy idiotsdelight]$
so apparently you can mix sleep and alarm on 5.00502 on Linux. YMMV.
______________________________________________________________________
David Nicol 816.235.1187 UMKC Network Operations david@news.umkc.edu
"The screen has just turned blue, and there's nothing I can do."
------------------------------
Date: Wed, 06 Jan 1999 16:14:16 -0800
From: TRG Software <chatmaster@c-zone.net>
Subject: Re: Perl Criticism
Message-Id: <3693FC58.948EC9CF@c-zone.net>
topmind@technologist.com wrote:
>
> Subject: Perl Criticism
>
> Perl gets a lot of credit for its powerful features. However, there are also
> some major annoyances about it that prevent more widespread and formal
> acceptance. Some say that "fixing" these would dilute its power, but I do not
> fully agree with this. I have put together an evaluation of different language
> features that I think could be used to build a "safer Perl":
>
> http://www.geocities.com/SiliconValley/Lab/6888/langopts.htm
>
> A summary of Perl's bigger problem areas are:
<SNIP blah blah blah...>
By reading your "Story", it's obvious that you have no idea what you're
talking about. You want to tell me all the "flaws" in Macromolecular
Crystallography that you know about too? Oh wait, that's right, you
probably don't, but I'm sure you'll point a few things out as well. :-)
I have a feeling you're trying to impress people by trying to "rebel"
against something you don't know much about, which has the completely
opposite result when the people you spew such foolishness to, know
better.
You made no points, and it seems you only intended to start a long flame
thread in this NG.
--
Regards,
Tim Greer - chatmaster@c-zone.net
TRG Software and The Link Worm
http://www.linkworm.com
The Chat Base
http://www.chatbase.com
------------------------------------------------------------
* Creator of Paradise Chat, Chat Central & Spiral Chat
* Receiving over 250,000+ hits a day from users Worldwide!!!
* Sales of custom chat server scripts * CGI/Perl scripting
* Script trouble shooting/security * Modify & debug scripts
* Freelance Perl Scripting for any purpose or application
Copyright ) 1999 TRG Software and The Link Worm.
------------------------------
Date: Wed, 06 Jan 1999 19:21:42 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Perl Criticism
Message-Id: <comdog-ya02408000R0601991921420001@news.panix.com>
In article <slrn797thn.5pg.dformosa@godzilla.zeta.org.au>, dformosa@zeta.org.au (David Formosa (aka ? the Platypus)) posted:
> Indeed your desige critor are very diffrent to perls, Perl wasn't
> created to be easy to learn,
i don't think that is so since Larry officially sanctions using only
a subset of Perl to complete the task. no one has to learn all of
Perl to get the job done.
however, if people don't like Perl, they don't have to use it. they
can stay at the office solving their problems while the Perl Mongers
go out and drink. ;)
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
------------------------------
Date: Wed, 06 Jan 1999 16:33:17 -0800
From: Jerome O'Neil <jeromeo@atrieva.com>
To: chatmaster@c-zone.net
Subject: Re: Perl Criticism
Message-Id: <369400CD.F5EEFEF4@atrieva.com>
TRG Software wrote:
> By reading your "Story", it's obvious that you have no idea what you're
> talking about. You want to tell me all the "flaws" in Macromolecular
> Crystallography that you know about too?
It's too damn hard to spell!
--
Jerome O'Neil, Operations and Information Services
Atrieva Corporation, 600 University St., Ste. 911, Seattle, WA 98101
jeromeo@atrieva.com - Voice:206/749-2947
The Atrieva Service: Safe and Easy Online Backup http://www.atrieva.com
------------------------------
Date: Thu, 07 Jan 1999 00:36:23 GMT
From: fatshit@hotmail.com (jm)
Subject: perl schools or classes????
Message-Id: <3695016a.21370050@news.atl.bellsouth.net>
Does anyone know of any classes available in southeast USA?
mailto:jminder@bellsouth.net
------------------------------
Date: Wed, 06 Jan 1999 18:34:11 -0700
From: cjraiss@uswest.net
Subject: Perlshop
Message-Id: <36940F13.5B241C7F@uswest.net>
Anyone have any experience using Perlshop? Followed all instructions and
now get an error telling me to start over or "enter the shop from the
beginning".
Any help????
------------------------------
Date: 7 Jan 1999 00:33:57 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: recursive directory copy perl module
Message-Id: <770vdl$o0d$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Martien Verbruggen
<mgjv@comdyn.com.au>],
who wrote in article <8JRk2.95$5P1.3093@nsw.nnrp.telstra.net>:
> > I a looking for perl module, which can do recursive directory copy
> > and should work in both platforms ( interoperable ), unix and NT.
> There was no need to post this three times.
>
> Use the modules provided with perl
>
> # perldoc File::Find
> # perldoc File::Copy
I could not find a portable way to use File::Find + File::Copy +
File::Spec + whatever to implement recursive copy. This looks
surprisingly hard to do without relying on the format of file names.
As a result, make_bindist method of MakeMaker uses a subroutine which
can copy from the current directory only.
Of course, since '/' works both on Unix and NT, it is easy to cook
something which works in these situations.
Ilya
------------------------------
Date: Thu, 07 Jan 1999 11:26:08 +1000
From: Jaime Metcher <metcher@spider.herston.uq.edu.au>
Subject: Re: subroutine declaration in a loop and lexical variables
Message-Id: <36940D30.E6496BE@spider.herston.uq.edu.au>
Having looked at it, it looks like this is how lexical scope is supposed
to work. There was a discussion on clp.mod (I think - try searching
DejaNews on "nested sub") about nested subs where many people were
saying that any named sub within another sub should generate a warning
on the grounds that it's chronically unlikely to DWIM, but I don't think
anybody considered it to be a bug. This looks like a similar case.
A handy rule for *straightforward* lexical scoping is: put "my" in front
of *everything*. Thus:
use strict;
my $i;
while ( $i++ < 3 ) {
my $j = $i;
my $foo = sub { print "\$i=$i \$j=$j\n" };
&$foo;
}
The code now works the way a Pascal programmer would expect it to (if
they could understand the syntax). Of course there a lots of nifty
things you can do by mixing lexicals and globals.
Brian McCauley wrote:
>
> The script:
>
> #!/usr/bin/perl -w
> use strict;
>
> my $i;
>
> while ( $i++ < 3 ) {
> my $j = $i;
> sub foo { print "\$i=$i \$j=$j\n" };
> foo;
> }
>
> On perl5 (5.0 patchlevel 4 subversion 4) generates:
>
> $i=1 $j=1
> $i=2 $j=1
> $i=3 $j=1
>
> I think thI can see why this is happening but I'd like to know if this
> is considered a bug. And if it's not considered a bug I think it
> would be nice if it emitted a warning.
OK, time for me to *really* demonstrate my ignorance. The part I *know*
I don't know is where foo's copy of $j actually lives, storage-wise.
Tell me if I've got this wrong: the line "my $j = $i" allocates storage
for $j on three separate occasions at run-time. However, the sub
definition is parsed at compile-time and has to decide which $j to bind
to, so it binds to where it knows $j will be (how? $j isn't in a symbol
table? is there some kind of storage associated with each block?).
After the first iteration, $j isn't thrown away because it is still in
scope for the sub. So the next "my $j" is allocated somewhere else.
The sub still has it's own copy of $j. The block for the while loop is
acting like a closure. The surprise is that it can do its loop thing as
well.
--
Jaime Metcher
------------------------------
Date: Wed, 06 Jan 1999 16:35:15 -0800
From: TRG Software <chatmaster@c-zone.net>
Subject: Re: What happened to mox.perl.com
Message-Id: <36940143.1B7497BB@c-zone.net>
lordkai2@hotmail.com wrote:
>
> Been trying to access http://mox.perl.com but keep getting site not
> found.....
>
> I noticed the website's author Tom Christiansen had posted here
> several times and so I thought I'd leave the question her for him.....
>
> I've
> been to site numerous times in the past and would be greatly disappointed if
> it went away..... ::(
>
> -- Chris J. Whitcomb
It pings.. Can traceroute.. although it fails to respond (for me) one
hope before it reaches the destination. Probably router/network/system
problems, or a big part of the Net is down...:-)
--
Regards,
Tim Greer - chatmaster@c-zone.net
TRG Software and The Link Worm
http://www.linkworm.com
The Chat Base
http://www.chatbase.com
------------------------------------------------------------
* Creator of Paradise Chat, Chat Central & Spiral Chat
* Receiving over 250,000+ hits a day from users Worldwide!!!
* Sales of custom chat server scripts * CGI/Perl scripting
* Script trouble shooting/security * Modify & debug scripts
* Freelance Perl Scripting for any purpose or application
Copyright ) 1999 TRG Software and The Link Worm.
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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.misc (and this Digest), send your
article to perl-users@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.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
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 V8 Issue 4567
**************************************