[17779] in Perl-Users-Digest
Perl-Users Digest, Issue: 5199 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Dec 26 03:05:26 2000
Date: Tue, 26 Dec 2000 00:05:08 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <977817907-v9-i5199@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 26 Dec 2000 Volume: 9 Number: 5199
Today's topics:
Re: convert string to command? (Eric Bohlman)
Re: convert string to command? (Eric Bohlman)
Re: convert string to command? <leekembel@hotmail.com>
Re: convert string to command? <uri@sysarch.com>
Re: convert string to command? (Tad McClellan)
Re: convert string to command? <leekembel@hotmail.com>
Re: convert string to command? <sdfg@asd.g>
Re: convert string to command? <uri@sysarch.com>
Dispatch table <leekembel@hotmail.com>
Re: Dispatch table (Martien Verbruggen)
Error from MIME::Lite <harrisr@bignet.net>
Getting a file submitted with <input type=file> <usequity@mindspring.com>
Re: Help Bidirectional IPC with IPC::Open2 <usenet@hank.org>
Re: making unique list of words matching a pattern (Ben Okopnik)
Re: making unique list of words matching a pattern (Tad McClellan)
New posters to comp.lang.perl.misc <gbacon@cs.uah.edu>
perlcc <geoff@brainstorm.net.au>
Statistics for comp.lang.perl.misc <gbacon@cs.uah.edu>
Re: Syntax for "eq" and "||" (Tad McClellan)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 26 Dec 2000 05:07:12 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: convert string to command?
Message-Id: <929920$s7v$1@bob.news.rcn.net>
Tad McClellan <tadmc@metronet.com> wrote:
> <hot-button>
> Folks saying exactly the opposite of what they thought they said
> sets me to pointing out their inversion.
> "i.e. vs. e.g." is one of the two that launches me (the other
> is "irregardless vs. regardless").
My favorite is "interactive" as applied to Web sites; it usually means
that the site contains code to make the user's machine do things without
the user's intervention, i.e. without any interaction. I have to suspect
that whoever started using "interactive" in this ridiculous sense was the
kid who was heard exclaiming one day at recess: "EEEW! He kissed a
girl! That is so gay!"
The one that makes my blood boil, though, is the hotel or restaurant that
calls its customers "guests." The standard example of a social
monstrosity is presenting one's guests with a bill for their food and
lodging. "Customer" is not a dirty word. The hotel or restaurant is not
doing its customers a favor by accepting their money; rather it's the
customers who keep the establishments in business.
------------------------------
Date: 26 Dec 2000 05:12:12 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: convert string to command?
Message-Id: <9299bc$s7v$2@bob.news.rcn.net>
Studio 51 <leekembel@hotmail.com> wrote:
> "Tad McClellan" <tadmc@metronet.com> wrote in message
> news:slrn94elmv.98d.tadmc@magna.metronet.com...
>> Use strictures.
> I did, but it caused another problem I couldn't get around so I took them
> off. The following doesn't work under use strict:
> &{$field{'action'}};
> I have a name stored in $field{'action'}, and I want to run a subroutine
> with the same name. I have a LOT of possible values for for
> $field{'action'}, and the only way I could figure to handle this with use
> strict was a gigantic if..then..elsif mess that looks for every possible
> value of $field{'action'}. If there are better ways I'd love to hear them!
The reason that doesn't work under use strict is that it's a symbolic
reference of a particularly nasty type (it allows calling arbitrary
subroutines based on the content of untrusted data). What you want is a
hash of code references, commonly called a "dispatch table"; do a Deja or
similar search on this group for that phrase and you'll see some examples.
------------------------------
Date: Tue, 26 Dec 2000 05:44:48 GMT
From: "Studio 51" <leekembel@hotmail.com>
Subject: Re: convert string to command?
Message-Id: <kfW16.152998$_5.34173646@news4.rdc1.on.home.com>
"Uri Guttman" <uri@sysarch.com> wrote in message
news:x7puifbwpu.fsf@home.sysarch.com...
> so don't do that.
> use a dispatch table which is a hash with keys of your function names
> and values of references their associated subs. then you don't have
> dangerous symbolic refs.
Ok, thnx
> there are many docs in the perl man pages on refs. have you read them
> all?
Yes, although not in full, I'll go over them all again though...
> there are many ways of improving that. here is some rough and untested
> code:
I'll try that instead. I don't see how it solves my real problem though. I
WAS setting the correct values, just like your code will, the problem is
that the values aren't accessable outside the "for each" block.
LKembel
------------------------------
Date: Tue, 26 Dec 2000 05:56:14 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: convert string to command?
Message-Id: <x7lmt3bu9t.fsf@home.sysarch.com>
>>>>> "S5" == Studio 51 <leekembel@hotmail.com> writes:
S5> "Uri Guttman" <uri@sysarch.com> wrote in message
>> there are many ways of improving that. here is some rough and untested
>> code:
S5> I'll try that instead. I don't see how it solves my real problem
S5> though. I WAS setting the correct values, just like your code
S5> will, the problem is that the values aren't accessable outside the
S5> "for each" block.
it is BETTER code. that is why you should use it. your code was
unreadable, had major redundancies, was hard to modify or expand, etc.
and i don't understand the last statement about not being accessible. i
jumped into this thread since you needed to be steered away from symrefs
and towards dispatch tables.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: Mon, 25 Dec 2000 23:13:52 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: convert string to command?
Message-Id: <slrn94g6o0.b1h.tadmc@magna.metronet.com>
Studio 51 <leekembel@hotmail.com> wrote:
>"Tad McClellan" <tadmc@metronet.com> wrote in message
>news:slrn94elmv.98d.tadmc@magna.metronet.com...
>> Use strictures.
>
>I did, but it caused another problem I couldn't get around so I took them
>off. The following doesn't work under use strict:
>
>&{$field{'action'}};
>
>I have a name stored in $field{'action'},
Store a code ref instead of a name.
$field{'action'} = \&func_for_action;
>and I want to run a subroutine
>with the same name.
&{$field{'action'}};
or
$field{'action'}->();
>If there are better ways I'd love to hear them!
Use a hash as a dispatch table.
>> It helps us help you if we have code *that we can run* that illustrates
>> the problem that you are having.
>
>Unless you have access to an SQL database with similar structure you can't
>run my code.
Well yes, that was my point.
Replace the filled-by-SQL parts with explicitly filled parts
so that we can run it.
>> > eval ( "\$cat".$dirref."{'auctions'} = {"auctions" =>
>$auctions}" );
>> ^^^^^^^
>>
>> It looks to me like you have a variable part of the *name* of
>> the hash, implying that there is more than one such hash.
>
>It is a hash of hashes. i.e. a hash that contains other hashes, that contain
>other hashes...
Why is $dirref part of the name of a hash?
That is a symbolic reference.
>> Since everybody with a lick of sense always runs with strictures
>> turned on, you won't be allowed to even _aim_ the gun at your foot,
>> avoiding the potential for experiencing a painful figurative wound.
>
>I'd really like to use strictures, I want to do this right.
Good attitude :-)
>But I can't
>figure out the problem with my subroutine (above). I did turn strictures on
>and remove the bit it didn't like, and it ran ok.
You should never need to turn them off, but you can turn them
off temporarily (until you can get around to fixing it) for
only a small scope around where you are doing the Dangerous
Stuff (if strictures speak, then you are doing DS :-)
{ no strict;
# do Dangerous Stuff in Perl-Expert-Mode
}
# back to mere mortal status, strictures back in force
>> >Or are
>> >there better ways to read this category structure into memory?
>> This seems likely in the extreme...
>
>I was hoping for a hint as to what those ways might be, not just a
>confirmation of what I already knew.
I know that. I already said why I couldn't do that. I don't understand
your problem.
Since you glossed right over the symrefs in the hashes name above,
I _still_ don't know how to help you. Sorry.
>I'm sure you don't want to whole 400+ lines of code in my program, so below
>is the part that is the trouble. It prints out:
>
>Antiques: 0
>Fiction: 0
>Antiques:
>Fiction: 0
>
>In other words (i.e.) $cat{'Books'}{'Antiques'}{'auctions'} exists within
>the "for each" block, and not outside it. Also my data is structured in the
>SQL server like this:
>
>NAME | PATH | na | auctions
>
>Antiques | /Books | | 0
>Fiction | /Books | | 0
>
>
>
>
> &connect; #connects to MySQL
>
> $sql = "select * from categories order by name";
> $sth = $dbh->prepare($sql);
> $sth->execute() || die $sth->errstr;
> @arrayref = $sth->fetchall_arrayref;
Take that out, and replace it with something else that populates
@arrayref, so we can run your code:
---------------------------
#!/usr/bin/perl -w
use strict;
use Data::Dumper;
my @arrayref = (
[ qw# Antiques /Books 0 # ],
[ qw# Fiction /Books 0 # ],
);
foreach my $rowref (@arrayref) {
foreach my $row (@$rowref) {
my $name = @$row[0];
print "$row\n";
}
}
---------------------------
> foreach $rowref (@arrayref) {
> foreach $row (@$rowref) {
> $name = @$row[0];
What is the structure in @arrayref?
I obviously don't have it right yet.
>#This next part seems real messy, which is why I was using eval() before
> } elsif (@path == 3) {
> $cat{$path[0]}{$path[1]}{$path[2]}{$name} = {auctions => $auctions};
Ah hah! Now I understand what you're trying to do.
I might try to just use the paths as hash keys directly:
$cat{'Books/Antiques'} = {auctions => $auctions};
Here is code that _you_ can run :-)
Take it as an example of how you can factor-out the stuff that
is in your real program so that others can run your code.
I added a "Literature" level so that it would be deep enough to
see the "walking" was working:
-----------------------
#!/usr/bin/perl -w
use strict;
use Data::Dumper;
### show everybody your data structures, and their contents
my %cat = (
Literature => { Books => { Antiques => undef,
Fiction => undef
}
},
);
#print Dumper \%cat;
my $name = 'Antiques';
my $auctions = 'Auctions data';
### load up an example @path to use
my @path = qw/ Literature Books /;
my $href = $cat{shift @path}; # ref that "walks" down the hashes chain
while ( my $dir = shift @path ) {
print "moving down to '$dir'\n";
$href = $href->{$dir}; # move down another level
}
$href->{$name} = {auctions => $auctions}; # add stuff to the end of the chain
#print Dumper \%cat;
print "Antiques: $cat{Literature}{Books}{Antiques}{auctions}<BR>";
-----------------------
--
Tad McClellan SGML consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 26 Dec 2000 06:47:57 GMT
From: "Studio 51" <leekembel@hotmail.com>
Subject: Re: convert string to command?
Message-Id: <xaX16.153178$_5.34262873@news4.rdc1.on.home.com>
"Uri Guttman" <uri@sysarch.com> wrote in message
news:x7lmt3bu9t.fsf@home.sysarch.com...
> it is BETTER code. that is why you should use it. your code was
> unreadable, had major redundancies, was hard to modify or expand, etc.
I agree.
> and i don't understand the last statement about not being accessible. i
> jumped into this thread since you needed to be steered away from symrefs
> and towards dispatch tables.
Yes, thanks for jumping in, it was a great help. The "not accessable"
statement was my whole problem and the reason I started the thread, and it's
expained best in my post on 25/12/2000 8:23PM.
LKembel
------------------------------
Date: Tue, 26 Dec 2000 07:48:30 GMT
From: "S51" <sdfg@asd.g>
Subject: Re: convert string to command?
Message-Id: <i3Y16.153304$_5.34321651@news4.rdc1.on.home.com>
> I might try to just use the paths as hash keys directly:
> $cat{'Books/Antiques'} = {auctions => $auctions};
That would be harder to print out like so:
Books
- Fiction
- Nonfiction
Computers
- Hardware
- Storage
- Display
- Software
- Games
Sports
- Football
And harder to easily tell how many sub directories are in any given path.
> Take that out, and replace it with something else that populates
> @arrayref, so we can run your code:
Done, with the data dumper it was easy, I just dumped, cut, paste. Same
results as I was getting before. I called this through a web browser, so for
readability you may want to replace <BR> with \n.
#!/usr/bin/perl -w
print "content-type: text/html\n\n";
use strict;
use DBI;
my (%field,%cat,%actions,$dbh);
my @arrayref = [
[
'Antiques',
'/Books',
'no',
'0'
],
[
'Books',
'',
'no',
'0'
],
[
'Cards',
'/Collectables',
'yes',
'0'
],
[
'Collectables',
'',
'no',
'0'
],
[
'Computers',
'',
'no',
'0'
],
[
'Equipment',
'/Sports',
'yes',
'0'
],
[
'Fiction',
'/Books',
'no',
'0'
],
[
'Games',
'/Computers/Software',
'yes',
'0'
],
[
'Hardware',
'/Computers',
'no',
'0'
],
[
'Lego',
'/Toys',
'yes',
'0'
],
[
'Motherboards',
'/Computers/Hardware',
'yes',
'0'
],
[
'Nonfiction',
'/Books',
'no',
'0'
],
[
'Office',
'/Computers/Software',
'yes',
'0'
],
[
'Software',
'/Computers',
'no',
'0'
],
[
'Sports',
'',
'no',
'0'
],
[
'Storage',
'/Computers/Hardware',
'yes',
'0'
],
[
'Stuffed toys',
'/Toys',
'yes',
'0'
],
[
'Toys',
'',
'no',
'0'
]
];
foreach my $rowref (@arrayref) {
foreach my $row (@$rowref) {
my ($name,$path,$auctions);
$name = @$row[0];
$path = @$row[1];
$auctions = @$row[3];
if ($path eq "") {
$cat{$name} = {auctions => $auctions};
} else {
my @path = split ('/', $path);
shift @path;
if (@path == 1) {
$cat{$path[0]}{$name} = {auctions => $auctions};
} elsif (@path == 2) {
$cat{$path[0]}{$path[1]}{$name} = {auctions => $auctions};
} elsif (@path == 3) {
$cat{$path[0]}{$path[1]}{$path[2]}{$name} = {auctions => $auctions};
} elsif (@path == 4) {
$cat{$path[0]}{$path[1]}{$path[2]}{$path[3]}{$name} = {auctions =>
$auctions};
} elsif (@path == 5) {
$cat{$path[0]}{$path[1]}{$path[2]}{$path[3]}{$path[4]}{$name} =
{auctions => $auctions};
}
if ($name eq "Antiques") {
print "Antiques: ".$cat{'Books'}{'Antiques'}{'auctions'}."<BR>";
}
if ($name eq "Fiction") {
print "Fiction: ".$cat{'Books'}{'Fiction'}{'auctions'}."<BR>";
}
}
}
}
print "Antiques: ".$cat{'Books'}{'Antiques'}{'auctions'}."<BR>";
print "Fiction: ".$cat{'Books'}{'Fiction'}{'auctions'}."<BR><BR><BR>";
foreach my $category ( keys %cat ) {
print $category."($cat{$_}{'auctions'})<BR>";
foreach ( keys %{ $cat{$category} } ) {
if ($_ ne "auctions") {
print " - ".$_."($cat{$category}{$_}{'auctions'})<BR>";
}
}
}
The part it prints out that I'm most concerned with is:
Antiques: 0
Fiction: 0
Antiques:
Fiction: 0
Notice that the first time it prints "Antiques:" it gets the right value -
0. The second time it gets nothing because it doesn't exist. I'm clueless as
to why this data is accessable only within that one block, especially when
other data (Fiction) is accessable outside the block as well, and I can't
see how the 2 are different.
--
Lee Kembel
VP Design, Studio 51
http://www.studio51.ca
------------------------------
Date: Tue, 26 Dec 2000 08:01:40 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: convert string to command?
Message-Id: <x7hf3rbogr.fsf@home.sysarch.com>
>>>>> "TM" == Tad McClellan <tadmc@metronet.com> writes:
TM> You should never need to turn them off, but you can turn them
TM> off temporarily (until you can get around to fixing it) for
TM> only a small scope around where you are doing the Dangerous
TM> Stuff (if strictures speak, then you are doing DS :-)
TM> { no strict;
TM> # do Dangerous Stuff in Perl-Expert-Mode
TM> }
TM> # back to mere mortal status, strictures back in force
how dare you expose one of the dark secrets of the perl masters to a
mere mortal?
seriously, one should never need symbolic refs in basic code. they are
still needed for where you have to modify symbol table stuff as in
exporting symbols, creating closure methods on the fly in AUTOLOAD and
other special cases. they are NEVER needed in ordinary data crunching
and the like. my rule applies here, you should not be allowed to use
symbolic references unless you know when not to use them.
<of course tad, this is not aimed at you>
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: Tue, 26 Dec 2000 06:47:56 GMT
From: "Studio 51" <leekembel@hotmail.com>
Subject: Dispatch table
Message-Id: <waX16.153177$_5.34262816@news4.rdc1.on.home.com>
"Eric Bohlman" <ebohlman@omsdev.com> wrote in message
news:9299bc$s7v$2@bob.news.rcn.net...
> What you want is a
> hash of code references, commonly called a "dispatch table"; do a Deja or
> similar search on this group for that phrase and you'll see some examples.
>
Got it to work, but it gives a warning, and I can't figure out why. Heres
the code:
use strict;
my (%field,%cat,%actions,$dbh);
&header;
&authorize;
&read_input;
%actions = (
"alter_categories" => \&alter_categories,
"update_template" => \&update_template,
"submit_update_template" => \&submit_update_template,
);
if ( exists $actions{$field{'action'}} ) { #This line gives the
warning
my $rsub = $actions{$field{'action'}};
&$rsub();
} else {
&main_menu;
}
The warning is: Use of uninitialized value at
/usr/lib/cgi-bin/auction/admin.cgi line 146. From what I can see I declared
%actions, and %field, so where's the warning? Is it because $field{'action'}
is uninitialized? I'm trying to find out if it's initialized, can I not do
that without getting a warning?
LKembel
------------------------------
Date: Tue, 26 Dec 2000 18:17:45 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Dispatch table
Message-Id: <slrn94ghgp.8i7.mgjv@martien.heliotrope.home>
On Tue, 26 Dec 2000 06:47:56 GMT,
Studio 51 <leekembel@hotmail.com> wrote:
>
> Got it to work, but it gives a warning, and I can't figure out why. Heres
> the code:
> if ( exists $actions{$field{'action'}} ) { #This line gives the
> warning
> The warning is: Use of uninitialized value at
> /usr/lib/cgi-bin/auction/admin.cgi line 146. From what I can see I declared
> %actions, and %field, so where's the warning? Is it because $field{'action'}
> is uninitialized?
Yes, that is the problem.
> I'm trying to find out if it's initialized, can I not do
> that without getting a warning?
if ( exists $field{action} && exists $actions{$field{action}})
{
# code here
}
or, if $field{action} can exist, but with an undefined value:
if ( defined $field{action} && exists $actions{$field{action}})
{
# code here
}
Martien
--
Martien Verbruggen |
Interactive Media Division | life ain't fair, but the root
Commercial Dynamics Pty. Ltd. | password helps. -- BOFH
NSW, Australia |
------------------------------
Date: Tue, 26 Dec 2000 00:53:07 -0500
From: "Randy Harris" <harrisr@bignet.net>
Subject: Error from MIME::Lite
Message-Id: <t4gcgvl9orb148@corp.supernews.com>
The code and sub below are from MIME::Lite 2.104, file Lite.pm. When it
is run with the -w switch it generates the following warning:
Unrecognized escape \s passed through at (eval 2) line 11
Simply having "use MIME::Lite ;" in the program causes it to report the
warning. The warning is coming from this line:
my $SEP = "(?:^\\s*|\\s*,\\s*)"; ### before elems in a list
I was able to confirm that this was the line by putting a line above it,
which changed the reported warning line number, then a line after it,
which did not. Aside from the warnings, the module seems to work fine.
$SEP appears to be used only in this one sub.
perlop describes ?: as the ternary operator but doesn't clearly explain
what that line does.
How can I correct this, or, should I simply ignore the warnings?
#vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
sub extract_addrs {
return map { $_->format } Mail::Address->parse($_[0]);
}
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
}; ### q
}
else {
eval q{
#vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
my $ATOM = '[^ \000-\037()<>@,;:\134"\056\133\135]+';
my $QSTR = '".*?"';
my $WORD = '(?:' . $QSTR . '|' . $ATOM . ')';
my $DOMAIN = '(?:' . $ATOM . '(?:' . '\\.' . $ATOM . ')*' . ')';
my $LOCALPART = '(?:' . $WORD . '(?:' . '\\.' . $WORD . ')*' . ')';
my $ADDR = '(?:' . $LOCALPART . '@' . $DOMAIN . ')';
my $PHRASE = '(?:' . $WORD . ')+';
my $SEP = "(?:^\\s*|\\s*,\\s*)"; ### before elems in a list
sub extract_addrs {
my $str = shift;
my @addrs;
$str =~ s/\s/ /g; ### collapse whitespace
pos($str) = 0;
while ($str !~ m{\G\s*\Z}gco) {
### print STDERR "TACKLING: ".substr($str, pos($str))."\n";
if ($str =~ m{\G$SEP$PHRASE\s*<\s*($ADDR)\s*>}gco) {push @addrs,$1}
elsif ($str =~ m{\G$SEP($ADDR)}gco) {push @addrs,$1}
elsif ($str =~ m{\G$SEP($ATOM)}gco) {push @addrs,$1}
else
my $problem = substr($str, pos($str));
die "can't extract address at <$problem> in <$str>\n";
}
}
return @addrs;
}
------------------------------
Date: Tue, 26 Dec 2000 06:43:13 GMT
From: "Ronomics" <usequity@mindspring.com>
Subject: Getting a file submitted with <input type=file>
Message-Id: <56X16.75835$x6.35434127@news2.rdc2.tx.home.com>
I have a form that allows users to submit a file (with the input tag
type=file). How do I get, rename, and save the file to a directory?
TIA
Henry
------------------------------
Date: Mon, 25 Dec 2000 21:20:02 -0800
From: Bill Moseley <usenet@hank.org>
Subject: Re: Help Bidirectional IPC with IPC::Open2
Message-Id: <MPG.14b1ca5cef5ad1b398978e@news.newsguy.com>
On Mon, 25 Dec 2000 02:53:41 +0000 (UTC) David Efflandt
(efflandt@xnet.com) remarked...
> On Sun, 24 Dec 2000 07:38:21 -0800, Bill Moseley <usenet@hank.org> wrote:
> >If you test it on your machine do you only get one line returned and
> >then does can_read() never return true after that?
>
> Since I was not sure if your e-mail address is valid, I am posting what
> did work for me. Since my Open2 may be old, I used real filehandles:
Thanks David,
(yes, that's a valid email address)
I'm still curious why can_read() was never returning true after the
first call. I'm not clear on IO::Select, so I'm just guessing, but I
wonder if it was that Perl had already read everything from the pipe,
but I had only read the first line so can_read() was false, but there
was more to read from the line buffer. I'll try to look later in the
week when I have time. Just wondering, you know.
I was considering using can_read() to help when the Content-Length:
header doesn't match the real content length.
Perhaps it's easier to wrap read() in the client in an eval and set an
alarm.
All this is really just an exercise. I really need something a bit more
portable that would work on, say, Windows. Sockets are probably the way
to go, but it makes writing the servers less trivial. (The goal is to
find an easy way for someone that just knows a little perl can write one
of these "severs".)
It's also been suggested that I look at POE. That doesn't look simple
or easy upon first look, and I haven't had time to look at it much
either.
Thanks again for your help.
--
Bill Moseley
------------------------------
Date: 26 Dec 2000 06:40:21 GMT
From: fuzzybear@pocketmail.com (Ben Okopnik)
Subject: Re: making unique list of words matching a pattern
Message-Id: <slrn94gfhf.rok.fuzzybear@Odin.Thor>
The ancient archives of Mon, 25 Dec 2000 15:34:46 -0500 showed
Tad McClellan of comp.lang.perl.misc speaking thus:
>
>"Welcome to The Perl Golf Page":
>
> http://www.sysarch.com/perl/golf/
Ah. I thought it was a c.l.p.m. in-joke. Am *I* going to play golf against
the likes of you or Abigail? <Laugh> You _must_ be kidding. I'll happily
sit on the grass and watch you guys, though (while frantically trying to
study the swing, technique, etc. - just as I have been doing since finding
c.l.p.m.) Let me say, BTW, just how much I appreciate that you folks are
here and doing this; I've learned far more while lurking here than in all
the time up until now, even with a great big thick Perl book to help me.
My kudos and greatest respects to all of you.
[ Abigail's 437.2-yard hole-in-one ]
>>> perl -walne'map/\.cpp$/&&print,@F' file
>>
>Unraveling it is a truly great way of picking up some more Perl.
>(and even, some would say, some _bad_ Perl)
>
>Anything that helps you win is what you use. Sometimes you see
>more succinct ways of "saying something" in Perl. Sometimes
>the ways are just too darn succinct for easy maintenance in
>real programs.
>
>But we're not talking about real programs. We're playing golf.
>
>
> 1) figure out what all the switches do (perldoc perlrun)
<read, read, read> *Whoa.* Cool. Especially those "-a" and "-l" switches,
considering the goal here.
> 2) spaces (strokes) make you lose. Put them back in.
I don't think I understood that... if you're trying to reduce the number
of [key]strokes, why put them back in?
> map /\.cpp$/ && print, @F
>
> 3) hmmm. Must be using the "map EXPR,LIST" form (perldoc -f map),
> 'cause I don't see a BLOCK. Where is the EXPR part?
>
> map ( /\.cpp$/ && print), @F
I gather you're saying that the parens are implicit because of the '&&',
right?
> 4) note the "funny way to write" bit in perlfunc. rewrite it
> the "serious" way.
>
> 5) understand how the short-circuit behavior of the && operator
> is used as a flow control structure, and now how the program
> works is clear. (if not, go to step one, check the docs again.
> if you get to step #5 three times, post a question to clpmisc :-)
Whew. OK, if I didn't get too badly brain-burned here... what that says is
"if the element pulled out of @F by the autosplit function matches
'\.cpp$', then print it; if it doesn't, then print never gets invoked - go
on to the next element" - right?
Thanks again, Tad. I'd looked ("stared glassy-eyed" would be more precise)
at "map" before; now, I think I'm actually starting to 'get' it. <chuckle>
Even the name makes sense.
Ben Okopnik
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
"STOP! (blam! blam! blam!) Klingon Security! (blam! blam! blam!)
Halt or We'll Shoot!"
------------------------------
Date: Tue, 26 Dec 2000 00:13:24 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: making unique list of words matching a pattern
Message-Id: <slrn94ga7k.b6h.tadmc@magna.metronet.com>
Ben Okopnik <fuzzybear@pocketmail.com> wrote:
>The ancient archives of Mon, 25 Dec 2000 15:34:46 -0500 showed
>Tad McClellan of comp.lang.perl.misc speaking thus:
>>
>>"Welcome to The Perl Golf Page":
>>
>> http://www.sysarch.com/perl/golf/
>
>Ah. I thought it was a c.l.p.m. in-joke. Am *I* going to play golf against
>the likes of you
Whoa there. _I'm_ not a golfer (nor in a league with Abigail).
I'm more of the staid Software Engineer type Perl programmer.
It's usually the wizard/hacker type that plays Perl golf.
>or Abigail? <Laugh> You _must_ be kidding. I'll happily
>sit on the grass and watch you guys, though (while frantically trying to
>study the swing, technique, etc.
That is the extent of my involvement in Perl games (golf, JAPH, obfuscated).
>>But we're not talking about real programs. We're playing golf.
>> 2) spaces (strokes) make you lose. Put them back in.
>
>I don't think I understood that... if you're trying to reduce the number
>of [key]strokes, why put them back in?
Because what you and I are doing is trying to put the golf
code back into "normal code" so we can figure out what the
heck it does and how it does it :-)
>> 3) hmmm. Must be using the "map EXPR,LIST" form (perldoc -f map),
>> 'cause I don't see a BLOCK. Where is the EXPR part?
>>
>> map ( /\.cpp$/ && print), @F
>
>I gather you're saying that the parens are implicit because of the '&&',
>right?
Because of the _precedence_ of &&, yes.
>Whew. OK, if I didn't get too badly brain-burned here... what that says is
>"if the element pulled out of @F by the autosplit function matches
>'\.cpp$', then print it; if it doesn't, then print never gets invoked - go
>on to the next element" - right?
Right. My goal is to convert the one-liner to a full-up program.
I'll try it here, on the fly, UNTESTED:
----------------
use warnings; # -w
while (<>) { # -n
chomp; # -l
@F = split; # -a and split()'s double default
foreach (@F) { # map() is a foreach() in disguise
if ( /\.cpp$/ ) {
print "$_\n"; # -l again
}
}
}
----------------
>Thanks again, Tad. I'd looked ("stared glassy-eyed" would be more precise)
>at "map" before; now, I think I'm actually starting to 'get' it. <chuckle>
Use the Schwartzian Transform a few times if you want to make
map() your friend.
--
Tad McClellan SGML consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 26 Dec 2000 06:48:19 -0000
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: New posters to comp.lang.perl.misc
Message-Id: <t4gfpj6bca3d1e@corp.supernews.com>
Following is a summary of articles from new posters spanning a 8 day
period, beginning at 18 Dec 2000 06:47:02 GMT and ending at
26 Dec 2000 05:56:14 GMT.
Notes
=====
- A line in the body of a post is considered to be original if it
does *not* match the regular expression /^\s{0,3}(?:>|:|\S+>|\+\+)/.
- All text after the last cut line (/^-- $/) in the body is
considered to be the author's signature.
- The scanner prefers the Reply-To: header over the From: header
in determining the "real" email address and name.
- Original Content Rating (OCR) is the ratio of the original content
volume to the total body volume.
- Find the News-Scan distribution on the CPAN!
<URL:http://www.perl.com/CPAN/modules/by-module/News/>
- Please send all comments to Greg Bacon <gbacon@cs.uah.edu>.
- Copyright (c) 2000 Greg Bacon.
Verbatim copying and redistribution is permitted without royalty;
alteration is not permitted. Redistribution and/or use for any
commercial purpose is prohibited.
Totals
======
Posters: 143 (33.3% of all posters)
Articles: 254 (18.4% of all articles)
Volume generated: 457.3 kb (17.4% of total volume)
- headers: 205.4 kb (4,119 lines)
- bodies: 246.6 kb (8,683 lines)
- original: 161.6 kb (6,203 lines)
- signatures: 5.0 kb (126 lines)
Original Content Rating: 0.655
Averages
========
Posts per poster: 1.8
median: 1 post
mode: 1 post - 91 posters
s: 1.5 posts
Message size: 1843.5 bytes
- header: 827.9 bytes (16.2 lines)
- body: 994.2 bytes (34.2 lines)
- original: 651.4 bytes (24.4 lines)
- signature: 20.3 bytes (0.5 lines)
Top 10 Posters by Number of Posts
=================================
(kb) (kb) (kb) (kb)
Posts Volume ( hdr/ body/ orig) Address
----- -------------------------- -------
8 17.5 ( 7.5/ 9.9/ 7.9) "Studio 51" <leekembel@hotmail.com>
8 9.2 ( 6.3/ 2.8/ 2.0) "Sven Franke" <snefsite@hotmail.com>
7 12.8 ( 7.9/ 4.9/ 3.5) "Karol Nowakowski" <karol@imm.org.pl>
5 7.9 ( 4.4/ 3.5/ 1.5) Jerome Abela <Jerome.Abela@free.fr>
5 11.8 ( 4.7/ 5.9/ 3.9) Ilmari Karonen <usenet11314@itz.pp.sci.fi>
5 12.1 ( 4.8/ 7.3/ 1.2) "Brooklyn Linux Solutions CEO" <ruben@www2.mrbrklyn.com>
5 8.3 ( 4.2/ 4.1/ 2.7) John Nagle <nagle@animats.com>
5 5.5 ( 3.4/ 2.1/ 1.2) Karl.Mikasa@usa.xerox.com
4 8.2 ( 3.4/ 3.9/ 2.2) Ilmari Karonen <usenet11311@itz.pp.sci.fi>
4 6.4 ( 3.7/ 2.6/ 1.9) "Pat J. Magnan" <pat@sluggo.org>
These posters accounted for 4.1% of all articles.
Top 10 Posters by Volume
========================
(kb) (kb) (kb) (kb)
Volume ( hdr/ body/ orig) Posts Address
-------------------------- ----- -------
32.8 ( 1.7/ 31.1/ 13.7) 2 "angel" <angel@reflex-point.com>
17.6 ( 2.8/ 14.8/ 12.4) 2 "David Simmons" <pulsar@qks.com>
17.5 ( 7.5/ 9.9/ 7.9) 8 "Studio 51" <leekembel@hotmail.com>
12.8 ( 7.9/ 4.9/ 3.5) 7 "Karol Nowakowski" <karol@imm.org.pl>
12.1 ( 4.8/ 7.3/ 1.2) 5 "Brooklyn Linux Solutions CEO" <ruben@www2.mrbrklyn.com>
11.8 ( 4.7/ 5.9/ 3.9) 5 Ilmari Karonen <usenet11314@itz.pp.sci.fi>
9.2 ( 6.3/ 2.8/ 2.0) 8 "Sven Franke" <snefsite@hotmail.com>
8.9 ( 4.8/ 4.1/ 2.6) 4 Jason Trenouth <jason@harlequin.com>
8.8 ( 3.8/ 5.0/ 4.1) 4 "Robert Basil" <robert@no-spam.basil.com>
8.4 ( 3.8/ 4.4/ 2.6) 4 chr1st1an <cyner.mail@sweden.com>
These posters accounted for 5.3% of the total volume.
Top 10 Posters by OCR (minimum of three posts)
==============================================
(kb) (kb)
OCR orig / body Posts Address
----- -------------- ----- -------
1.000 ( 1.1 / 1.1) 3 Vivekvr <vivekvr@aol.com>
0.823 ( 4.1 / 5.0) 4 "Robert Basil" <robert@no-spam.basil.com>
0.799 ( 7.9 / 9.9) 8 "Studio 51" <leekembel@hotmail.com>
0.786 ( 0.8 / 1.0) 3 "Vitaly Tkachenko" <virtualvat@yahoo.com>
0.780 ( 2.8 / 3.6) 4 timallen449@my-deja.com
0.736 ( 1.1 / 1.5) 4 stong123@my-deja.com
0.720 ( 1.5 / 2.1) 4 "Some_Indiana_Guy" <!spammed@aye.net!>
0.718 ( 1.9 / 2.6) 4 "Pat J. Magnan" <pat@sluggo.org>
0.716 ( 2.0 / 2.8) 8 "Sven Franke" <snefsite@hotmail.com>
0.713 ( 3.5 / 4.9) 7 "Karol Nowakowski" <karol@imm.org.pl>
Bottom 10 Posters by OCR (minimum of three posts)
=================================================
(kb) (kb)
OCR orig / body Posts Address
----- -------------- ----- -------
0.643 ( 2.6 / 4.1) 4 Jason Trenouth <jason@harlequin.com>
0.601 ( 1.8 / 2.9) 4 Ilmari Karonen <usenet11316@itz.pp.sci.fi>
0.598 ( 2.6 / 4.4) 4 chr1st1an <cyner.mail@sweden.com>
0.567 ( 1.2 / 2.1) 5 Karl.Mikasa@usa.xerox.com
0.552 ( 2.2 / 3.9) 4 Ilmari Karonen <usenet11311@itz.pp.sci.fi>
0.466 ( 2.2 / 4.8) 3 news <loy_x@yahoo.com>
0.448 ( 1.3 / 3.0) 4 "Brad Bollenbach" <bbollenbach@homenospam.com>
0.419 ( 1.5 / 3.5) 5 Jerome Abela <Jerome.Abela@free.fr>
0.409 ( 1.8 / 4.3) 4 cwrites <bconnats@bellsouth.net>
0.171 ( 1.2 / 7.3) 5 "Brooklyn Linux Solutions CEO" <ruben@www2.mrbrklyn.com>
24 posters (16%) had at least three posts.
Top 10 Targets for Crossposts
=============================
Articles Newsgroup
-------- ---------
32 comp.lang.perl
27 comp.lang.java.machine
27 comp.lang.java.softwaretools
25 comp.lang.java.tech
22 comp.lang.perl.modules
14 comp.lang.awk
14 alt.perl
10 alt.lang.awk
4 comp.lang.perl.tk
4 comp.infosystems.www.authoring.html
Top 10 Crossposters
===================
Articles Address
-------- -------
14 Jason Trenouth <jason@harlequin.com>
12 "David Simmons" <pulsar@qks.com>
4 Just Me <just_me@nospam.com>
4 "Stuart D. Gathman" <stuart@bmsi.com>
4 "Karol Nowakowski" <karol@imm.org.pl>
4 Ulrich Hofstoetter <ulrich.hofstoetter@visualanalysis.com>
4 Hakan Stenholm <etxhste@etxb.ericsson.se>
3 "Nikos Laoutaris" <laoutaris@di.uoa.gr>
2 "Sprint" <pyuson@yahoo.com>
1 Santa <Santa@clause.sql>
------------------------------
Date: Tue, 26 Dec 2000 06:11:33 GMT
From: Geoff Toogood <geoff@brainstorm.net.au>
Subject: perlcc
Message-Id: <B66E7545.11C8%geoff@brainstorm.net.au>
I have been playing around with the front end to the Perl compiler to see
how I might be able to compile my Perl scripts into stand alone executables.
I have been useing a debian system on an i386 box to attempt to compile a
'hello world' script using the perlcc method. It seems to dump the C source
to file ok (I don't know C so I can't tell) but when it attempts to compile
that it dies with a missing library called '-lgdbm' I think?
Anyone out there done this before? Where can I get this library from and how
do I let perlcc know about it?
My script...
#!/usr/bin/perl
print 'Testing 123';
exit;
My output.....
PROMT# perlcc test.pl
----------------------------------------------------------------------------
Compiling test.pl:
----------------------------------------------------------------------------
Making C(test.pl.c) for test.pl!
perl-5.005 -I/usr/lib/perl5/5.005/i386-linux -I/usr/lib/perl5/5.005
-I/usr/local/lib/site_perl/i386-linux -I/usr/local/lib/site_perl
-I/usr/lib/perl5
-I. -MO=CC,-otest.pl.c test.pl
test.pl syntax OK
Compiling C(test) for test.pl!
perl-5.005 -I/usr/lib/perl5/5.005/i386-linux -I/usr/lib/perl5/5.005
-I/usr/local/lib/site_perl/i386-linux -I/usr/local/lib/site_perl
-I/usr/lib/perl5
-I. /tmp/test.pl.tst
cc -Dbool=char -DHAS_BOOL -D_REENTRANT -DDEBIAN -I/usr/local/include -O2
-I/usr/lib/perl5/5.005/i386-linux/CORE /usr/lib/perl5/5.005/i386-linux/auto/
Fcntl/Fcntl.so -o test test.pl.c -L/usr/local/lib
-L/usr/lib/perl5/5.005/i386-linux/CORE -lperl -lnsl -lndbm -lgdbm -ldbm -ldb
-ldl -lm -lc -lposix -
lcrypt
/usr/bin/ld: cannot find -lgdbm
collect2: ld returned 1 exit status
ERROR: In compiling code for test.pl.c !
------------------------------
Date: Tue, 26 Dec 2000 06:48:14 -0000
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: Statistics for comp.lang.perl.misc
Message-Id: <t4gfpefikfe41a@corp.supernews.com>
Following is a summary of articles spanning a 8 day period,
beginning at 18 Dec 2000 06:47:02 GMT and ending at
26 Dec 2000 05:56:14 GMT.
Notes
=====
- A line in the body of a post is considered to be original if it
does *not* match the regular expression /^\s{0,3}(?:>|:|\S+>|\+\+)/.
- All text after the last cut line (/^-- $/) in the body is
considered to be the author's signature.
- The scanner prefers the Reply-To: header over the From: header
in determining the "real" email address and name.
- Original Content Rating (OCR) is the ratio of the original content
volume to the total body volume.
- Find the News-Scan distribution on the CPAN!
<URL:http://www.perl.com/CPAN/modules/by-module/News/>
- Please send all comments to Greg Bacon <gbacon@cs.uah.edu>.
- Copyright (c) 2000 Greg Bacon.
Verbatim copying and redistribution is permitted without royalty;
alteration is not permitted. Redistribution and/or use for any
commercial purpose is prohibited.
Excluded Posters
================
perlfaq-suggestions\@(?:.*\.)?perl\.com
Totals
======
Posters: 429
Articles: 1380 (565 with cutlined signatures)
Threads: 383
Volume generated: 2630.8 kb
- headers: 1100.0 kb (22,015 lines)
- bodies: 1455.6 kb (48,924 lines)
- original: 998.2 kb (36,003 lines)
- signatures: 73.8 kb (1,691 lines)
Original Content Rating: 0.686
Averages
========
Posts per poster: 3.2
median: 1 post
mode: 1 post - 228 posters
s: 6.6 posts
Posts per thread: 3.6
median: 3 posts
mode: 1 post - 123 threads
s: 3.7 posts
Message size: 1952.1 bytes
- header: 816.3 bytes (16.0 lines)
- body: 1080.1 bytes (35.5 lines)
- original: 740.7 bytes (26.1 lines)
- signature: 54.8 bytes (1.2 lines)
Top 10 Posters by Number of Posts
=================================
(kb) (kb) (kb) (kb)
Posts Volume ( hdr/ body/ orig) Address
----- -------------------------- -------
91 196.5 ( 71.0/112.9/ 74.3) Tad McClellan <tadmc@metronet.com>
40 80.7 ( 37.8/ 36.2/ 31.4) abigail@foad.org
34 54.7 ( 29.7/ 24.7/ 16.8) Bart Lateur <bart.lateur@skynet.be>
32 50.9 ( 22.8/ 25.8/ 16.8) nobull@mail.com
31 128.0 ( 23.7/103.0/103.0) PerlFAQ Server <faq@denver.pm.org>
30 64.8 ( 26.5/ 37.7/ 24.0) Jeff Helman <jhelman@wsb.com>
25 39.3 ( 18.6/ 20.3/ 11.4) garry@zvolve.com
22 45.9 ( 19.2/ 20.1/ 8.0) Uri Guttman <uri@sysarch.com>
19 24.8 ( 13.6/ 11.1/ 6.1) rzilavec@tcn.net
19 75.5 ( 13.1/ 62.4/ 56.5) Tom Christiansen <tchrist@perl.com>
These posters accounted for 24.9% of all articles.
Top 10 Posters by Volume
========================
(kb) (kb) (kb) (kb)
Volume ( hdr/ body/ orig) Posts Address
-------------------------- ----- -------
196.5 ( 71.0/112.9/ 74.3) 91 Tad McClellan <tadmc@metronet.com>
128.0 ( 23.7/103.0/103.0) 31 PerlFAQ Server <faq@denver.pm.org>
80.7 ( 37.8/ 36.2/ 31.4) 40 abigail@foad.org
75.5 ( 13.1/ 62.4/ 56.5) 19 Tom Christiansen <tchrist@perl.com>
64.8 ( 26.5/ 37.7/ 24.0) 30 Jeff Helman <jhelman@wsb.com>
54.7 ( 29.7/ 24.7/ 16.8) 34 Bart Lateur <bart.lateur@skynet.be>
50.9 ( 22.8/ 25.8/ 16.8) 32 nobull@mail.com
46.5 ( 15.5/ 27.0/ 18.5) 19 mgjv@tradingpost.com.au
45.9 ( 19.2/ 20.1/ 8.0) 22 Uri Guttman <uri@sysarch.com>
39.3 ( 18.6/ 20.3/ 11.4) 25 garry@zvolve.com
These posters accounted for 29.8% of the total volume.
Top 10 Posters by OCR (minimum of five posts)
==============================================
(kb) (kb)
OCR orig / body Posts Address
----- -------------- ----- -------
1.000 (103.0 /103.0) 31 PerlFAQ Server <faq@denver.pm.org>
0.991 ( 22.7 / 22.9) 14 The WebDragon <nospam@nospam.com>
0.906 ( 56.5 / 62.4) 19 Tom Christiansen <tchrist@perl.com>
0.892 ( 3.3 / 3.7) 7 AP <alex@hoopsie2.com>
0.866 ( 31.4 / 36.2) 40 abigail@foad.org
0.838 ( 12.4 / 14.8) 12 Logan Shaw <logan@cs.utexas.edu>
0.836 ( 6.0 / 7.1) 11 "John Lin" <johnlin@chttl.com.tw>
0.828 ( 2.4 / 2.8) 5 "Alexander Farber (EED)" <eedalf@eed.ericsson.se>
0.799 ( 7.9 / 9.9) 8 "Studio 51" <leekembel@hotmail.com>
0.785 ( 9.5 / 12.1) 11 "tim allen" <timallen449@coldmail.com>
Bottom 10 Posters by OCR (minimum of five posts)
=================================================
(kb) (kb)
OCR orig / body Posts Address
----- -------------- ----- -------
0.403 ( 4.7 / 11.7) 7 Justin McNutt <mcnuttj@nin.iats.missouri.edu>
0.398 ( 8.0 / 20.1) 22 Uri Guttman <uri@sysarch.com>
0.363 ( 1.7 / 4.8) 10 Tony Curtis <tony_curtis32@yahoo.com>
0.353 ( 2.3 / 6.6) 5 Dave Brondsema <brondsem@my-deja.com>
0.326 ( 0.8 / 2.4) 5 Russ Jones <russ_jones@rac.ray.com>
0.313 ( 1.7 / 5.3) 9 ubl@schaffhausen.de
0.297 ( 2.5 / 8.5) 9 AvA <a.v.a@home.nl>
0.289 ( 0.7 / 2.5) 5 revjack <revjack@revjack.net>
0.236 ( 0.7 / 2.8) 5 "Peter Sundstrom" <peter.sundstrom@eds.com>
0.171 ( 1.2 / 7.3) 5 "Brooklyn Linux Solutions CEO" <ruben@www2.mrbrklyn.com>
71 posters (16%) had at least five posts.
Top 10 Threads by Number of Posts
=================================
Posts Subject
----- -------
31 switch/case in Perl?
27 automatic FAQ answerer idea
18 One-Liner to Sum a Stack of Numbers?
18 Why are multiple zeroes true?
17 perl DBI
16 Reverse "append to file"
16 problem with awk in perl script
16 HTML parse
16 yet another question: is ' more efficient than "?
14 Is there a standard, current Perl for Win32 (without ActivePerl?)
These threads accounted for 13.7% of all articles.
Top 10 Threads by Volume
========================
(kb) (kb) (kb) (kb)
Volume ( hdr/ body/ orig) Posts Subject
-------------------------- ----- -------
64.9 ( 21.4/ 41.8/ 27.3) 27 automatic FAQ answerer idea
58.7 ( 25.9/ 31.2/ 21.7) 31 switch/case in Perl?
42.6 ( 13.8/ 27.6/ 18.5) 16 Reverse "append to file"
41.4 ( 14.2/ 26.1/ 15.0) 16 HTML parse
41.1 ( 17.5/ 21.5/ 12.0) 18 Why are multiple zeroes true?
37.7 ( 19.0/ 16.7/ 11.1) 18 One-Liner to Sum a Stack of Numbers?
33.4 ( 14.0/ 17.9/ 10.6) 17 perl DBI
32.0 ( 2.4/ 29.4/ 11.1) 3 REF: Help with Hash in a loop. Desperate!
31.1 ( 13.1/ 16.9/ 9.5) 16 problem with awk in perl script
30.6 ( 13.5/ 15.1/ 10.7) 16 yet another question: is ' more efficient than "?
These threads accounted for 15.7% of the total volume.
Top 10 Threads by OCR (minimum of five posts)
==============================================
(kb) (kb)
OCR orig / body Posts Subject
----- -------------- ----- -------
0.944 ( 17.1/ 18.1) 7 Posting Guidelines for comp.lang.perl.misc ($Revision: 0.3 $)
0.836 ( 12.0/ 14.3) 13 Understanding interpolation
0.830 ( 4.2/ 5.1) 7 Sorting hash
0.817 ( 18.4/ 22.5) 7 netiquette checking script
0.815 ( 1.6/ 2.0) 5 Free servers with Perl support?
0.814 ( 1.2/ 1.4) 5 Run dbiproxy upon boot up?
0.803 ( 4.6/ 5.8) 5 Newbie but serious - Problems reading file from multipart forms (no
binmode!)
0.801 ( 4.7/ 5.9) 6 Contribute scripts ? (delete duplicate lines)
0.801 ( 7.8/ 9.7) 10 is this bad perl programming habit?
0.797 ( 2.4/ 3.0) 5 Creating Union/Intersect arrays...
Bottom 10 Threads by OCR (minimum of five posts)
=================================================
(kb) (kb)
OCR orig / body Posts Subject
----- -------------- ----- -------
0.527 ( 4.2 / 7.9) 10 (Beginner) Simple stuff not working
0.516 ( 2.9 / 5.6) 5 time, schedules, advice
0.505 ( 2.3 / 4.5) 6 Need help finding a space in a string with "index"
0.488 ( 1.9 / 3.9) 5 How can I access the checkbox value of a form in Perl?
0.471 ( 4.2 / 9.0) 10 very strange thing with closures
0.468 ( 1.6 / 3.5) 5 Writing to Files,
0.420 ( 2.1 / 4.9) 6 PWS - perl
0.380 ( 1.8 / 4.8) 6 Hiding source
0.374 ( 1.9 / 5.1) 7 Perl on Win32 from a unix guy.
0.294 ( 3.4 / 11.4) 7 using vi from within perl
93 threads (24%) had at least five posts.
Top 10 Targets for Crossposts
=============================
Articles Newsgroup
-------- ---------
32 comp.lang.perl
27 comp.lang.java.machine
27 comp.lang.java.softwaretools
25 comp.lang.java.tech
22 comp.lang.perl.modules
14 comp.lang.awk
14 alt.perl
10 alt.lang.awk
4 comp.lang.perl.tk
4 comp.infosystems.www.authoring.html
Top 10 Crossposters
===================
Articles Address
-------- -------
14 Kenny Pearce <kenny@kennypearce.net>
14 Jason Trenouth <jason@harlequin.com>
12 "David Simmons" <pulsar@qks.com>
12 Just Me <just_me@nowhere.com>
8 David Steuber <nospam@david-steuber.com>
7 Chris Stith <mischief@velma.motion.net>
7 garry@zvolve.com
5 Jim Monty <monty@primenet.com>
4 Just Me <just_me@nospam.com>
4 "Karol Nowakowski" <karol@imm.org.pl>
------------------------------
Date: Mon, 25 Dec 2000 23:31:16 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Syntax for "eq" and "||"
Message-Id: <slrn94g7ok.b1h.tadmc@magna.metronet.com>
Jon Bell <jtbell@presby.edu> wrote:
> Paul Wasilkoff <paul_wasilkoff@ucg.org> wrote:
>>
>>if ($in{'Contact_Country'} eq "Austalia" || "Canada" || "UK")
>
>Allow me to save myself a bit of typing by using an intermediate variable:
Allow me to save myself a bit of typing by using the grep() function :-)
>$incc = $in{'Contact_Country'};
>if ($incc eq "Australia" || $incc eq "Canada" || $incc eq "UK")
if ( grep $in{'Contact_Country'} eq $_, qw/Australia Canada UK/ )
--
Tad McClellan SGML consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
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 5199
**************************************