[13476] in Perl-Users-Digest
Perl-Users Digest, Issue: 886 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Sep 23 11:19:24 1999
Date: Thu, 23 Sep 1999 08:05:13 -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: <938099113-v9-i886@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 23 Sep 1999 Volume: 9 Number: 886
Today's topics:
Re: Ad hominem (was Re: perl related question now!) <elaine@chaos.wustl.edu>
Re: applications of perl ?? (Kragen Sitaker)
Re: applications of perl ?? (Tramm Hudson)
Re: Automating Secure Copy using Perl <jodok@my-deja.com>
Re: beauty of a Y2K bug (Kragen Sitaker)
Comparing lines in two files using arrays. <keithcp@hotmail.com>
Re: Comparing lines in two files using arrays. <keithcp@hotmail.com>
Re: Example commandline programs in perl (Kragen Sitaker)
Re: Grouping in REs, no doc found <ltl@rgsun5.viasystems.com>
How can I "undo" a require ? <csaba.raduly@sophos.com>
Re: How can I "undo" a require ? (Thomas Fischer)
Re: My glob failed <synced@austin.rr.com>
Re: My glob failed (Anno Siegel)
Re: PERL ERROR- How to setup in the NT Regedit & Win32: (Kragen Sitaker)
Perl Script Within VB for Web Pages <russkatz@erols.com>
Re: PROBLEM with PERL script in NT platform (Kragen Sitaker)
proper 'my' usage <marty@catnmoose.com>
Re: range of array indexes (M.J.T. Guy)
Re: REQ: tell-a-friend script <earlw@kodak.com>
Re: Setting process name (Bill Moseley)
Re: sorting like numbers an array of strings (Larry Rosler)
toLowercase?? (Thomas Fischer)
Re: toLowercase?? <elaine@chaos.wustl.edu>
Re: toLowercase?? <codex@bearclaw.bogus.net>
Re: toLowercase?? <koharik@primenet.com>
Re: Unix password parser (Kragen Sitaker)
Re: You should be admired <kperrier@blkbox.com>
Re: You should be admired <kperrier@blkbox.com>
Re: You should be admired (Matthew Bafford)
Re: You should be admired (Henry Penninkilampi)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 23 Sep 1999 09:36:35 -0400
From: Elaine -HFB- Ashton <elaine@chaos.wustl.edu>
Subject: Re: Ad hominem (was Re: perl related question now!)
Message-Id: <37EA2C12.76EB1DD8@chaos.wustl.edu>
Anno Siegel wrote:
> >:) COfFEe Ring. Hemoglobin, while it does have Fe, is far more complex
>
> Yes. Hemogoblin, however...
Ah, well, HemoGOBlin would look like this, of course :)
_..-'( )"-.._
./'. "||\\. (\_/) .//||' .'\.
./'.|'.'||||\\|.. )o o( ..|//||||"."|."\.
./'..|'.|| |||||\<<< "" < "" >>>/||||| ||."|."\.
./'.||'.|||| ||||||||||||. .|||||||||||| ||||."||."\.
/'|||'.|||||| ||||||||||||{ Fe }|||||||||||| ||||||."|||"\
".|||".||||||| ||||||||||||{ }|||||||||||| |||||||.'|||.'
".||| ||||||||| |/" ''\||'' ""||/'' '\| ||||||||| |||.'
|/' \./' "\./ \!|\ /|!/ \./" "\./ "\|
V V V }' "\ /" "{ V V V
" " " V " " "
e.
------------------------------
Date: Thu, 23 Sep 1999 13:17:39 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: applications of perl ??
Message-Id: <TLpG3.5015$QJ.342276@typ11.nn.bcandid.com>
In article <37E9FFDD.BD0EAA98@mailcity.com>,
S Vishwanath <vishx@mailcity.com> wrote:
>can some body help me by elaborating the exact nature of use of perl
>(especially in vlsi design) .
What?
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Wed Sep 22 1999
47 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: 23 Sep 1999 08:22:10 -0600
From: hudson@swcp.com (Tramm Hudson)
Subject: Re: applications of perl ??
Message-Id: <7sdd2i$leu@llama.swcp.com>
Keywords: troll troll troll
S Vishwanath <vishx@mailcity.com> wrote:
> can some body help me by elaborating the exact nature of use of perl
Good question -- does Perl have a Buddha nature? Be careful;
by answering that question you lose your own Buddha nature.
Perhaps a koan is in order:
One day Wall and Stallman were in the lab writing code
when Richard asked Larry if Perl had Buddha-nature.
Larry replied "MU".
Or one of these two (but not both!):
Stallman asked Wall: "What is Perl?"
Wall replied: "The mind is Perl."
Stallman asked Wall: "What is Perl?"
Wall replied: "The mind is not Perl."
Can we know which of these is the true koan and has Buddha-nature?
Tramm
--
o hudson@swcp.com tbhudso@cs.sandia.gov O___|
/|\ http://www.swcp.com/~hudson/ H 505.323.38.81 /\ \_
<< KC5RNF @ N5YYF.NM.AMPR.ORG W 505.284.24.32 \ \/\_\
0 U \_ |
------------------------------
Date: Thu, 23 Sep 1999 13:02:37 GMT
From: Jodok Sutterluety <jodok@my-deja.com>
Subject: Re: Automating Secure Copy using Perl
Message-Id: <7sd8d5$3ef$1@nnrp1.deja.com>
In article <7r37cr$ie5$1@nnrp1.deja.com>,
floodrk@my-deja.com wrote:
hi,
i am playing around on a similar problem (copying files over the
internet within a secure tunnel), too
what i do: i use uucp in a ssh tunnel!
works great, transfer fails -> when the connections will be established
again, it continues where it stopped!
jodok
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Thu, 23 Sep 1999 13:17:12 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: beauty of a Y2K bug
Message-Id: <sLpG3.5011$QJ.341767@typ11.nn.bcandid.com>
In article <m1btatx0cp.fsf@halfdome.holdit.com>,
Randal L. Schwartz <merlyn@stonehenge.com> wrote:
>I know, it [19$year]'s not Perl's fault. Blame it on the web. :)
Y'know, if we'd defined localtime() and gmtime() differently, to return
the *actual year* instead of (year - 1900), way back when, all the C
programmers would have been confused when their dates came out as 3889
and 3890 (or, God forbid, 191989 and 191990). But they would have
fixed it immediately, and now none of their code would have this
particular Y2K bug.
I think this interface is error-prone (i.e. people who don't read the
documentation end up writing Y2K bugs and don't know it.). I think
non-error-prone interfaces can make a great deal of difference in the
bug level of a language.
I mean, yeah, if you have a hundred-foot-high catwalk without any
handrails, you can walk across it every day for years without falling
off, if you're careful. Anyone who falls off probably could have
avoided falling, had they been more careful. But that doesn't mean
you're not responsible for putting up handrails.
C has a lot of missing handrails.
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Wed Sep 22 1999
47 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Thu, 23 Sep 1999 09:43:39 -0400
From: "WyneGum" <keithcp@hotmail.com>
Subject: Comparing lines in two files using arrays.
Message-Id: <7sdajj$3n3$1@bmerhc5e.ca.nortel.com>
Could anyone tell me the best way to compare one line from one file with
every line from another file, (each line in each file consists of only one
word).
Would it be best to use nested while loops and read the data in from two
arrays, or a foreach inside of a while loop.
Or, am I trying the hard way and there is a much easier way?
Thanks in advance.
------------------------------
Date: Thu, 23 Sep 1999 11:02:30 -0400
From: "WyneGum" <keithcp@hotmail.com>
Subject: Re: Comparing lines in two files using arrays.
Message-Id: <7sdf7d$6vq$1@bmerhc5e.ca.nortel.com>
The code for this is below.
Can you tell me why it doesn't work, ie. no match comes cack even though I
know that there are matches in the two files:
#!/usr/bin/perl -w
open (FILE1,"/path_to_file1");
open (FILE2, "/path_to_file2");
@file2= <FILE2>;
while (<FILE1>) {
$line_file1 = $_;
chomp;
grep(/$line_file1/, @file2);
}
Thanks in advance.
WyneGum wrote in message <7sdajj$3n3$1@bmerhc5e.ca.nortel.com>...
>Could anyone tell me the best way to compare one line from one file with
>every line from another file, (each line in each file consists of only one
>word).
>Would it be best to use nested while loops and read the data in from two
>arrays, or a foreach inside of a while loop.
>Or, am I trying the hard way and there is a much easier way?
>Thanks in advance.
>
>
------------------------------
Date: Thu, 23 Sep 1999 13:09:09 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Example commandline programs in perl
Message-Id: <VDpG3.4944$QJ.340980@typ11.nn.bcandid.com>
In article <7sd6mb$252$1@nnrp1.deja.com>, <tad3@my-deja.com> wrote:
> I'm a system admin with a little perl under my belt. I'm looking for
>commandline programs examples, book recommendations, etc., to replace
>sed/grep/awk/shell stuff. I know perl is extremely efficient and in the
>right hands can be used to do what the other stuff can do.
There are s2p and a2p scripts in the Perl distribution that will
convert sed and awk scripts to Perl. grep pattern file1 file2 file3 is
essentially perl -ne 'print if /pattern/' file1 file2 file3.
In Kernighan and Pike's latest, they benchmarked different languages
doing some tasks. In some cases, they found awk was faster than Perl;
in other cases, Perl was faster than awk. This surprised me.
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Wed Sep 22 1999
47 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: 23 Sep 1999 14:12:31 GMT
From: lt lindley <ltl@rgsun5.viasystems.com>
Subject: Re: Grouping in REs, no doc found
Message-Id: <7sdcgf$2m4$1@rguxd.viasystems.com>
Alex Rhomberg <rhomberg@ife.ee.ethz.ch> wrote:
:>I tried the following code:
:>$_ = "49f8325";
:>my @x = m/^((\d)+)/;
:>expecting @x to become (49, 4, 9). Well it became (49,9). To get this,
:>I'd rather have written /(\d*(\d))/.
But that just puts the last digit in $2 and all the digits in $1
:>While this is ok, I did not find anything about it in qw/perlre perlvar
:>perlop perlfaq6/. Actually there is almost nothing about grouping in
:>there.
Not true.
:>I didn't find the info that nested groups map to $<digit> in the order
:>that parentheses open.
perlre says
Subpatterns are numbered based on the left to right order of their
opening parenthesis.
-and-
... Within the pattern, \10, \11, etc. refer back to substrings if
there have been at least that many left parentheses...
and there are probably others, but I stopped looking.
:>I didn't find info about what happens when a group is followed by a
:>quantifier *?+{}
That is silly. There is a huge amount of info about this subject in
perlre. You just haven't read it carefully enough.
:>The following questions came up:
:>- Is there some information about this?
:>- If there isn't, what can I do to update one of the manpages mentioned
:>above?
perlre and perlop are very large complex documents, but they cover a
very large complex subject. If you can write them more clearly, then
go for it. But I think it is going to be a while before you are up
to the task.
:>- What can I do to get the desired result? (Meaning every \d as an
:>element in @x)
Assuming your English requirement statement is complete:
my @x = /(\d)/g;
Or if you know the string consists entirely of digits, just split
it on the magic null string (perldoc -f split)
--
// Lee.Lindley /// Programmer shortage? What programmer shortage?
// @bigfoot.com /// Only *cheap* programmers are in short supply.
//////////////////// 50 cent beers are in short supply too.
------------------------------
Date: Thu, 23 Sep 1999 14:24:40 +0100
From: Csaba Raduly <csaba.raduly@sophos.com>
Subject: How can I "undo" a require ?
Message-Id: <37EA2A18.9CC3277E@sophos.com>
Hi, I'm kinda new to perl, but I learn as I go.
I've written a perl script to parse the log files from three different
programs (two of them are identical except for being compiled for
32 and 16 :-( bits ).
We have a number of test files, each with a test virus that must be
detected. After a test run, the programs produce logs like these
16bit testprog 32bit testprog "real thing"
testcase1.log testcase1.lo2 testcase1.low
testcase2.log testcase2.lo2 testcase2.low
...
For each test case there's an automatically generated file with
the expected results:
=========testcase1.exp=======
%expected = {
'file1.doc', 'virus1',
'file2.doc', 'virus2',
# etc...
}
=======testcase1.exp end=====
And here are excerpts from the parser; it accepts a log file name.
Trouble started when I made it wildcard-savvy.
while( ($_ = shift, $_) ){
(my $n, my $e) = /(.*)\.(.*)/;
my $expfile = $n . ".exp";
die "Nothing to compare with !" unless -f $expfile;
# THERE!
require $expfile;
open FILE, $_;
while(<FILE>){
if( s/.*Virus \'([^']*)\' found in (.*)/$1/ ){
$base = $2;
$virus = $_;
if( $expected{$base} eq $virus ){
print "OK\n";
}else{
print "\x07...LUFT !!...\n"
}
}
} # wend(<FILE>)
close FILE;
undef %expected; # get a fresh start
}
This doesn't work when I start it with
analyse testcase1.lo?
because testcase1.exp isn't require'd again and for the
second and subsequent files the %expected hash remains
undefined.
I came up with the idea of
undef %expected unless defined $INC{$expfile}
to be placed before the "require" ( THERE! ) instead of the end.
This is fine for
analyse testcase1.lo?
but it doesn't work for a commandline like
analyse test1.log test2.log test1.lo2
Any idea to completely undo the effect of the require ?
TIA
Csaba
--
-----BEGIN GEEK CODE BLOCK-----
Version 3.1
GCS/MU d- s:- a30 C++$ UL+ P+>+++ L++ E- W+ N++ o? K? w++>$ O++$ M-
V- PS PE Y PGP- t+ 5 X++ R* tv++ b++ DI+++ D++ G- e+++ h-- r-- !y+
-----END GEEK CODE BLOCK-----
Csaba Raduly, Software Developer (OS/2), Sophos Anti-Virus
mailto:csaba.raduly@sophos.com http://www.sophos.com/
US Support +1 888 SOPHOS 9 UK Support +44 1235 559933
Life is complex, with real and imaginary parts.
------------------------------
Date: Thu, 23 Sep 1999 12:54:09 GMT
From: tfischer@deakin.edu.au (Thomas Fischer)
Subject: Re: How can I "undo" a require ?
Message-Id: <37ea22c5.28634474@news.deakin.edu.au>
found it on my own :-~
lc(foo)
Tom
------------------------------
Date: Thu, 23 Sep 1999 14:17:05 GMT
From: Kevin Colquitt <synced@austin.rr.com>
Subject: Re: My glob failed
Message-Id: <Pine.LNX.4.10.9909230926550.29183-100000@kalimoth.death.org>
I got it working with:
foreach $ii (@results[$i]) {
($dir, $userid, $groupid, $pid, $computer, $ipaddress, $day,
$month, $date, $hour, $year) = split ' ', $ii;
}
I'm a happy camper now :)
Kevin
On Thu, 23 Sep 1999, Kevin Colquitt wrote:
:Martien,
:
:Your code doesn't work. you run this and tell me what you get.
:
: #! /usr/bin/perl
: @results = q(export csmkdc webdev 13716 302-44446 (135.147.1.148) Tue Sep 21 18:52:34 1999);
:
: ($dir, $userid, $groupid, $pid, $computer, $ipaddress, $day, $month, $date, $hour, $year) = split ' ', $results[6];
:
: print "$dir, $userid, $groupid, $pid, $computer, $ipaddress, $day, $month, $date, $hour, $year \n";
:
:Gives me the following:
:[synced@kalimoth perlland]$ perl test.pl
:, , , , , , , , , ,
:[synced@kalimoth perlland]$
:
:
:besides, I've used a similar technique to get to values to commands like
:"date" for example:
:@date = `/bin/date`;
:($day, $month, $date, $hour, $locale, $year) = <@date>;
:print " $day, $month, $date, $hour, $locale, $year \n"
:
:works the way I know it should with the output being:
:[synced@kalimoth perlland]$ perl new.pl
: Wed, Sep, 22, 22:45:54, CDT, 1999
:
:Kevin
:
:On Thu, 23 Sep 1999, Martien Verbruggen wrote:
:
::In article <Pine.LNX.4.10.9909221740270.28639-100000@kalimoth.death.org>,
:: Kevin Colquitt <synced@austin.rr.com> writes:
::
::> The value for @results[6] should be something like:
::>
::>> export csmkdc webdev 13716 302-44446 (135.147.1.148) \
:: Tue Sep 21 18:52:34 1999
::>
::> and I'm trying to parse out the fields with the following:
::>
::>> ($dir, $userid, $groupid, $pid, $computer, $ipaddress, $day,
::> $month, $date, $hour, $year) = <@results[6]>;
::>
::> Which gives me the error "glob failed (child exited with status 1)
::> at test.pl line "
::
::And it would. <@results[6]> is a glob. (perldoc perlop, and perldoc -f
::glob). What did you think it was?
::
::I think what you want is split, with a pettern of space:
::
::($dir, $userid, $groupid, $pid, $computer, $ipaddress, $day,
:: $month, $date, $hour, $year) =
:: split ' ', @results[6];
::
::# perldoc -f split
::
::And please, _do_ read the split manual entry, even though you have the
::answer already.
::
::Martien
::--
::Martien Verbruggen |
::Interactive Media Division | Hi, Dave here, what's the root
::Commercial Dynamics Pty. Ltd. | password?
::NSW, Australia |
::
::
:
:
:
------------------------------
Date: 23 Sep 1999 14:55:21 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: My glob failed
Message-Id: <7sdf0p$vo7$1@lublin.zrz.tu-berlin.de>
Kevin Colquitt <synced@austin.rr.com> wrote in comp.lang.perl.misc:
>I got it working with:
>
>foreach $ii (@results[$i]) {
> ($dir, $userid, $groupid, $pid, $computer, $ipaddress, $day,
> $month, $date, $hour, $year) = split ' ', $ii;
> }
>I'm a happy camper now :)
Oh dear, what a mess.
$i never is never set, right? -w would have told you so, but you're not
using that, it seems. So, in numeric context it becomes a 0, which you
feed as the (only) index into an array slice, giving you a one-element
list you loop over with foreach. Splitting that does the right thing
for you, but only because the loop isn't really a loop but is executed
only once. The number of coincidences that make your code *seem* to
work is remarkable.
You may be a happy camper, but first of all you're one lucky camper.
And don't post jeopardy style, put your reply where it belongs.
Anno
------------------------------
Date: Thu, 23 Sep 1999 13:22:30 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: PERL ERROR- How to setup in the NT Regedit & Win32::ODBC
Message-Id: <qQpG3.5042$QJ.342841@typ11.nn.bcandid.com>
In article <37EA8B09.72280319@cybermart.com.sg>,
CyberMart <cmmktg@cybermart.com.sg> wrote:
>I encountered an error when submitting the form.
What form?
>The error is 405 MIME setting problem.
>Can anyone show me how to add in the registry.
What?
>I encountered ODBC error and it say cannot load Dyloader.pm in @INC
>odbc.pm
No it didn't, unless you edited out the 'na' from Dynaloader yourself.
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Wed Sep 22 1999
47 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Thu, 23 Sep 1999 09:56:56 -0400
From: "Chaos" <russkatz@erols.com>
Subject: Perl Script Within VB for Web Pages
Message-Id: <7sdbia$o1c$1@winter.news.rcn.net>
I have an ASP web page that is mostly all Visual Basic. I want to insert a
perl script though. I also need to pass a VB variable into the Perl script.
Does anyone know how to do this?
------------------------------
Date: Thu, 23 Sep 1999 13:23:06 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: PROBLEM with PERL script in NT platform
Message-Id: <_QpG3.5047$QJ.341572@typ11.nn.bcandid.com>
In article <37EA8C0D.342B6403@cybermart.com.sg>,
CyberMart <cmmktg@cybermart.com.sg> wrote:
>Can anyone tell me how to solve the below problem.
>I getting an error message Http 403 Forbidden - Execute script error.
>It say- the CGI has no permission for access right.
Configure your server to make CGI work.
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Wed Sep 22 1999
47 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Thu, 23 Sep 1999 10:49:23 -0400
From: Marty Landman <marty@catnmoose.com>
Subject: proper 'my' usage
Message-Id: <37EA3DF3.49BC937B@catnmoose.com>
I'd like advice on the best way to use my variables. I'm leaning
towards having all my 'my' vbles as the first line in every routine
like:
sub foo {
my ($yours, $mine, $ours);
($yours,$mine,$ours) = ($a_global,$b_global,$c_global);
....
}
but in the above example this seems repetitive if not silly.
OTOH if I use the 'my' when the vble is first actually used I'm
concerned because of something I thought I'd read in the Camel book,
i.e. that Perl shouldn't be relied upon to optimize repetitive tasks
that occur within loops. Can't remember where in the book I read
this...
I'm concerned specifically about producing an inefficiency when coding
something like this:
sub bar {
my @me = @global_you;
my $she = $global_factor;
for(@me) {
my $he = $_/$she;
....
}
}
Is there a penalty to be paid by saying 'my $he' within the for loop in
bar? Or is this a reasonable way of doing my declarations?
Marty
--
Cat 'n Moose Web Programming & Design http://www.catnmoose.com/
Perl - CGI Tutorials & Sample Pgms http://www.catnmoose.com/thecgibin/
------------------------------
Date: 23 Sep 1999 13:10:38 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: range of array indexes
Message-Id: <7sd8se$6lj$1@pegasus.csx.cam.ac.uk>
Ala Qumsieh <aqumsieh@matrox.com> wrote:
>
>Because he doesn't want to join ALL of the array. He also wants to
>separate the array elements with spaces. What Peter really needs is
>slightly different:
>
> $str = join ' ' => @array[$x..$#array];
Or perhaps more elegantly as
$str = "@{array[$x..$#array]}";
Mike Guy
------------------------------
Date: Thu, 23 Sep 1999 09:30:54 -0400
From: Earl Westerlund <earlw@kodak.com>
To: Cameron Dorey <camerond@mail.uca.edu>
Subject: Re: REQ: tell-a-friend script
Message-Id: <37EA2B8E.6B1@kodak.com>
Cameron Dorey wrote:
[snip]
> They may have been in violation of some copyright law, however. Isn't a
> gargleblaster something from "The Hitchhiker's Guide to the Galaxy"
> series, maybe one of Zaphod's special drinks? (Don't have my copy here
> at work)
Only the pan-galactic gargleblaster. I believe the others are public
domain.
--
+-----------------+----------------------------------------+
| Earl Westerlund | Kodak's Homepage: http://www.kodak.com |
+-----------------+----------------------------------------+
| The opinions expressed herein are mine and mine alone |
| (most people don't seem to want them anyway) |
+----------------------------------------------------------+
------------------------------
Date: Thu, 23 Sep 1999 07:08:35 -0700
From: moseley@best.com (Bill Moseley)
Subject: Re: Setting process name
Message-Id: <MPG.1253d441fbae2f70989772@nntp1.ba.best.com>
Joe Kline (jkline@one.net) seems to say...
> [posted and mailed]
>
> Bill Moseley wrote:
> I've see ;) and :'( and >:o but what does $0 say? My brain is
> scrambled?
> > > $0
> ^^from perlvar as in 'perldoc perlvar' we find:
I guess it was late. I was joking!
--
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.
------------------------------
Date: Thu, 23 Sep 1999 07:29:41 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: sorting like numbers an array of strings
Message-Id: <MPG.1253d934b93132f1989fc3@nntp.hpl.hp.com>
In article <H%dG3.4085$QJ.252254@typ11.nn.bcandid.com> on Wed, 22 Sep
1999 23:55:19 GMT, Kragen Sitaker <kragen@dnaco.net> says...
> In article <7sbojt$nuf$0@198.102.102.248>,
> pjd <duraipPLEEASE__REMOVE_THIIS@extendsys.com> wrote:
> >The following seemed to do what Miguel wanted.
>
> It looks to me like it will, too.
>
> >Looks easier too.
>
> It is easier. The article to which you were replying used something
> called the Schwartzian Transform, which is harder to read, but usually
> faster.
>
> Uri and Larry Rosler have an even faster method.
Indeed we do. It is faster in this case too, of course.
> It probably won't make any difference for sorting less than 100 or so items.
Nothing makes much of a difference for very small data sets.
> Somebody really should code this particular example up into a benchmark.
Yes, somebody really should. It starts out this way:
#!/usr/bin/perl -w
use strict;
use Benchmark;
Then it goes on from there...
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 23 Sep 1999 12:47:43 GMT
From: tfischer@deakin.edu.au (Thomas Fischer)
Subject: toLowercase??
Message-Id: <37ea2133.28232656@news.deakin.edu.au>
How can I convert a mixedcase string to 100% lowercase with perl?
Thx,
Tom
------------------------------
Date: Thu, 23 Sep 1999 10:11:51 -0400
From: Elaine -HFB- Ashton <elaine@chaos.wustl.edu>
Subject: Re: toLowercase??
Message-Id: <37EA3454.1DBD8A0@chaos.wustl.edu>
Thomas Fischer wrote:
>
> How can I convert a mixedcase string to 100% lowercase with perl?
perldoc perlre should contain the information you are looking for.
Also, you might read the FAQ.
http://www.perl.com/pub/doc/manual/html/pod/perlfaq4.html#How_do_I_capitalize_all_the_word
e.
------------------------------
Date: Thu, 23 Sep 1999 14:26:11 GMT
From: Codex <codex@bearclaw.bogus.net>
Subject: Re: toLowercase??
Message-Id: <7MqG3.831$OH6.12941@news1.online.no>
Thomas Fischer <tfischer@deakin.edu.au> wrote:
> How can I convert a mixedcase string to 100% lowercase with perl?
tr/[A-Z]/[a-z]/;
.cdx
------------------------------
Date: Thu, 23 Sep 1999 07:50:16 -0700
From: Chris Koharik <koharik@primenet.com>
Subject: Re: toLowercase??
Message-Id: <Pine.BSI.3.96.990923074929.21095A-100000@usr07.primenet.com>
> Date: Thu, 23 Sep 1999 12:47:43 GMT
> From: Thomas Fischer <tfischer@deakin.edu.au>
>
> How can I convert a mixedcase string to 100% lowercase with perl?
There are several ways. Regex, tr, and lc() come to mind.
-Chris
------------------------------
Date: Thu, 23 Sep 1999 13:20:24 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Unix password parser
Message-Id: <sOpG3.5031$QJ.342573@typ11.nn.bcandid.com>
In article <37ea0176.762034741@news.dl.ac.uk>, <pkey@sghms.ac.uk> wrote:
>has anyone got any pointers to perl code that can verify a unix
>password for a user before it is entered into the passwd file?
>
>i am writing a password changer in perl and am looking for a perl
>routine to parse a user entered password for validity to save the
>passwd routine from barfing.
How do you define 'validity'? You can use any string as a Unix
password, but some versions of 'passwd' reject bad choices of
password. If that's what you're talking about, you need to find out
what your particular passwd command deems "bad".
BTW, how are you going to pass the password to passwd? Pipes won't
pass this test. Without Expect.pm, it is passing difficult.
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Wed Sep 22 1999
47 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: 23 Sep 1999 09:06:04 -0500
From: Kent Perrier <kperrier@blkbox.com>
Subject: Re: You should be admired
Message-Id: <92F54A7C4D18B0C2.D2E4A537047335C9.856287C51142934E@lp.airnews.net>
Joe Kline <jkline@one.net> writes:
>
> I always like to assess a situation before I act. I think it was about
> 3 months of lurking in c.l.p.m. before I posted a question. It gave me
> a feel for the regulars' expectations and "traditions". Of course, I'm
> the cautious type, most of the time...
>
This is what all new readers of ANY news group should do. Except that
the standard lurking time is two weeks, not three months.
Kent
--
Groovy! Smashing! Yay capitalism!
- Austin Powers, Man of Mystery
------------------------------
Date: 23 Sep 1999 09:08:14 -0500
From: Kent Perrier <kperrier@blkbox.com>
Subject: Re: You should be admired
Message-Id: <07D5F91C223384A9.F50F7DD1F6BE7C8E.62E89B43770FD0CD@lp.airnews.net>
spamfree@metropolis.net.au (Henry Penninkilampi) writes:
>
> Tell me, Abigail, how does a petulant child gain respect in life? I'm
> wondering if you know - you seem to be an authority on the subject.
>
Unfortunately, he/she/it will never see your reply as the *plonk*
indicates that she kill filed you.
Kent
--
When you think of Red Hat, think of Perrier (bottled water). Water is
essentially free, or at least very low cost to produce. Red Hat is
selling the name, and some service.
-- Ed Young
------------------------------
Date: Thu, 23 Sep 1999 14:11:19 GMT
From: *@dragons.duesouth.net (Matthew Bafford)
Subject: Re: You should be admired
Message-Id: <slrn7ukb4d.9v2.*@dragons.duesouth.net>
On Thu, 23 Sep 1999 12:55:07 GMT, kragen@dnaco.net (Kragen Sitaker)
enriched us with:
: In article <spamfree-2309991606340001@d6.metropolis.net.au>,
: Henry Penninkilampi <spamfree@metropolis.net.au> wrote:
: >Tell me, Abigail, how does a petulant child gain respect in life? I'm
: >wondering if you know - you seem to be an authority on the subject.
:
: Abigail won *my* respect by
: - posting lots of correct answers
: - posting frightening JAPHs
: - answering even stupid questions
: - standing up for what is right.
Besides, Abigail's fun.
: Kragen Sitaker
--Matthew
------------------------------
Date: Fri, 24 Sep 1999 00:30:26 +0930
From: spamfree@metropolis.net.au (Henry Penninkilampi)
Subject: Re: You should be admired
Message-Id: <spamfree-2409990030260001@d6.metropolis.net.au>
In article <LqpG3.4867$QJ.339219@typ11.nn.bcandid.com>, kragen@dnaco.net
(Kragen Sitaker) wrote:
> >Tell me, Abigail, how does a petulant child gain respect in life? I'm
> >wondering if you know - you seem to be an authority on the subject.
>
> Abigail won *my* respect by
> - posting lots of correct answers
> - posting frightening JAPHs
> - answering even stupid questions
> - standing up for what is right.
>
> You have done none of these.
Are you of the opinion that I, for some reason, need to earn *your*
respect? Do you think yourself *that* important? Hmmm... Amusing
notion. I'll let that one go, I think, too easy...
Seriously, Kragen, I actually value what *all* of you do. I appreciate
the time you take to do the things you mentioned above. I learn from what
you write, even though I'm rarely the one asking the question. Sometimes
you're even funny, and that's a bonus.
On this occasion, however, the *issue* had degraded to the point where
mature adults were merely slinging vicious insults at each other, so I
attempted to intervene and resolve the dispute in a neutral and diplomatic
manner. Abigail spat the dummy for some reason (maybe she was enjoying
the argument?) and tried to have a go at me instead. I responded by
isolating her behavioural problem and delivered it to her on the end of a
sharp tongue. That had the desired effect - it shut her up and put her
back in her place (for now).
I don't like having to do that, and I've *never* done it in this forum
before, but I thought enough damage was being done _to_the_group_ to
warrant an intervention - so I did.
And now *you're* trying to have a go at me for 'standing up for what is
right'???
Or would you rather we all sit back, and let apathy turn this forum into a
mud-wrestling pit?
I understand your desire to stand up in defence of Abigail - I really do.
Under different circumstance, I would probably do the same. But in this
case, she was acting like a petulant child, and needed to be treated like
one. She knows it. I know it. Everyone who has been following the
thread probably knows it. If you can't see it, it's because you don't
want to.
Your Honour has been served - you came to the defence of your friend. I
bear no grudge against you, Abigail, or anyone here. As far as I'm
concerned, this episode is over. Why don't we all just retire to our
respective quarters and spend our energies on something more productive?
Henry.
------------------------------
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 886
*************************************