[18162] in Perl-Users-Digest
Perl-Users Digest, Issue: 330 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Feb 21 18:10:42 2001
Date: Wed, 21 Feb 2001 15:10:18 -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: <982797018-v10-i330@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 21 Feb 2001 Volume: 10 Number: 330
Today's topics:
Re: PROPOSAL: Graphics::ColorNames <wlkngowl@unix.asb.com>
Re: PROPOSAL: Graphics::ColorNames <bart.lateur@skynet.be>
Re: PROPOSAL: Graphics::ColorNames <bmb@ginger.libs.uga.edu>
Re: PROPOSAL: Graphics::ColorNames <bmb@ginger.libs.uga.edu>
Re: PROPOSAL: Graphics::ColorNames (Abigail)
Re: Quickest way to convert all keys in a hash from upp egwong@netcom.com
Re: Quickest way to convert all keys in a hash from upp egwong@netcom.com
Re: Quickest way to convert all keys in a hash from upp <dperham@dperham.eng.tvol.net>
Regexp to match Web urls? (Clay Shirky)
Re: Regexp to match Web urls? <elijah@workspot.net>
Re: Regexp to match Web urls? (Abigail)
upload a whole directory <c.gersch@team.isneurope.com>
Re: version of Unix operation system (Abigail)
Re: Whats wrong with this???? <nouser@emailunwelcome.com>
why do i get an unitialized value warning when reading <igor_aptekar@programmer.net>
Re: Write to a text file works, but not to an html file <crowj@aol.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 21 Feb 2001 16:50:23 -0500
From: Robert Rothenburg <wlkngowl@unix.asb.com>
Subject: Re: PROPOSAL: Graphics::ColorNames
Message-Id: <3A94381F.FFBEAA0@unix.asb.com>
Brad Baxter wrote:
> Yikes. I wasn't suggesting loading the text file at all. I was
> suggesting hiding a binary search of the text file behind a tied hash
> fetch.
Wouldn't a text file load faster than dynamically loading and parsing a
submodule (Graphics::ColorNames::X)? I'm guessing it might. I haven't
done any comparisons yet.
> I'm not saying it's a better approach than using a dbm file--I suspect
> it's a bit slower. But I don't imagine this would be accessed in a tight
> loop. I really don't have a strong opinion either way.
I think DBM is way too much overhead for a fancy way of providing
several hundred "constants" (color names and RGB values).
> I bet coming up with the actual color names will prove much more
> challenging than coming up with the class implementation. As long as the
> implementation is suitably encapsulated, it can be improved as needed.
That's the easiest part. The /colou?r/ names and associated RGB values
come from "standard" sources: X-Windows, MS-Windows, HTML/CSS/SVG.
------------------------------
Date: Wed, 21 Feb 2001 22:05:22 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: PROPOSAL: Graphics::ColorNames
Message-Id: <cue89tkj955r0m7a3avg8l2jns1inoclm4@4ax.com>
Brad Baxter wrote:
> 37 Output:
> 38
> 39 <font color="ff0000">Red</font>
> 40 <font color="ff0000">Rojo</font>
That is not exactly what's wanted in HTML. You need a "#" before the hex
number.
--
Bart.
------------------------------
Date: Wed, 21 Feb 2001 17:14:01 -0500
From: Brad Baxter <bmb@ginger.libs.uga.edu>
Subject: Re: PROPOSAL: Graphics::ColorNames
Message-Id: <Pine.A41.4.21.0102211710480.11852-100000@ginger.libs.uga.edu>
On Wed, 21 Feb 2001, Bart Lateur wrote:
> Brad Baxter wrote:
>
> > 37 Output:
> > 38
> > 39 <font color="ff0000">Red</font>
> > 40 <font color="ff0000">Rojo</font>
>
> That is not exactly what's wanted in HTML. You need a "#" before the hex
> number.
Yeah, I realized that too late. On the other hand, it does still work
most of the time. I think that's both good and bad depending how you
look at it.
Brad
------------------------------
Date: Wed, 21 Feb 2001 17:23:44 -0500
From: Brad Baxter <bmb@ginger.libs.uga.edu>
Subject: Re: PROPOSAL: Graphics::ColorNames
Message-Id: <Pine.A41.4.21.0102211714550.11852-100000@ginger.libs.uga.edu>
On Wed, 21 Feb 2001, Robert Rothenburg wrote:
> Brad Baxter wrote:
>
> > Yikes. I wasn't suggesting loading the text file at all. I was
> > suggesting hiding a binary search of the text file behind a tied hash
> > fetch.
>
> Wouldn't a text file load faster than dynamically loading and parsing a
> submodule (Graphics::ColorNames::X)? I'm guessing it might. I haven't
> done any comparisons yet.
Faster possibly, but I wouldn't want to load a huge table in memory if all
I want are a couple of values. I can't imagine the speed difference at
startup is worth worrying about.
> > I'm not saying it's a better approach than using a dbm file--I suspect
> > it's a bit slower. But I don't imagine this would be accessed in a tight
> > loop. I really don't have a strong opinion either way.
>
> I think DBM is way too much overhead for a fancy way of providing
> several hundred "constants" (color names and RGB values).
I'm not sure I can agree with that, particularly if the table grows over
time to include bunches of color naming schemes, which I think it might.
As I said, I'm just partial to human-readable data if the difference is
within acceptable bounds.
> > I bet coming up with the actual color names will prove much more
> > challenging than coming up with the class implementation. As long as the
> > implementation is suitably encapsulated, it can be improved as needed.
>
> That's the easiest part. The /colou?r/ names and associated RGB values
> come from "standard" sources: X-Windows, MS-Windows, HTML/CSS/SVG.
Sounds okay to me. I wouldn't rule out user-definable tables, though.
Brad
------------------------------
Date: 21 Feb 2001 22:43:26 GMT
From: abigail@foad.org (Abigail)
Subject: Re: PROPOSAL: Graphics::ColorNames
Message-Id: <slrn998h4e.hvb.abigail@tsathoggua.rlyeh.net>
Brad Baxter (bmb@ginger.libs.uga.edu) wrote on MMDCCXXXI September
MCMXCIII in <URL:news:Pine.A41.4.21.0102211714550.11852-100000@ginger.libs.uga.edu>:
,, On Wed, 21 Feb 2001, Robert Rothenburg wrote:
,, > Brad Baxter wrote:
,, >
,, > > Yikes. I wasn't suggesting loading the text file at all. I was
,, > > suggesting hiding a binary search of the text file behind a tied hash
,, > > fetch.
,, >
,, > Wouldn't a text file load faster than dynamically loading and parsing a
,, > submodule (Graphics::ColorNames::X)? I'm guessing it might. I haven't
,, > done any comparisons yet.
,,
,, Faster possibly, but I wouldn't want to load a huge table in memory if all
,, I want are a couple of values. I can't imagine the speed difference at
,, startup is worth worrying about.
With dbm files, you don't need to load a huge table.
,, > > I'm not saying it's a better approach than using a dbm file--I suspect
,, > > it's a bit slower. But I don't imagine this would be accessed in a tight
,, > > loop. I really don't have a strong opinion either way.
,, >
,, > I think DBM is way too much overhead for a fancy way of providing
,, > several hundred "constants" (color names and RGB values).
*shrug* I think so too. But, as I said before, it was first said that
loading a few hundred constants with 3 ints associated data was too
much of a drain on the system. Hence the suggestion of dbm files.
,, I'm not sure I can agree with that, particularly if the table grows over
,, time to include bunches of color naming schemes, which I think it might.
,,
,, As I said, I'm just partial to human-readable data if the difference is
,, within acceptable bounds.
You can have both of course. Use the dbm files when performing queries,
and have a separate txt2dbm filter that populates the dbm file each
time you update the text file.
Abigail
--
perl -we '$@="\145\143\150\157\040\042\112\165\163\164\040\141\156\157\164".
"\150\145\162\040\120\145\162\154\040\110\141\143\153\145\162".
"\042\040\076\040\057\144\145\166\057\164\164\171";`$@`'
------------------------------
Date: 21 Feb 2001 20:52:56 GMT
From: egwong@netcom.com
Subject: Re: Quickest way to convert all keys in a hash from uppercase to lowercase (or vice-versa)?
Message-Id: <9719r8$164u$1@newssvr06-en0.news.prodigy.com>
Philip Obbard <pobbard@hotresponse.com> wrote:
> Hi all,
> At one point in my code, I wind-up with a hashref containing uppercase key
> names when I eventually need lower case key names, so I do the following
> with my hashref $results:
> #Put keys in lowercase
> while(my ($key, $value) = each(%$result)) {
> $result->{lc($key)} = $value;
> delete($result->{$key});
> }
> This works, but I'm wondering: is there a quicker way to do this (and
> wind-up with another hashref, perhaps)?
If you're not concerned about the size of your hash, you can definately
speed things up by removing the 'delete'.
Using a hash slice ought to be faster too, since you don't have to make
successive calls to 'each':
use Data::Dumper;
my $hash = { A => 1, B=>2, C=>4, D=>2 };
my @values = map { lc } keys %$hash;
@$hash{@values} = values %$hash; # or my $hash2; @$hash2{@values}=...
print Dumper $hash;
Again, this works because 'keys' and 'values' (and 'each', for that matter)
return hash elements in the same order.
ERic
------------------------------
Date: 21 Feb 2001 20:54:57 GMT
From: egwong@netcom.com
Subject: Re: Quickest way to convert all keys in a hash from uppercase to lowercase (or vice-versa)?
Message-Id: <9719v1$164u$2@newssvr06-en0.news.prodigy.com>
I forgot to mention, if you can do it, the absolute *best* solution
would be to make the keys lowercase from the start. That way you can
keep things consistant throughout your program.
ERic
------------------------------
Date: 21 Feb 2001 16:01:50 -0500
From: Doug Perham <dperham@dperham.eng.tvol.net>
Subject: Re: Quickest way to convert all keys in a hash from uppercase to lowercase (or vice-versa)?
Message-Id: <81pugbiwch.fsf@wgate.com>
"Philip Obbard" <pobbard@hotresponse.com> writes:
> Hi all,
>
> At one point in my code, I wind-up with a hashref containing uppercase key
> names when I eventually need lower case key names, so I do the following
> with my hashref $results:
>
> #Put keys in lowercase
> while(my ($key, $value) = each(%$result)) {
next unless $k =~ m/[A-Z]/; # -- this may net some gain
> $result->{lc($key)} = $value;
> delete($result->{$key});
> }
>
> This works, but I'm wondering: is there a quicker way to do this (and
it seems, in your original code, that you have will end up deleting
all of your hash elements that are already lowercase. that is, if
$key is already equal to lc($key)
then
> $result->{lc($key)} = $value;
> delete($result->{$key});
will delete that key entirely. this is probably not what you want.
simply reversing the order would fix that though (as does the additional
line of code that I proposed above).
> delete($result->{$key});
> $result->{lc($key)} = $value;
that being said, the loop should be pretty fast.
> wind-up with another hashref, perhaps)?
>
> Thanks,
> Philip
--
Doug Perham o{..}o
dperham@wgate.com moo! (oo)___
WorldGate Communications, Inc. (______)\
/ \ / \
------------------------------
Date: 21 Feb 2001 16:26:18 -0500
From: clays@panix.com (Clay Shirky)
Subject: Regexp to match Web urls?
Message-Id: <971bpq$l33$1@panix3.panix.com>
I need the canonical regexp to match urls beginning with http:// (I
don't need to worry about ftp:, telnet: or mailto:, in other words)
and though I don't want to roll my own, Google searches of the form
regexp url http
are useless because url and http appear everywhere.
Any pointers appreciated.
-clay
------------------------------
Date: 21 Feb 2001 22:03:09 GMT
From: Eli the Bearded <elijah@workspot.net>
Subject: Re: Regexp to match Web urls?
Message-Id: <eli$0102211629@qz.little-neck.ny.us>
In comp.lang.perl.misc, Clay Shirky <clays@panix.com> wrote:
> I need the canonical regexp to match urls beginning with http:// (I
> don't need to worry about ftp:, telnet: or mailto:, in other words)
> and though I don't want to roll my own, Google searches of the form
Maybe not cannonical, but
@parts =
m,\b
(http) # scheme
://(?:
(?:
([^:@/\s]+) # username -- if password in URL
:)?
([^:@/\s]+) # username if no password -- otherwise password
@
)?
([^:@/\s]+) # hostname
(?: :
(\d+) # port number
)?
( # URI start
(/ [^\s"'>?]*) # file part
(?: \?
( [^\s"'>]* ) # CGI args
)?
)? # URI end
,x;
if (@parts) {
$scheme = $parts[0];
if(defined($parts[1])) {
$user = $parts[1];
$pass = $parts[2];
} else {
$user = $parts[2];
$pass = '';
}
$host = $parts[3];
$port = $parts[4];
$port = 80 unless defined($port);
$uri = $parts[5];
$uri = '/' unless defined ($uri);
$file = ($parts[6] || '');
$args = ($parts[7] || '');
print "Reconstructed: $scheme://$host:$port$uri\n";
print "\twith user $user, pass $pass\n";
print "\tfile is $file, args $args\n";
}
$ perl /tmp/urlparse
http://www.cpan.org
Reconstructed: http://www.cpan.org:80/
with user , pass
file is , args
http://eli:S3CrET@some.machine:8080/cgi/readmail?mess=17&f=1
Reconstructed: http://some.machine:8080/cgi/readmail?mess=17&f=1
with user eli, pass S3CrET
file is /cgi/readmail, args mess=17&f=1
http://groups.google.com/groups?q=regexp+url+http+group:comp.lang.perl.*
Reconstructed: http://groups.google.com:80/groups?q=regexp+url+http+group:comp
.lang.perl.*
with user , pass
file is /groups, args q=regexp+url+http+group:comp.lang.perl.*
Elijah
------
come up with your own test cases, too
------------------------------
Date: 21 Feb 2001 22:55:12 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Regexp to match Web urls?
Message-Id: <slrn998hqg.hvb.abigail@tsathoggua.rlyeh.net>
Eli the Bearded (elijah@workspot.net) wrote on MMDCCXXXI September
MCMXCIII in <URL:news:eli$0102211629@qz.little-neck.ny.us>:
"" In comp.lang.perl.misc, Clay Shirky <clays@panix.com> wrote:
"" > I need the canonical regexp to match urls beginning with http:// (I
"" > don't need to worry about ftp:, telnet: or mailto:, in other words)
"" > and though I don't want to roll my own, Google searches of the form
""
"" Maybe not cannonical, but
""
"" @parts =
"" m,\b
"" (http) # scheme
"" ://(?:
"" (?:
"" ([^:@/\s]+) # username -- if password in URL
"" :)?
"" ([^:@/\s]+) # username if no password -- otherwise password
"" @
"" )?
"" ([^:@/\s]+) # hostname
"" (?: :
"" (\d+) # port number
"" )?
"" ( # URI start
"" (/ [^\s"'>?]*) # file part
"" (?: \?
"" ( [^\s"'>]* ) # CGI args
"" )?
"" )? # URI end
"" ,x;
Sorry, that allows too much.
Here's a better one (it cheats on ldap:// though) (remove the newlines):
(?:http://(?:(?:(?:(?:(?:[a-zA-Z\d](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?)\.
)*(?:[a-zA-Z](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?))|(?:(?:\d+)(?:\.(?:\d+)
){3}))(?::(?:\d+))?)(?:/(?:(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F
\d]{2}))|[;:@&=])*)(?:/(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{
2}))|[;:@&=])*))*)(?:\?(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{
2}))|[;:@&=])*))?)?)|(?:ftp://(?:(?:(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?
:%[a-fA-F\d]{2}))|[;?&=])*)(?::(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-
fA-F\d]{2}))|[;?&=])*))?@)?(?:(?:(?:(?:(?:[a-zA-Z\d](?:(?:[a-zA-Z\d]|-
)*[a-zA-Z\d])?)\.)*(?:[a-zA-Z](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?))|(?:(?
:\d+)(?:\.(?:\d+)){3}))(?::(?:\d+))?))(?:/(?:(?:(?:(?:[a-zA-Z\d$\-_.+!
*'(),]|(?:%[a-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:(?:(?:[a-zA-Z\d\$\-_.!~*'
(),])|(?:%[a-fA-F\d]{2})|[:@&=+])*)(?:/(?:(?:(?:[a-zA-Z\d\$\-_.!~*'(),
])|(?:%[a-fA-F\d]{2})|[:@&=+])*))*)?)))?)|(?:/(?:(?:(?:(?:(?:[a-zA-Z\d
\$\-_.!~*'(),])|(?:%[a-fA-F\d]{2})|[:@&=+])*)(?:/(?:(?:(?:[a-zA-Z\d\$\
-_.!~*'(),])|(?:%[a-fA-F\d]{2})|[:@&=+])*))*)?))|(?:(?:(?:(?:(?:[a-zA-
Z\d\$\-_.!~*'(),])|(?:%[a-fA-F\d]{2})|[:@&=+])*)(?:/(?:(?:(?:[a-zA-Z\d
\$\-_.!~*'(),])|(?:%[a-fA-F\d]{2})|[:@&=+])*))*)?)))
Abigail
--
perl -e '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %;
BEGIN {% % = ($ _ = " " => print "Just Another Perl Hacker\n")}'
------------------------------
Date: Wed, 21 Feb 2001 22:22:42 +0100
From: "Christian Gersch" <c.gersch@team.isneurope.com>
Subject: upload a whole directory
Message-Id: <971bj3$sj7$05$1@news.t-online.com>
Hi there!
I want to transfer a whole directory from one server to another FTP server.
I'm really a Perl Newbie - is there perhaps an example or a workaround?
By the way: Where will I be able to download the 'LWP module'?
Thanks!!!
-Chris
--
Christian Gersch, chris@team.isneurope.com
:: www.neukunden.myisn.de - Geld für Ihre Startseite ::
------------------------------
Date: 21 Feb 2001 19:17:25 GMT
From: abigail@foad.org (Abigail)
Subject: Re: version of Unix operation system
Message-Id: <slrn998525.8cf.abigail@tsathoggua.rlyeh.net>
Ying Hu (yhu@mail.nih.gov) wrote on MMDCCXXXI September MCMXCIII in
<URL:news:3A93F7C9.D6869BA2@mail.nih.gov>:
|| Hi,
|| What function of perl can display the version of Unix operation system?
|| Any suggestion?
$ perl -we 'print `uname -r`'
2.2.13
Alternatively, you could do
$ perl -MConfig -wle 'print $Config {osvers}'
2.2.10
but that gives the version of the OS on which Perl was configured,
which isn't necessarely the same as the current OS version.
Abigail
--
sub f{sprintf$_[0],$_[1],$_[2]}print f('%c%s',74,f('%c%s',117,f('%c%s',115,f(
'%c%s',116,f('%c%s',32,f('%c%s',97,f('%c%s',0x6e,f('%c%s',111,f('%c%s',116,f(
'%c%s',104,f('%c%s',0x65,f('%c%s',114,f('%c%s',32,f('%c%s',80,f('%c%s',101,f(
'%c%s',114,f('%c%s',0x6c,f('%c%s',32,f('%c%s',0x48,f('%c%s',97,f('%c%s',99,f(
'%c%s',107,f('%c%s',101,f('%c%s',114,f('%c%s',10,)))))))))))))))))))))))))
------------------------------
Date: Wed, 21 Feb 2001 17:09:57 -0500
From: Jay Tilton <nouser@emailunwelcome.com>
Subject: Re: Whats wrong with this????
Message-Id: <mne89t4l08895koavt356f484hmp6rf7ct@4ax.com>
Bart Lateur <bart.lateur@skynet.be> wrote:
>You better check
>
> A) What $subject is, and if you can even use it as a file name.
Just as a goof, I tried it with 'mainboard.cgi' as a subject. The
script obediently scribbled all over itself.
One thing you might want to change, Eric...
Change
my $thispost = <READIT>;
to
my $thispost = join('',<READIT>);
to make it read the whole file instead of just the first line.
I'd also suggest using url(-relative=>1) instead of hard-coded
'mainboard.cgi' so the script is immune to having its name changed,
and providing a default response when the 'state' param isn't valid.
------------------------------
Date: Wed, 21 Feb 2001 19:49:18 -0000
From: "Igor Aptekar" <igor_aptekar@programmer.net>
Subject: why do i get an unitialized value warning when reading from a file?
Message-Id: <40Vk6.103$sB4.46480@nnrp4.clara.net>
I get this error in quite a few chunks eventhough i use chomp. Can someone
explain what it mean and how to prevent it.
thnaks
------------------------------
Date: Wed, 21 Feb 2001 15:46:45 -0500
From: John Crowley <crowj@aol.com>
Subject: Re: Write to a text file works, but not to an html file.
Message-Id: <3A942935.C4E704D7@aol.com>
John Crowley wrote:
>
> "Fabian Thorbjörnsson" wrote:
> >
> [snip]
> > This is my whole script. = Internal server error:
> >
> > #!/usr/bin/perl
> >
> > $foo = "/home/markiser/www/foo.html";
> >
> > open( FILE, ">$foo");
> > print FILE qq(
> > <html>
> > <head>
> > <title>Foo</title>
> > </head>
> > <body>
> > <h1 align=center>Foo foo</h1>
> > </body>
> > </html>
> > )
> >
> > exit;
>
> this isn't a perl problem. you're web server is not configured to run
> cgi. try a cgi newsgroup.
sorry, ignore this answer ... random act of stupidity on my part.
------------------------------
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 V10 Issue 330
**************************************