[15782] in Perl-Users-Digest
Perl-Users Digest, Issue: 3195 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon May 29 14:05:36 2000
Date: Mon, 29 May 2000 11:05:20 -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: <959623520-v9-i3195@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 29 May 2000 Volume: 9 Number: 3195
Today's topics:
Re: (offtopic) Where can I find cron for Win98? <gellyfish@gellyfish.com>
Re: Algorythm needed for copying subdirectory hierarchi <sue@pennine.com>
Re: Algorythm needed for copying subdirectory hierarchi <elaine@chaos.wustl.edu>
Re: Algorythm needed for copying subdirectory hierarchi <makau@multimania.com>
Re: Algorythm needed for copying subdirectory hierarchi (Bart Lateur)
Re: Algorythm needed for copying subdirectory hierarchi <iltzu@sci.invalid>
Array of hashes sorting question lvanderb@ehmail.com
Re: Array of hashes sorting question <ak@dasburo.de>
Re: Bout mailhandling <greg2@surfaid.org>
Re: Calling a perl script from within another perl scri (Tad McClellan)
Re: Calling a perl script from within another perl scri excalibor@my-deja.com
Re: Can I do this using Perl? <gellyfish@gellyfish.com>
Re: Can I do this using Perl? <erebus@hushmail.com>
Re: Converting an alphanumeric string into an integer n <aqumsieh@hyperchip.com>
Re: date command under win98 and apache <gellyfish@gellyfish.com>
debugger - how to view vars? <wake@thukraine.com>
Re: debugger - how to view vars? <tony_curtis32@yahoo.com>
Re: Does this exist? <gellyfish@gellyfish.com>
Re: Dos or Unix function <gellyfish@gellyfish.com>
Re: How do I become a memory hog? (Peter J Scott)
Perl CGI Script to generate web site statistics <dwinburn@earthlink.net>
Re: perl cgi script? <gellyfish@gellyfish.com>
Re: Perl IDE for Win32? <gellyfish@gellyfish.com>
Re: Perl related humor? <elaine@chaos.wustl.edu>
Re: Perl script doesn't run <gellyfish@gellyfish.com>
Re: Perl unusable as a programming language <Tbone@pimpdaddy.com>
Re: PerLotto v0.1a4 <y-o-y@home.com>
Re: PerLotto v0.1a4 <rhomberg@ife.ee.ethz.ch>
Re: PerLotto v0.1a4 <dave@dave.org.uk>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 29 May 2000 11:06:40 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: (offtopic) Where can I find cron for Win98?
Message-Id: <8gtffg$5sb$1@orpheus.gellyfish.com>
On Sun, 28 May 2000 18:42:52 GMT The Evil Beaver wrote:
> Does it exist? If so, where can I get it? Thanks in advance,
I dont know but I am sure that one of the windows software archives will
have one or you might ask in one of the windows newsgroups.
/J\
--
Lisa, tha mob's working on getting your saxophone back, but we've also
expanded into other important areas...World domination.
--
fortune oscar homer
------------------------------
Date: 29 May 2000 06:05:47 -0700
From: Sue Spence <sue@pennine.com>
Subject: Re: Algorythm needed for copying subdirectory hierarchies
Message-Id: <8gtpvb$28ks@drn.newsguy.com>
In article <8gtmmg$a22$1@nnrp1.deja.com>, Makau says...
>
>
>> "tar cf - source-dir | (cd dest-dir ; tar xfBpf -)
>
>I typed litterally what you wrote:
>tar cf - source-dir | (cd dest-dir ; tar xfBpf -)
>
>(I replaced "source-dir" by the name of my source directory and
>"dest-dir" by the destination one)
>
>but tar returned the following error message :
>-
>tar: Old option `f' requires an argument.
>Try `tar --help' for more information.
>Broken pipe
>-
>
>Could you give the correct syntax, with an example (if possible)?
% tar cf - source-dir | (cd dest-dir ; tar xfBp -)
I'm not providing an example, because it will be more useful for you to try this
on your own system.
What's your platform? If it's Solaris, the above old trick is actually
documented on the man page for tar.
------------------------------
Date: Mon, 29 May 2000 16:39:31 GMT
From: Elaine Ashton <elaine@chaos.wustl.edu>
Subject: Re: Algorythm needed for copying subdirectory hierarchies
Message-Id: <B5581581.4FCD%elaine@chaos.wustl.edu>
in article 8gte0n$4j6$1@nnrp1.deja.com, Makau Divangamene at
makau@multimania.com quoth:
> It looks quite easy in the first approach. That's what I thought but as
> soon as I started coding, I got into the troubles of local variables
> ("my"/"local") in "foreach" loops, etc .. And this algorythm is _really_
> not easy to do. Actually it's a real challenge for me. Unfortunately I
> have to find the solution ....
>
> Hoping someone will be kind enough to help me solve the problem,
http://search.cpan.org/doc/GSAR/perl5.005_63/lib/File/Find.pm
http://www.cpan.org/authors/id/C/CH/CHANG-LIU/tree-sync.pl
These may be of some help. If you are looking to merely create a duplicate
copy of a directory[ies] structure then you may find rsync to be useful
which may be found at http://rsync.samba.org/ including a whitepaper on the
algorithm itself at http://rsync.samba.org/rsync/tech_report/.
And there is always dump/ufsdump and tar if you are merely wanting a backup
but that's a far uglier way to go if you want on-line copies. For on-line
copies there's the traditional oneliner of UNIX sysadmins:
(cd /orig/dir && tar cpf - .)|(cd /dest/dir && tar xpf -)
cheers
e.
------------------------------
Date: Mon, 29 May 2000 16:44:55 GMT
From: Makau Divangamene <makau@multimania.com>
Subject: Re: Algorythm needed for copying subdirectory hierarchies
Message-Id: <8gu6q4$l6f$1@nnrp1.deja.com>
> What's your platform?
Linux Red Hat
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 29 May 2000 16:49:21 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Algorythm needed for copying subdirectory hierarchies
Message-Id: <3934996b.1028525@news.skynet.be>
Makau Divangamene wrote:
>I have a subdirectories hierarchy that is so deep that doing a "cp -R"
>for a recursive copy doesn't work.
>
>So what I want to do is write an algorythm (using Perl) that will copy
>the hole directory tree with all its files (recursively) by doing -
>basically - a "cd <src/dir>; md <dest/dir>, cp * <dest/dir>, etc ..."
>> Did you look at the File::Find modules - it's part of the standard
>> Perl distribution and is very useful in situations like this.
>
>I've done a perldoc File::Find but this module doesn't seem to be too
>documented ... :(
It isn't? People who are familiar with ido think it's enough...
Anyway, here's basically what you can do (untested code!). You ought to
properly chown() the new directory and set it's file permissions.
#! perl -w
# the next two dirs ought to be passed on the command line...
my $srcroot = '/my/source/path';
my $destroot = '/my/dest/path';
my $length = length $srcroot;
use File::Find;
use File::Copy;
find sub {
my $dest = $File::Find::name; # full source path
substr($dest, 0, $length)= $destroot;
if(-d) {
mkdir $dest, 0777;
} elsif(-f _) {
copy $_, $dest;
}
}, $srcroot;
--
Bart.
------------------------------
Date: 29 May 2000 17:24:49 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: Algorythm needed for copying subdirectory hierarchies
Message-Id: <959620682.20239@itz.pp.sci.fi>
In article <3934996b.1028525@news.skynet.be>, Bart Lateur wrote:
> find sub {
> my $dest = $File::Find::name; # full source path
> substr($dest, 0, $length)= $destroot;
Maybe it's just a useless slowdown, but I'd probably be paranoid
enough to write the previous line as:
$dest =~ s/^\Q$srcroot/$destroot/
or warn "$dest not under $srcroot, skipping..\n" and return;
I'd probably also make sure both $srcroot and $destroot have a
trailing slash just to be certain..
> if(-d) {
> mkdir $dest, 0777;
> } elsif(-f _) {
> copy $_, $dest;
> }
> }, $srcroot;
--
Ilmari Karonen - http://www.sci.fi/~iltzu/
Please ignore Godzilla and its pseudonyms - do not feed the troll.
------------------------------
Date: Mon, 29 May 2000 16:05:13 GMT
From: lvanderb@ehmail.com
Subject: Array of hashes sorting question
Message-Id: <8gu4fg$jjb$1@nnrp1.deja.com>
Hi,
I've read and not quite understood many perl sorting faqs. I am willing
to go back and look again, but here's my question.
Why does
@sortedFields = sort {$fields[$a]{order} <=> $fields[$b]{order}};
give a syntax error?
I am trying to sort an array of hash references by a key that is in all
of the hashes that represents the order I want the hash references to
appear in the array.
So,
%date = ( name => "Event Date",
sort_field => "y",
field_format => "date",
field_length => "20",
field_default => "",
field_misc => "",
reqd_field => "y",
order => "3");
%eventName = ( name => "Name of Event",
sort_field => "y",
field_format => "string",
field_length => "25",
field_default => "",
field_misc => "",
reqd_field => "y",
order => "2");
%scroller = ( name => "Add to scroller?",
sort_field => "y",
field_format => "pick_list",
field_length => "",
field_default => "yes",
field_misc => ["yes","no"],
reqd_field => "y",
order => "1");
@fields = (\%date,\%eventName,\%scroller);
Then I try
@sortedFields = sort {$fields[$a]{order} <=> $fields[$b]{order}};
but I get a syntax error, for obvious reasons, I'm sure...I'm still
muzzy about referencing.
Thanks for any advice you can give me.
Linda
lvanderb@ehmail.com
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 29 May 2000 18:30:50 +0200
From: Alexander Knack <ak@dasburo.de>
To: lvanderb@ehmail.com
Subject: Re: Array of hashes sorting question
Message-Id: <39329B3A.91D019BC@dasburo.de>
> @sortedFields = sort {$fields[$a]{order} <=> $fields[$b]{order}};
try:
@sortedFields = sort {$fields[$a]{order} <=> $fields[$b]{order}}
@fields;
or perldoc -f sort :)
--
+--------------------------------------------------------------------+
| Alexander Knack ........Entropie erfordert keine Wartung .........|
| dasburo.de ..................................................|
+--------------------------------------------------------------------+
------------------------------
Date: Mon, 29 May 2000 18:53:50 +0100
From: Greg Griffiths <greg2@surfaid.org>
To: Fake51 <idamhNOidSPAM@mailcity.com.invalid>
Subject: Re: Bout mailhandling
Message-Id: <3932AEAE.BC522F65@surfaid.org>
probably the easiest way to do this is to save the emails into a local
mail box and then use PERL to trawl through the file, its quite a simple
job, mail for more.
Fake51 wrote:
>
> I need to write a program that takes the email received by a
> site, works on the data contained therein, and inserts it in a
> database. I figure this is sort of an easy thing to, but being a
> beginner, any/all help would be appreciated (on all aspects of
> the project).
>
> Thanx
> Fake
>
> * Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
> The fastest and easiest way to search and participate in Usenet - Free!
------------------------------
Date: Mon, 29 May 2000 08:16:04 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Calling a perl script from within another perl script
Message-Id: <slrn8j4ns4.5rr.tadmc@magna.metronet.com>
On Mon, 29 May 2000 05:12:10 -0700, John Chajecki <jchajNOjcSPAM@nvcs.freeserve.co.uk.invalid> wrote:
>I have scanned the printed manuals I have and the HTML perl
>documentation supplied with the distribution of ActivePerl 5.005
>however, nowhere do I find information on how to call on perl
>script from another.
How to call external programs (whether written in Perl or not)
is described in the Perl FAQ, part 8:
"How can I capture STDERR from an external command?"
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 29 May 2000 14:58:51 GMT
From: excalibor@my-deja.com
Subject: Re: Calling a perl script from within another perl script
Message-Id: <8gu0j3$gni$1@nnrp1.deja.com>
In article <slrn8j4ns4.5rr.tadmc@magna.metronet.com>,
tadmc@metronet.com (Tad McClellan) wrote:
> On Mon, 29 May 2000 05:12:10 -0700, John Chajecki
<jchajNOjcSPAM@nvcs.freeserve.co.uk.invalid> wrote:
>
> >I have scanned the printed manuals I have and the HTML perl
> >documentation supplied with the distribution of ActivePerl 5.005
> >however, nowhere do I find information on how to call on perl
> >script from another.
>
> How to call external programs (whether written in Perl or not)
> is described in the Perl FAQ, part 8:
>
> "How can I capture STDERR from an external command?"
Also, if you
do 'myscript.pl';
you'll read and execute that script and then return control to your
program... what I cannot remember if there's a name-space contamination
or not...
I know this is documented somewhere, though...
good luck,
d@
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 29 May 2000 15:32:33 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Can I do this using Perl?
Message-Id: <8gtv21$otp$1@orpheus.gellyfish.com>
On Sun, 28 May 2000 21:08:19 GMT Craig Berry wrote:
> Andrew Johnson (andrew-johnson@home.com) wrote:
> : In article <sj2ojgqj5pj45@corp.supernews.com>,
> : Craig Berry <cberry@cinenet.net> wrote:
> : [snip]
> : > Pretty trivial using the LWP modules, which have been part of
> : > the standard distribution in the last few releases of Perl.
> : > See for example
> :
> : I don't see the LWP modules in the standard 5.00503 or 5.6.0
> : distributions -- perhaps you mean they are bundled with the
> : activestate distribution (which doesn't make them part of the
> : standard distribution). Just a point of clarification.
>
> You're quite right; until you pointed it out, I thought the two were
> identical other than Windows-specific modules. Thanks for the catch.
ActivePerl needs LWP for PPM to work - the same goes for XML::Parser and
a couple of other things ... CPAN.pm will work with a base install but
will bid you to install some other stuff to get the best out of it.
/J\
--
Lisa, tha mob's working on getting your saxophone back, but we've also
expanded into other important areas...World domination.
--
fortune oscar homer
------------------------------
Date: Mon, 29 May 2000 17:39:27 +0100
From: "Alex Gough" <erebus@hushmail.com>
Subject: Re: Can I do this using Perl?
Message-Id: <8gu6g0$gh5$1@news.ox.ac.uk>
> ActivePerl needs LWP for PPM to work - the same goes for XML::Parser and
> a couple of other things ... CPAN.pm will work with a base install but
> will bid you to install some other stuff to get the best out of it.
>
This is something which confused me for a while when I started trying to
install modules. It took me a while to realise that some of them come
pre-installed (with active state) and I wasted quite a while trying to work
out what wasn't working.
If anyone else gets confused when trying to play with modules, it is always
useful to try:
use whatever::however;
in a simple script before tearing your hair out.
--
Alex Gough
------------------------------
Date: Mon, 29 May 2000 16:36:34 GMT
From: Ala Qumsieh <aqumsieh@hyperchip.com>
Subject: Re: Converting an alphanumeric string into an integer number
Message-Id: <7aln0t48ks.fsf@Merlin.i-did-not-set--mail-host-address--so-shoot-me>
Diablito <diab.litoNOdiSPAM@usa.net.invalid> writes:
> I have a variable 'word' (letters and numbers) and I want to
> convert that into an integer in the range of 1-100.
> I need something like a=1,b=2,c=3,...Then I want the script to
> calculate a x variable:(example) if word is 'dog' x=26,if
> it's 'cat' x=23 and so on.
In the spirit of Perl Golf, here's a couple of oneliners:
$x += ord($_) - 96 for split //, $word;
$x+=ord($_)-96for split//,$word; # above without spaces
$x+=ord($_)-96for$word=~/\S/g;
--Ala
------------------------------
Date: 29 May 2000 12:01:36 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: date command under win98 and apache
Message-Id: <8gtimg$gdl$1@orpheus.gellyfish.com>
On Sun, 28 May 2000 19:05:46 +0100 Dave Cross wrote:
> On Sun, 28 May 2000 17:41:25 GMT, "Gcaptain" <gcaptain@pandora.be>
> wrote:
>
>>ok i have the apache webserver running under win98
>>perl is installed correctly
>>
>>i have a script
>>
>>#!c:\perl\bin\perl
>>print "Content-Type: text/plain\n\n";
>>$current_date = `date`;
>>print "Today is : $current_date\n";
>>
>>but the date command does not work here
>>it brings out a question where i must enter the new date
>>
>>how can i solve this? i must get this running under win98
>
> Then use Perl's built-in date handling functions.
>
> perldoc -f localtime
>
And probably POSIX::strftime to get the nice format.
/J\
--
They're DOGS, and they're playing POKER!
--
fortune oscar homer
------------------------------
Date: Mon, 29 May 2000 19:14:42 +0300
From: "Alexey Alexapolsky" <wake@thukraine.com>
Subject: debugger - how to view vars?
Message-Id: <8gu5bo$hii$1@ark.cris.net>
Hi helper :-) I've dug all the docs on perl debugging
about how run , stop , set breakpoints but ... how to see values of
the variables I need ? Btw , is there better debuger the perl itself ?
Any free IDE wrapper?
Thanx in advance.
------------------------------
Date: 29 May 2000 11:31:00 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: debugger - how to view vars?
Message-Id: <87aeh9co8r.fsf@limey.hpcc.uh.edu>
>> On Mon, 29 May 2000 19:14:42 +0300,
>> "Alexey Alexapolsky" <wake@thukraine.com> said:
> Hi helper :-) I've dug all the docs on perl debugging
> about how run , stop , set breakpoints but ... how to
> see values of the variables I need ? Btw , is there
$ perl -d
Loading DB routines from perl5db.pl version 1.07
Editor support available.
Enter h or `h h' for help, or `man perldebug' for more help.
my $sclr = 42;
my @arr = qw(a b c d);
my %hash = (tony => 123456);
print "the end\n";
^D
main::(-:1): my $sclr = 42;
DB<4> s
main::(-:2): my @arr = qw(a b c d);
DB<4> s
main::(-:3): my %hash = (tony => 123456);
DB<4> s
main::(-:4): print "the end\n";
DB<4> x %hash
0 'tony'
1 123456
DB<5> x @arr
0 'a'
1 'b'
2 'c'
3 'd'
DB<6>
while running a program, Data::Dumper can be used to dump
out the contents of variables, q.v.
> better debuger the perl itself ? Any free IDE wrapper?
"ddd" can wrap up perl, and Emacs has a debugger mode too.
I think both of them use the debugger as invoked by -d.
hth
t
--
"Trying is the first step towards failure"
Homer Simpson
------------------------------
Date: 29 May 2000 15:20:00 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Does this exist?
Message-Id: <8gtuag$mh5$1@orpheus.gellyfish.com>
On Mon, 29 May 2000 05:47:17 GMT Falk wrote:
> Reply to: Dave Cross <dave@dave.org.uk>
> Subject: Re: Does this exist?
> Date: Sat, 27 May 2000 13:00:10 +0100
> Newsgroup(s): comp.lang.perl.misc
> Lines: 38
>
> Original text:
>>
>>This sounds like a question which would be more at home in
>>comp.infosystems.www.authoring.cgi. Did you ask over there?
>
> Yeah, I've tried to post there several times, with different issues,
> but none of my posts appear in that newsgroup, and I don't know why...
>
In your original post you had no valid From: or Reply-To: address - the
robo-moderation in comp.infosystems.www.authoring.cgi requires a valid
address in order to send you the instructions for registering yourself.
/J\
--
I can understand how they wouldn't let in those wild jungle apes, but
what about those really smart ones who live among us? Who roller-skate
and smoke cigars?
--
fortune oscar homer
------------------------------
Date: 29 May 2000 13:31:52 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Dos or Unix function
Message-Id: <8gtnvo$22n$1@orpheus.gellyfish.com>
On Sun, 28 May 2000 19:14:38 +1000 Peter Hill wrote:
> (you do mean Windows, not DOS, right?) and UNIX.
Probably but not absolutely :
C:\> perl -e 'print $^O'
dos
C:\> perl -v
This is perl, version 5.005_03 built for dos-djgpp
Copyright 1987-1999, Larry Wall
MS-DOS port Copyright (c) 1989, 1990, Diomidis Spinellis
djgpp v2 port (jpl5003c) by Hirofumi Watanabe, 1996
djgpp v2 port (perl5004+) by Laszlo Molnar, 1997-1998
(Although here this slightly complicated because this is a Linux machine)
/J\
--
They're DOGS, and they're playing POKER!
--
fortune oscar homer
------------------------------
Date: Mon, 29 May 2000 16:55:19 GMT
From: peter@PSDT.com (Peter J Scott)
Subject: Re: How do I become a memory hog?
Message-Id: <XhxY4.3098$F9.76138@news1.gvcl1.bc.home.com>
In article <0080d087.154ef91d@usw-ex0102-014.remarq.com>,
drc <dchungNOdcSPAM@amazon.com.invalid> writes:
>Here's a general question:
>
>I have a script which needs to hold in memory about twice as much
>as the default running of perl gives me. I am pretty sure that
>this will be more than enough, but I am not the most careful
>programmer in the world ;)
>
>Is there an easy way for me to reserve more memory? I've heard
>that there exists an unlimit function/option/command, but I don't
>know much about it.
It sounds like what you want to do is make sure at the outset of your
program that it can get the memory it needs by pre-allocating it.
The easiest way to do this is to pre-extend your largest data structures;
assuming you have some small number of hashes and arrays that are going
to hold your data, pre-size a hash with keys %hash = $large_number, and pre-size
an array with $#array = $large_number.
--
Peter Scott
------------------------------
Date: Mon, 29 May 2000 15:53:37 GMT
From: "Dale Winburn" <dwinburn@earthlink.net>
Subject: Perl CGI Script to generate web site statistics
Message-Id: <5owY4.8754$TZ2.325816@newsread1.prod.itd.earthlink.net>
I'm writing a CGI script to generate statistics for a web site. How can I
determine in the Perl CGI script which page called the CGI script?
I call the CGI script from the web page with <!--#exec
cgi="/cgi-bin/cgi01.cgi"-->.
I have tried a call with a command line input <!--#exec
cgi="/cgi-bin/cgi01.cgi mypage"--> then use @ARGV, but this gives me an
error on my host server.
I can find all kinds of single page counters, but all of these use separate
scripts and count files for each page. I would like to maintain all
statistics in one file.
Thanks for any and all help.
Dale Winburn
------------------------------
Date: 29 May 2000 12:00:45 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: perl cgi script?
Message-Id: <8gtikt$g84$1@orpheus.gellyfish.com>
On Sun, 28 May 2000 20:00:14 +0200 Lino Catucci wrote:
> Hello everybody,
>
> I hope you can help me with the following script. I have a Linux RedHat
> 6.1 machine and it is working as a pop3/smtp e-mail server and as a
> Apache webserver for around 300 users. Now i want to give the users
> the opportunity to change there Linux/pop3 password via the website by
> clicking a button. The users have to provide there username, the old
> password and twice there new password , then they have to click on a
> button called "change" and then there password has to be changed. I
> want to use a cgi script.
I think this falls into the category of things you dont want to try if
you have to ask how to do it. It will involve running your program setuid
and in the first place you should read the perlsec manpage before going
any further.
/J\
--
D'oh!!!
--
fortune oscar homer
------------------------------
Date: 29 May 2000 11:04:26 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Perl IDE for Win32?
Message-Id: <8gtfba$5en$1@orpheus.gellyfish.com>
On Mon, 29 May 2000 02:08:47 GMT osiris@mindless.com wrote:
> Hi All,
> I know this must have hashed over more times than *replace with
> something well hashed over* but has anyone got any recommendations for
> a solid Perl IDE under Win32? Preferably it would have syntax coloring
> and integrated FTP support (with symlink support). TIA.
>
Before the usual long and boring thread starts on the matter :
<http://www.perl.com/reference/query.cgi?editors>
Usually when you are sure that something must have been discussed before
you would be better off looking at <http://www.deja.com/home_ps.shtml>
to see if it has.
/J\
--
Now what is a wedding? Well, Webster's dictionary describes a wedding
as the process of removing weeds from one's garden.
--
fortune oscar homer
------------------------------
Date: Mon, 29 May 2000 16:45:22 GMT
From: Elaine Ashton <elaine@chaos.wustl.edu>
Subject: Re: Perl related humor?
Message-Id: <B55816E1.4FCF%elaine@chaos.wustl.edu>
in article 8gtm56$9np$1@nnrp1.deja.com, yuri_leikind@my-deja.com at
yuri_leikind@my-deja.com quoth:
> Can anyone point me to a collection of Perl related humor?
Not that you could tell that anyone in Perl has a sense of humour around
these parts there have been some rather funny April Fool's jokes.
http://history.perl.org/ has a few of them documented and you might also try
Carp.pm which spits out beautiful Haiku error messages.
e.
------------------------------
Date: 29 May 2000 11:50:27 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Perl script doesn't run
Message-Id: <8gti1j$e8v$1@orpheus.gellyfish.com>
[ 'line wrapping' fixed - one does tend to have lines of around 72
characters rather than a whole paragraph ]
On 29 May 2000 06:15:10 GMT Newbie wrote:
>
> I have a simple 'Hello world' script called test.pl that won't run. It's
> in the /home/httpd/cgi-bin directory. All directories are owned by
> root, I'm logged in as root, and the file permissions on the script
> are 755. It looks like:
>
> #!/usr/bin/perl print "Hello world\n";
Hang on shouldnt there be a new line in there ...
>
> A 'which perl' returns /usr/bin/perl.
>
> If I run it on the command line like 'perl test.pl', it runs fine. If I
> run it like './test.pl' or 'test.pl', I get a message that says "bash:
> /home/httpd/cgi-bin/test.pl: No such file or directory". I've tried
> all sorts of things. I can run shell scripts from the same directory
> with the same permissions, etc. What gives?
Well that would indicate that your shebang line isnt right. But if
'which perl' indicates that your perl is at /usr/bin/perl and that is
what you have got in your shebang then that is what you will get when
you type 'perl progname.pl' - I can only guess that you have something
else in your shebang line that is screwing you up - perhaps some
invisible control character immediately after the 'perl' ...
/J\
--
The only thing that the artist cannot see is the obvious. The only thing
that the public can see is the obvious. The result is the Criticism of
the Journalist.
--
fortune oscar homer
------------------------------
Date: 29 May 2000 08:41:41 GMT
From: Tushar Samant <Tbone@pimpdaddy.com>
Subject: Re: Perl unusable as a programming language
Message-Id: <8gtag5$qlq$1@news.enteract.com>
ariels@compugen.co.il writes:
>I think the hardest problem is probably understanding the Perl parser
>[...] The *semantics* of the language and primitives seem (to me) to
>cause far fewer problems.
The scary parts, actually, are the semantics... e.g. split /^/,
which carries an implicit /m, or f($1), which has no relation
to $1 at function call time.
------------------------------
Date: Mon, 29 May 2000 14:01:05 GMT
From: Andy <y-o-y@home.com>
Subject: Re: PerLotto v0.1a4
Message-Id: <BKuY4.215574$Tn4.1935298@news1.rdc2.pa.home.com>
In article <3be4jssqa5cc3fuo1nok597d3fcvoabn3o@4ax.com>, Dave Cross
<dave@dave.org.uk> wrote:
> I assume you're posting this for peer review, so I hope you don't mind
> if I jump in with a few suggestions...
Exactly! Going it alone is rough. All advice is appreciated! Yes, very
useful!!! Thank you!
Andy
------------------------------
Date: Mon, 29 May 2000 16:57:43 +0200
From: Alex Rhomberg <rhomberg@ife.ee.ethz.ch>
Subject: Re: PerLotto v0.1a4
Message-Id: <39328567.6B9C81F6@ife.ee.ethz.ch>
Dave Cross wrote:
> $a <=> $b is the default sort algorithm, so you don't need to specify
> it here
>
> @winners = sort @winners;
I'd rather rely on documentation than on vague memories:
perldoc -f sort
If SUBNAME or BLOCK is omitted, C<sort()>s in standard string comparison
order
> >@winners = sort {$a <=> $b} @winners;
This is better.
> >## Check for duplicate numbers in a game
>
> Personally I'd rewrite these loops to be more 'Perlish'. The for (;;)
> is very rarely used in Perl.
Personally, I'd make this Perlish by using a hash, as described in the
FAQ under "How do I compute the difference of two arrays? How do I
compute the intersection of two arrays?"
my %gamehash;
$gamehash{0+$_}++ and die "duplicate number on line $.!" for @game;
The 0+ is to normalise numbers (strip leading zeroes).
If $gamehash{0+$_} was nonzero, meaning $_ was already encountered, the
part after the "and" is executed, in this case a die statement.
> >## Main
> > foreach my $y (@winners) {
> > for my $x (@game) {
> > if ($y == $x) {
> > $picks++;
> > push @picked, $x;
> > }
> > }
> > }
Again, use a hash. Construct the hash at the beginning, and you can
simultaneously check for duplicate numbers as shown above:
#when winners are input at the beginning of the program
my %wins;
$wins{0+$_}++ and die for @winners;
#instead of pick double loop
$picks = @picked = grep {$wins{$_}} @game
- Alex
------------------------------
Date: Mon, 29 May 2000 17:12:06 +0100
From: Dave Cross <dave@dave.org.uk>
Subject: Re: PerLotto v0.1a4
Message-Id: <cg55jso18a0l67hb8ooreadtfre5m1jsp1@4ax.com>
On Mon, 29 May 2000 16:57:43 +0200, Alex Rhomberg
<rhomberg@ife.ee.ethz.ch> wrote:
>Dave Cross wrote:
>
>> $a <=> $b is the default sort algorithm, so you don't need to specify
>> it here
>>
>> @winners = sort @winners;
>
>I'd rather rely on documentation than on vague memories:
>perldoc -f sort
>If SUBNAME or BLOCK is omitted, C<sort()>s in standard string comparison
>order
>
>> >@winners = sort {$a <=> $b} @winners;
>This is better.
Absolutely right. Don't you hate it when you don't bother checking the
docs because you _know_ you're right - but then turn out to be wrog
anyway :-(
Sorry 'bout that.
>> >## Check for duplicate numbers in a game
>>
>> Personally I'd rewrite these loops to be more 'Perlish'. The for (;;)
>> is very rarely used in Perl.
>
>Personally, I'd make this Perlish by using a hash, as described in the
>FAQ under "How do I compute the difference of two arrays? How do I
>compute the intersection of two arrays?"
>
>my %gamehash;
>$gamehash{0+$_}++ and die "duplicate number on line $.!" for @game;
>
>The 0+ is to normalise numbers (strip leading zeroes).
>If $gamehash{0+$_} was nonzero, meaning $_ was already encountered, the
>part after the "and" is executed, in this case a die statement.
>
>> >## Main
>> > foreach my $y (@winners) {
>> > for my $x (@game) {
>> > if ($y == $x) {
>> > $picks++;
>> > push @picked, $x;
>> > }
>> > }
>> > }
>
>Again, use a hash. Construct the hash at the beginning, and you can
>simultaneously check for duplicate numbers as shown above:
>
>#when winners are input at the beginning of the program
>my %wins;
>$wins{0+$_}++ and die for @winners;
>
>#instead of pick double loop
>
>$picks = @picked = grep {$wins{$_}} @game
These are all valid corrections too. I was guilty of translaing what
Andy had written rather than going back one step further and trying to
work out waht he was actually doing!
Cheers,
Dave...
--
<http://www.dave.org.uk> SMS: sms@dave.org.uk
yapc::Europe - London, 22 - 24 Sep <http://www.yapc.org/Europe/>
"There ain't half been some clever bastards" - Ian Dury [RIP]
------------------------------
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 3195
**************************************