[10433] in Perl-Users-Digest
Perl-Users Digest, Issue: 4026 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Oct 20 18:03:13 1998
Date: Tue, 20 Oct 98 15:00:22 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 20 Oct 1998 Volume: 8 Number: 4026
Today's topics:
Re: Advice on style <uri@camel.fastserv.com>
Re: Advice on style <jdf@pobox.com>
Amputated Perl Code (Justin Wilde)
Re: Boston.pm will be Quiz Kings [was] Randal's Big Day <jdporter@min.net>
Re: Boston.pm will be Quiz Kings [was] Randal's Big Day <uri@camel.fastserv.com>
Re: CGI quandaries <rootbeer@teleport.com>
Re: CGI Sscript Exporting Excel File <rootbeer@teleport.com>
Re: curly quick question <jdf@pobox.com>
Re: Ftpmail (obviously from a non perl programmer) <rootbeer@teleport.com>
Re: help shorten one-liner jkane@my-dejanews.com
Re: help shorten one-liner <uri@camel.fastserv.com>
Re: how do you search subdirectories for a file? <jdporter@min.net>
how to get a column from a hash? oofness dtiberio6639@my-dejanews.com
Re: how to get a column from a hash? oofness <tchrist@mox.perl.com>
Re: Imagemaps on NT <rootbeer@teleport.com>
Re: Installing modules on Win'95 <due@murray.fordham.edu>
Re: LWP documentation (I R A Aggie)
Mutex with perl Win32 epierre@mail.esiea.fr
Re: New Module: File::Finder -- OO version of File::Fin <jdporter@min.net>
PERL ADO ODBC (John Hardy)
Perl Programming Training Workshop <dmurray@dgesolutions.com>
Re: Raleigh.pm (Raleigh, NC, USA perl mongers) has regi <jdporter@min.net>
sequential count <marx@idiom.com>
Re: Strict and Global Variables <uri@camel.fastserv.com>
Re: Thanks for the help on my Perl/CGI tutorial <ebohlman@netcom.com>
Re: Trouble scheduling Perl scripts with WinNT AT comma <gbuehler@NOSPAMmed.unc.edu>
Typing something without seeing with perl / Win NT <famillejacques@oceanet.fr>
Re: Typing something without seeing with perl / Win NT (Alastair)
Re: What isn't Perl good for? <uri@camel.fastserv.com>
Re: Who can help me write full-text search engine in Pe <uri@camel.fastserv.com>
Re: Who can help me write full-text search engine in Pe <dariusz@usa.net>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 20 Oct 1998 17:15:13 -0400
From: Uri Guttman <uri@camel.fastserv.com>
To: Ian Lowe <Ian_Lowe@fanniemae.com>
Subject: Re: Advice on style
Message-Id: <sar3e8jndem.fsf@camel.fastserv.com>
>>>>> "IL" == Ian Lowe <Ian_Lowe@fanniemae.com> writes:
IL> I am fairly certain that I have taken TMTOWTDI to new messy heights with
IL> the following script. Any suggestions on how it might be more succintly
IL> constructed would be greatly appreciated. Essentially I am trying to
IL> construct a filesystem monitor that interfaces with Tivoli. We have a
IL> very large Unix environment and our filesystems range from 300 MB to
IL> over 20 GB. For this reason, an out of the box filesystem monitor
IL> doesn't really do the trick. For instance, 90% capacity is of far
IL> greater concern to us on the 300 MB filesystem than on the 20 GB one.
IL> There must be a more efficient way to do this, than what I have here,
IL> but I'm fairly new to perl. It does work, though :)
IL> A final question: How could you go about building a table-driven
IL> ruleset for filesystem monitoring? As you will see from the script, I
IL> am just keying on percentage capacity but it would be much more granular
IL> if I could correlate between filesystem size and space remaining. For
IL> instance:
IL> FS Size WARNING CRITICAL
IL> 300-600MB 80% (60-120MB remaining) 90% (30-60MB remaining)
IL> 600MB-5GB 90% (60-500MB remaining) 95% (30-250MB remaining)
IL> 5GB-10GB 95% (250-500MB remaining) 97% (150-300MB remaining)
here are some comments on your code and some ideas on redesigning it.
IL> #!/export/Tivoli/efmperl/bin/perl -w
IL> use strict;
-w and strict! good boy!
IL> use Sys::Hostname;
IL> my $efm = "/export/Tivoli/efmbin/efmlog";
IL> my $host = hostname();
IL> my $fs;
IL> my %size = ();
IL> my %capacity = ();
no need for = (). they are empty when created.
and the last 3 lines are not needed in my rewrite.
IL> open(DF,"/usr/ucb/df -Fufs | grep -v Filesystem |");
bad boy! you didn't check the result of open. and you could have skipped
the grep by just reading the first line before the loop below
open(DF,"/usr/ucb/df -Fufs |") || die "can't run df $!\n" ;
<DF> ; # read and ignore the df headers line
IL> while (<DF>) {
IL> chomp;
IL> my ($kbytes,$capacity,$fs) = (split(/\s+/))[1,4,5];
IL> $kbytes = $kbytes / 1024;
IL> $capacity =~ s/%$//;
&check_df( $fs, $kbytes, $capacity ) ;
IL> }
just call the sub from the loop and skip the size and capacity hashes:
the code was very redundant and begs to be table driven like you
asked. here is an untested but likely to work example you along.
# max size warn level err level
my @df_levels = (
[ 600, 80, 90],
[ 5000, 90, 95],
[ 10000, 95, 97],
[ 30000, 97, 99],
) ;
sub check_df {
my( $fs, $kbytes, $capacity ) = @_ ;
my( $levels_ref, $max_size, $warn_pct, $err_pct ) ;
foreach $levels_ref ( @df_levels ) {
( $max_size, $warn_pct, $err_pct ) = @{$levels_ref} ;
next if $kbytes > $max_size ;
return if $capacity < $warn_pct ;
if ( $capacity < $err_pct ) {
system( <<SYS ) ;
$efm WARNING FILESYSTEM_FULL $host $host '"$fs is $capacity% full on $host"'
SYS
return ;
}
system( <<SYS ) ;
$efm CRITICAL FILESYSTEM_FULL $host $host '"$fs is $capacity% full on $host"'
SYS
}
print "$fs is too big to check\n" ;
}
--
Uri Guttman Fast Engines -- The Leader in Fast CGI Technology
uri@fastengines.com http://www.fastengines.com
------------------------------
Date: 20 Oct 1998 23:57:34 +0200
From: Jonathan Feinberg <jdf@pobox.com>
To: Ian Lowe <Ian_Lowe@fanniemae.com>
Subject: Re: Advice on style
Message-Id: <m3u30yj3qp.fsf@joshua.panix.com>
Ian Lowe <Ian_Lowe@fanniemae.com> writes:
> open(DF,"/usr/ucb/df -Fufs | grep -v Filesystem |");
You should check the open() for success, as with any system call. As
a matter of preference, I'd get rid of grep -v and check the lines
myself, as in
next if /Filesystem/;
You should close DF when finished with it, and check the returned
value of close().
> my ($kbytes,$capacity,$fs) = (split(/\s+/))[1,4,5];
I'm guessing that you mean "split on whitespace", which is
idiomatically spelled
split ' '
This spelling has advantages that are explained in the docs for
split().
> foreach $fs (keys (%size)) {
This is a little confusing, since you're using $fs above in one way,
and using in a different way here. You might want to be explicit that
this is a different $fs:
foreach my $fs (whatever) {
> if ($size{$fs} >= 0 and $size{$fs} <= 300) {
> push (@a,$fs);
> }
> elsif ($size{$fs} > 300 and $size{$fs} <= 600) {
You already know that it's greater than 300. There's a lot of extra
typing like this in your code.
> system("$efm WARNING FILESYSTEM_FULL $host $host '\"$fs is
> $capacity{$fs}% full on $host\"'");
You neglect to check the return status of system().
These are microscopic comments, which don't touch on the larger issues
of design, but I hope they're helpful.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: Tue, 20 Oct 1998 15:13:00 -0600
From: jwilde@openskies.com (Justin Wilde)
Subject: Amputated Perl Code
Message-Id: <362CFCDC.F4FA4367@openskies.com>
Looking in my perl error log, I see dozens of entries containing:
"Missing right bracket at [path]\xxx.cgi line xxx, at end of line
syntax error at [path]\xxx.cgi line xxx, at EOF
Execution of [path]\xxx.cgi aborted due to compilation errors."
Normally these scripts run fine, but it appears that occasionally they
are cut short, often midway through a bracketed block of code. I assume
this is what's happening because the line of code the perl compiler
considers to be EOF is only partway through my file.
What might cause this? The scripts are used only to process STDIN and
display html pages. Concurrency wouldn't be an issue, would it?
Any ideas would be greatly appreciated.
Justin Wilde
jwilde@openskies.com
------------------------------
Date: Tue, 20 Oct 1998 17:24:48 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Boston.pm will be Quiz Kings [was] Randal's Big Day in Big D
Message-Id: <362CFFA0.5BDD9460@min.net>
Adam Turoff wrote:
>
> The world can be divided into two equal parts -
> New York and Greater New York. Youse gotta problem wit dat?
Everyone seems to be forgetting that all of North America
should properly by called Virginia. At least, according to some
(rather old) maps I have. :-)
--
John "Gashlycrumb" Porter
"A fugitive and lurid gleam
Obliquely gilds the gliding stream." -- EG
------------------------------
Date: 20 Oct 1998 17:31:41 -0400
From: Uri Guttman <uri@camel.fastserv.com>
To: John Porter <jdporter@min.net>
Subject: Re: Boston.pm will be Quiz Kings [was] Randal's Big Day in Big D
Message-Id: <sarr9w2ncn6.fsf@camel.fastserv.com>
>>>>> "JP" == John Porter <jdporter@min.net> writes:
JP> Adam Turoff wrote:
>> The world can be divided into two equal parts - New York and
>> Greater New York. Youse gotta problem wit dat?
JP> Everyone seems to be forgetting that all of North America should
JP> properly by called Virginia. At least, according to some (rather
JP> old) maps I have. :-)
wrong again john,
there can't be any old maps since map didn't exist before perl5.
:-)
uri
--
Uri Guttman Fast Engines -- The Leader in Fast CGI Technology
uri@fastengines.com http://www.fastengines.com
------------------------------
Date: Tue, 20 Oct 1998 21:18:31 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: CGI quandaries
Message-Id: <Pine.GSO.4.02A.9810201417330.5534-100000@user2.teleport.com>
On Tue, 20 Oct 1998, Marty Landman wrote:
> Well I tried adding my parm as an additional path qualifier and get a
> server error.
If you're following the proper protocol but some browser or server doesn't
cooperate, then it's the other program's fault. If you're not following
the protocol, then it's your fault. If you aren't sure about the protocol,
you should read the protocol specification. If you've read it and you're
still not sure, you should ask in a newsgroup about the protocol.
> <rant>I've found Perl the absolutely hardest thing in the world to
> learn.
It may indeed be hard to learn. But it sounds as if your server is harder
to work with than Perl.
Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 20 Oct 1998 21:32:36 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: CGI Sscript Exporting Excel File
Message-Id: <Pine.GSO.4.02A.9810201431090.5534-100000@user2.teleport.com>
On Mon, 19 Oct 1998, user wrote:
> From: user <user@cisco.com>
> Reply-To: USERID@cisco.com
Really?
> 1. Is there a way to export this file other than a
> Tab delimieted file ?
The documentation for your application should be able to tell you what
file formats it can export.
> 2. If this fileis about 10-13 K it akes very long to down load.
> ( text/thml and tab delimited file)
>
> Id there a way to mke it faster or
> solely depends on PC ?
There may be several ways to make the download faster, but none of them
are Perl-specific. Perhaps you should see about compressing the data. Good
luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 20 Oct 1998 23:43:24 +0200
From: Jonathan Feinberg <jdf@pobox.com>
To: Arran Price <arranp@datamail.co.nz>
Subject: Re: curly quick question
Message-Id: <m3ww5uj4eb.fsf@joshua.panix.com>
Arran Price <arranp@datamail.co.nz> writes:
> Why does the print happen after the system call has finished?
See the perlvar document, and check out the $| ($OUTPUT_AUTOFLUSH)
variable.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: Tue, 20 Oct 1998 21:06:21 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Ftpmail (obviously from a non perl programmer)
Message-Id: <Pine.GSO.4.02A.9810201403140.5534-100000@user2.teleport.com>
On Mon, 19 Oct 1998, Lawrence Frewin wrote:
> I have found a script called ftpmail.pl on the web. There doesn't appear
> to be much in the way of help files with it. Has anyone used it that can
> let me know if it will do what I need it for?
Yes, the author can. If the author won't (even!) tell you what the
software does, how can you have any confidence that it won't erase your
files, burn out your monitor, and leave cookie crumbs in your bed?
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 20 Oct 1998 20:57:07 GMT
From: jkane@my-dejanews.com
Subject: Re: help shorten one-liner
Message-Id: <70itf3$ce6$1@nnrp1.dejanews.com>
In article <sarhfwznnvd.fsf@camel.fastserv.com>,
Uri Guttman <uri@camel.fastserv.com> wrote:
> >> Anybody have a better way of doing this?? The shortest one has to
> >> use 'wc -l' and `expr`. I want to make this ONLY perl.
>
> SM> perl -lne '$a++ if /(;|{|}).*# .*/; END { print $a-1 }'
> SM> perl_script
>
> why are you both using alternation of single chars when you could use a
> char class? it is easier to read and probably faster. and since you
> don't use the grouping to grab the text, you could have used (?:) or
> with a char class, remove the ().
>
> so this is shorter and probably faster.
>
> perl -lne '$a++ if /[;{}].*# .*/; END { print $a-1 }'
This is just what I was looking for. I like the char class idea. I used it
elsewhere, but forgot about doing it here! This needs a ,"\n" to put the
newline after it, but still shorter.
One problem! I can't get the END word to work. A couple of people have
suggested this format, but it fails with ...
syntax error in file /tmp/perl-ea06855 at line 1, next 2 tokens "END {"
syntax error in file /tmp/perl-ea06855 at line 2, next token "}"
I am using 4.0.1.8, is this an old version that doesn't support that?
Thanks for all your help. I am really finding perl to be usable. A little
unconventional maybe, but I guess that is what makes it so versitle. I just
hope people comment their code, because there are so many ways to do stuff
that it will be hard to follow someone!
> Uri Guttman Fast Engines -- The Leader in Fast CGI
Technology
> uri@fastengines.com
http://www.fastengines.com
>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 20 Oct 1998 17:23:44 -0400
From: Uri Guttman <uri@camel.fastserv.com>
To: jkane@my-dejanews.com
Subject: Re: help shorten one-liner
Message-Id: <saru30zlyfz.fsf@camel.fastserv.com>
>>>>> "j" == jkane <jkane@my-dejanews.com> writes:
j> In article <sarhfwznnvd.fsf@camel.fastserv.com>, Uri Guttman
j> <uri@camel.fastserv.com> wrote:
>> perl -lne '$a++ if /[;{}].*# .*/; END { print $a-1 }'
j> This is just what I was looking for. I like the char class idea.
j> I used it elsewhere, but forgot about doing it here! This needs a
j> ,"\n" to put the newline after it, but still shorter.
j> One problem! I can't get the END word to work. A couple of people
j> have suggested this format, but it fails with ...
j> syntax error in file /tmp/perl-ea06855 at line 1, next 2 tokens
j> "END {" syntax error in file /tmp/perl-ea06855 at line 2, next
j> token "}"
j> I am using 4.0.1.8, is this an old version that doesn't support
j> that?
oy gevalt!! that is as old as ronald reagan! and about as useful!
get the latest perl and drop that 4.x fast.
END is a perl5 feature.
uri
--
Uri Guttman Fast Engines -- The Leader in Fast CGI Technology
uri@fastengines.com http://www.fastengines.com
------------------------------
Date: Tue, 20 Oct 1998 17:18:50 -0400
From: John Porter <jdporter@min.net>
Subject: Re: how do you search subdirectories for a file?
Message-Id: <362CFE3A.25B7ACAD@min.net>
Daniel Beckham wrote:
>
> Holy cow. I never new about File::Find. I'm sitting here writing a
> recursive function to search html files for a string to replace and I
> nearly finished it when I stumbled across this thread.
This is often the thing that jolts a perl hacker's mentality from
"I know I can write this" to "Better check the CPAN first".
CPAN is our friend. (So is Deja News.)
--
John "Gashlycrumb" Porter
"A fugitive and lurid gleam
Obliquely gilds the gliding stream." -- EG
------------------------------
Date: Tue, 20 Oct 1998 21:19:00 GMT
From: dtiberio6639@my-dejanews.com
Subject: how to get a column from a hash? oofness
Message-Id: <70iuo5$dta$1@nnrp1.dejanews.com>
I have a hash, and would like ot get a column from it.
Here is an example:
$var{$type, $subtype} = $val;
now how do I get a variable that contains all entries where $type
is a specific value, or how do I get a variable that contains all
entries where $subtype equals a specific value?
$var{bill, banana} = 10;
$var{bill, soda} = 20;
$var{jen, banana} = 5;
$var{fred, banana} = 20;
$var{fred, potato} = 1;
now how do I get all entries for "fred"?
or how do I get all entries for "banana"?
what I am doing right now is looping through all the values, and building
a new hash or stack, but there must be a better way!
dtiberio
oofness
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: 20 Oct 1998 21:42:19 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: how to get a column from a hash? oofness
Message-Id: <70j03r$bgc$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
dtiberio6639@my-dejanews.com writes:
:I have a hash, and would like ot get a column from it.
:Here is an example:
:$var{$type, $subtype} = $val;
Don't do that.
$var{$type}{$subtype} = $val;
Will make you much happier for your immediate purposes.
--tom
--
It is, of course, written in Perl. Translation to C is left as an
exercise for the reader. :-) --Larry Wall in <7448@jpl-devvax.JPL.NASA.GOV>
------------------------------
Date: Tue, 20 Oct 1998 21:24:28 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Imagemaps on NT
Message-Id: <Pine.GSO.4.02A.9810201424140.5534-100000@user2.teleport.com>
On Mon, 19 Oct 1998, Cliff Corder wrote:
> Does anyone know where I can find a script for server-side imagemaps
> on NT?
If you're wishing merely to _find_ (as opposed to write) programs,
this newsgroup may not be the best resource for you. There are many
freeware and shareware archives which you can find by searching Yahoo
or a similar service. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 20 Oct 1998 21:30:17 GMT
From: "Allan M. Due" <due@murray.fordham.edu>
Subject: Re: Installing modules on Win'95
Message-Id: <70ivd9$d35$0@206.165.167.198>
Well,
Apparently I am missing any long term memory processing. Dmake comes
with the Standard version not the activestate version. Sorry about that.
Comes from two installations on the same system. It just has always worked
for me and I forgot when I installed it.
AmD
Allan M. Due wrote in message <70gbe9$9u7$0@206.165.167.223>...
>
>I am sure I am missing something but why not just use dmake which comes
with
>the activestate distribution? It works fine for me.
------------------------------
Date: Tue, 20 Oct 1998 16:49:50 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: LWP documentation
Message-Id: <fl_aggie-2010981649500001@aggie.coaps.fsu.edu>
In article <slrn72podi.qt.root@ernie.sesamstraat>,
kp@multiweb.nl.NO_JUNK_MAIL wrote:
+ Am I correct that URI::Escape is not mentioned anywhere in the LWP
+ docs?
As far as I can tell, no.
+ I never knew I could 'man URI::Escape'...
Or just:
% perldoc URI::Escape
NAME
URI::Escape - Escape and unescape unsafe characters
James
------------------------------
Date: Tue, 20 Oct 1998 20:51:41 GMT
From: epierre@mail.esiea.fr
Subject: Mutex with perl Win32
Message-Id: <70it4t$c1n$1@nnrp1.dejanews.com>
Hi,
I'm deadly needing some help on creation mutex objects in Perl Win32 for
two different process not to write on a file at the same time.
Thanks for answering me fast with some example, it's really urgent for me !
TIA
-- -= Emmanuel PIERRE ICQ: 19153556 epierre-nospam@mail.esiea.fr =-
www.e-nef.com www.esiea.fr/public_html/Emmanuel.PIERRE
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 20 Oct 1998 17:08:24 -0400
From: John Porter <jdporter@min.net>
Subject: Re: New Module: File::Finder -- OO version of File::Find
Message-Id: <362CFBC8.B7D35969@min.net>
Uri Guttman wrote:
>
> >>>>> "JP" == John Porter <jdporter@min.net> writes:
>
> JP> also, you are chdir'd
^^^^^
> JP> to that directory whenever the callback is called.
>
> having followed this thread, that seems to be a doc bug.
> i can't find chdir anymore in your code below there!
Yes it is a doc bug. Thanks!
--
John "Gashlycrumb" Porter
"A fugitive and lurid gleam
Obliquely gilds the gliding stream." -- EG
------------------------------
Date: Tue, 20 Oct 1998 21:16:07 GMT
From: jhardy@cins.com (John Hardy)
Subject: PERL ADO ODBC
Message-Id: <r47X1.235$4k4.73091@198.235.216.4>
Well I have looked everywhere over the past week or so and have not found
anything worthwhile concerning PERL and ADO. Whenever you mention PERL
accessing MSSQL you immediatley get pointed to DBI and DBD, Or worse ASP!
The reason why I prefer to find something related to PERL and ADO only is
because I have heard it is becoming a very popular way to access SQL through
PERL and is faster then DBI, also more portable.
simply install PERL, setup and ODBC driver and away you go.
I have a small PERL script that will SELECT from an SQL database but because I
am new to PERL I am not able to figure out how to send form data to the SQL
statement to be passed back and forth. If anyone has or is willing to write a
small script to do this using PERL - ODBC and ADO I would be willing to pay for
it. I need a script with good explanation in order to get me going on how to
pass form data to an SQL statement in PERL and how to retrive info from SQL and
pass it back to a web page.
Thanks
John
jhardy@cins.com
------------------------------
Date: Tue, 20 Oct 1998 21:05:10 GMT
From: "Deborah Murray" <dmurray@dgesolutions.com>
Subject: Perl Programming Training Workshop
Message-Id: <01bdfc6e$9becee40$cc98c9d0@debhome>
UniForum Technology Training Institute presents:
Accelerated Perl Programming Training
December 16-17, 1998 -and- January 29-30, 1999
San Jose, CA
For more information, visit the Web @
http://www.uniforum.org/web/education/perlworkshop.html
or call 1-800-333-8649.
------------------------------
Date: Tue, 20 Oct 1998 17:16:20 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Raleigh.pm (Raleigh, NC, USA perl mongers) has registered
Message-Id: <362CFDA4.1DAF76DA@min.net>
Adam Turoff wrote:
>
> Whiskey is made all over the world. Malt whiskeys are made all over
> the
> world. But only whiskey brewed, distilled and aged in Scotland may
> legally receive the appelation 'Scotch [Whiskey]'.
Right, according to U.S. law. Is there an international law that
covers this? And are the French signatory to it? Bet not.
> Any single malt is from Scotland.
No, any single malt *Scotch* is from Scotland.
Single malt means one malt. I don't think the Scottish have
a patent on that.
--
John "Gashlycrumb" Porter
"A fugitive and lurid gleam
Obliquely gilds the gliding stream." -- EG
------------------------------
Date: Tue, 20 Oct 1998 16:31:50 -0500
From: "Marcus J. Foody" <marx@idiom.com>
Subject: sequential count
Message-Id: <362D0146.13FB@idiom.com>
Hello,
I'm struggling with a count routine. What I need is a sequential count
of the lines within a receivable. The counter should restart with 1 for
each new receivable. The counter will be based on Column two. The
solution will hopefully look like the Sequential count column.
Column
Sequential
two count column
Receivable 1 |709 216:05:09|016967|1|1|PRODUCT
DESCRIPTION|2|1000.00|2|| 1
Receivable 2 |709 216:05:09|016968|2|1|PRODUCT
DESCRIPTION|1|1500.00|1|| 1
Receivable 2 |709 216:05:09|016968|2|2|PRODUCT
DESCRIPTION|4|1000.00|4|| 2
Receivable 3 |709 216:05:09|016969|3|1|PRODUCT
DESCRIPTION|1|2000.00|1|| 1
thank
marcus
------------------------------
Date: 20 Oct 1998 17:16:34 -0400
From: Uri Guttman <uri@camel.fastserv.com>
Subject: Re: Strict and Global Variables
Message-Id: <sarzparlyrx.fsf@camel.fastserv.com>
>>>>> "AQ" == Ala Qumsieh <aqumsieh@matrox.com> writes:
>>
>> these my variables are global to the file, not the program. if you
>> included other perl code via use or require, that code would not see
>> these my vars.
>>
>> your comment is only true if the program is a single file of perl code
>> with no outside code read in.
AQ> That is correct .. I know that and I guess I should've been clearer with
AQ> my reply. When I said "your program" I meant "your file" .. although, as
AQ> you said, that is not generally true.
AQ> Shall I slap myself again?
nahh, let us have the fun!!
smack, smack!
:-)
uri
--
Uri Guttman Fast Engines -- The Leader in Fast CGI Technology
uri@fastengines.com http://www.fastengines.com
------------------------------
Date: Tue, 20 Oct 1998 21:13:54 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Thanks for the help on my Perl/CGI tutorial
Message-Id: <ebohlmanF159n7.Inv@netcom.com>
John Callender <jbc@west.net> wrote:
: There was really just one major suggestion that I failed to implement;
: one reviewer wanted me to add "use strict" to the sample form-to-email
: and guestbook scripts. After thinking about it, I decided not to. Given
: the no-programming-experience-assumed nature of the tutorial, I just
: couldn't bring myself to add the additional burden of learning about
: lexical scoping on top of all the other new concepts this hypothetical
: non-programmer would be grappling with.
Why not just tell them that any time they use a variable, they have to
declare it using "my" at the beginning of their script? That's an
acceptable simplification for newbie programmers. The point of doing this
is that if your readers master this relatively small detail up front, they
can later save themselves *hours* of frustration in tracking down the sort
of bugs that can be prevented by requiring all variables to be declared.
------------------------------
Date: Tue, 20 Oct 1998 17:05:44 -0400
From: "Georg Buehler" <gbuehler@NOSPAMmed.unc.edu>
Subject: Re: Trouble scheduling Perl scripts with WinNT AT command
Message-Id: <70iu91$mk4$1@camel19.mindspring.com>
BTW, I figured out what I was doing wrong.
Let this be a lesson to you all:
WATCH OUT FOR RELATIVE PATHS!
A relative path might be valid for just executing a script from a command
line, and then be completely invalid when you schedule it to be executed by
the Schedule service. Evidently the Schedule service interprets relative
paths from itself, not the script. Or something like that.
In any case, once I replaced all my relative paths with absolute paths my
script was executed fine by the Schedule service.
--Georg
Georg Buehler wrote in message <707o3i$305$1@camel25.mindspring.com>...
>I've read in the FAQs that folks use the "at" command in WinNT to schedule
>events. However, I'll be gosh-durned if I can make it work in my system.
>
>I've tried every permutation of the commands that I can think of:
>at 03:00 perl e:\weblogs\getdailylog.pl
>at 03:00 cmd /c perl e:\weblogs\getdailylog.pl
>at 03:00 "e:\perl\5.00502\bin\MSWin32-x86-object\bin\perl.exe
>e:\weblogs\getdailylog.pl"
>
>Nothing seems to work. I know my script is working properly, it runs
without
>a hitch from a command-line, manaully. The schedule service is working, I
>can successfully schedule NT commands, just not my Perl scripts.
>What am I missing?
>
>--Georg Buehler
>gbuehler@elsitech.com
>
>
>
>
------------------------------
Date: Tue, 20 Oct 1998 23:25:25 +0200
From: "Famille JACQUES" <famillejacques@oceanet.fr>
Subject: Typing something without seeing with perl / Win NT
Message-Id: <70iv23$6o9$1@jaydee.iway.fr>
My problem is :
I want the user to type something (here, a
password), without seeing it (just stars
instead (*), for example).
I found a script which may work with
MS-DOS, but it just don't do the job
with WIN NT 4 (with IOSUBSYS).
I know it's possible to do "stty noecho" under
UNIX, but I'm working with NT :'(
Does someone has something for me ?
------------------------------
Date: Tue, 20 Oct 1998 21:47:20 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: Typing something without seeing with perl / Win NT
Message-Id: <slrn72q4vp.7f.alastair@calliope.demon.co.uk>
Famille JACQUES <famillejacques@oceanet.fr> wrote:
>My problem is :
>
>I want the user to type something (here, a
>password), without seeing it (just stars
>instead (*), for example).
You might want to look at the Term::Readkey module on CPAN ;
http://www.cpan.org
(look for the modules/Term directory I think).
HTH.
--
Alastair
work : alastair@psoft.co.uk
home : alastair@calliope.demon.co.uk
------------------------------
Date: 20 Oct 1998 17:20:45 -0400
From: Uri Guttman <uri@camel.fastserv.com>
Subject: Re: What isn't Perl good for?
Message-Id: <sarvhlflyky.fsf@camel.fastserv.com>
>>>>> "JWL" == Joergen W Lang <jwl@_munged_worldmusic.de> writes:
JWL> Earl Westerlund <earlw@kodak.com> wrote:
>> Elaine -HappyFunBall- Ashton wrote:
>>
>> > The day Perl makes coffee and muffins
>> > for me in the morning, I'll never have eyes for another language. :)
>>
>> So which language does this?? :)
JWL> Perl does ;-)
JWL> But there's some trouble: It handles the make("coffee", "muffins")
JWL> subroutines fine, but when it's finished making, it push()es the items
JWL> on the @tray and the coffee gets spilled and the muffins are torn to
JWL> <CHUNK>s.
JWL> I have tried a workaround in which I pipe the coffee to the bitbucket.
JWL> Works, technically, but looks ugly on the breakfast table.
JWL> The "strict" pragma does not work, either. If I say:
JWL> use strict qw(diet); so I have to predeclare the numbers of spoons of
JWL> sugar and only can order decaf, again it choke()s and tells me it can't
JWL> find the right sugar package.
JWL> What can I do ??? :-((
stop drinking coffee!
i never touch the stuff! (i don't like the flavor)
uri
--
Uri Guttman Fast Engines -- The Leader in Fast CGI Technology
uri@fastengines.com http://www.fastengines.com
------------------------------
Date: 20 Oct 1998 17:19:12 -0400
From: Uri Guttman <uri@camel.fastserv.com>
To: dariusz@usa.net
Subject: Re: Who can help me write full-text search engine in Perl with indexing
Message-Id: <saryaqblynj.fsf@camel.fastserv.com>
>>>>> "DJ" == Darius Jack <dariusz@usa.net> writes:
DJ> Who can help me write search engine to search kew words in full texts,
DJ> in Perl, running locally under Perl for DOS.
DJ> Or ready-made script please.
DJ> jack
only god (or larry wall) can do such a thing in perl. begone blasphemer
or you will be forced to use DOS! oops, you are using DOS, ignore that
last comment.
this group is to help people with the perl language, not do work for
people.
uri
--
Uri Guttman Fast Engines -- The Leader in Fast CGI Technology
uri@fastengines.com http://www.fastengines.com
------------------------------
Date: Tue, 20 Oct 1998 21:51:15 GMT
From: Darius Jack <dariusz@usa.net>
Subject: Re: Who can help me write full-text search engine in Perl with indexing
Message-Id: <362CF596.471D@usa.net>
Uri Guttman wrote:
>
> >>>>> "DJ" == Darius Jack <dariusz@usa.net> writes:
>
> DJ> Who can help me write search engine to search kew words in full texts,
> DJ> in Perl, running locally under Perl for DOS.
> DJ> Or ready-made script please.
> DJ> jack
>
> only god (or larry wall) can do such a thing in perl. begone blasphemer
> or you will be forced to use DOS! oops, you are using DOS, ignore that
> last comment.
>
> this group is to help people with the perl language, not do work for
> people.
>
> uri
thanks Uri,
I don't ask you to work on my project in Perl, you have your products
I need to have mine in Perl.
I am working on Perl models of the real full-text search engines for
testing purposes.
Think you FastCGI is a good solution.
Hope to meet some enthiusiasts to work together and discuss on this
list.
Jack
>
> --
> Uri Guttman Fast Engines -- The Leader in Fast CGI Technology
> uri@fastengines.com http://www.fastengines.com
------------------------------
Date: 12 Jul 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 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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 4026
**************************************