[29832] in Perl-Users-Digest
Perl-Users Digest, Issue: 1075 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Nov 28 16:09:45 2007
Date: Wed, 28 Nov 2007 13:09:11 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 28 Nov 2007 Volume: 11 Number: 1075
Today's topics:
Re: Close function blocks forever when reading from pip xhoster@gmail.com
Re: handling perl string containing '@' and '$' with sy wong_powah@yahoo.ca
Re: handling perl string containing '@' and '$' with sy <1usa@llenroc.ude.invalid>
Re: handling perl string containing '@' and '$' with sy <ben@morrow.me.uk>
Re: Path to Perl <emschwar@pobox.com>
Re: Perl reference, what's the difference <brian.d.foy@gmail.com>
Re: Scalar::Util is not using XS in Fedora 8, leading t <brian.d.foy@gmail.com>
Re: Scalar::Util is not using XS in Fedora 8, leading t <tzz@lifelogs.com>
Side effects of overloading quotes "" <koszalekopalek@interia.pl>
Re: Side effects of overloading quotes "" <1usa@llenroc.ude.invalid>
Re: ST <ryoung@medicalpharmacies.com>
Re: trace of method calls <avilella@gmail.com>
Re: trace of method calls <s.denaxas@gmail.com>
Re: two hash tables, keys comparision? <bugbear@trim_papermule.co.uk_trim>
Re: two hash tables, keys comparision? <smallpond@juno.com>
Re: two hash tables, keys comparision? <bugbear@trim_papermule.co.uk_trim>
Re: two hash tables, keys comparision? <1usa@llenroc.ude.invalid>
Re: web crawling for books <a24061@ducksburg.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 28 Nov 2007 18:18:15 GMT
From: xhoster@gmail.com
Subject: Re: Close function blocks forever when reading from piped output
Message-Id: <20071128131817.219$Sm@newsreader.com>
Mark <google@markginsburg.com> wrote:
> I am reading piped output from a command that produces a lot of
> output. I would like to terminate reading the data before the end of
> the output is reached.
>
> The following sample program illustrates the issue. The program will
> get stuck on the close(). Any help in dealing with this situation
> will be appreciated.
If you use a piped open, Perl automagically bundles the wait (or whatever
the Windows equiv is) in with the close, which might be the problem. If you
roll your own using pipe and fork (or Windows equiv), then it should be
possible to unbundle the close and the wait.
But why close, rather than just going about your business with an open but
no longer used file handle? If you want the return value of the close,
then anything you do to force the close to happen means that the return
value you get will now be driven by the forcing method rather than the
natural operation of the child, and so probably isn't worth having.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.
------------------------------
Date: Wed, 28 Nov 2007 06:17:37 -0800 (PST)
From: wong_powah@yahoo.ca
Subject: Re: handling perl string containing '@' and '$' with system function
Message-Id: <524a303d-5c39-48c9-ab09-b720df1fdda9@s12g2000prg.googlegroups.com>
On Nov 27, 11:08 pm, "A. Sinan Unur" <1...@llenroc.ude.invalid> wrote:
> wong_po...@yahoo.ca wrote in news:f30dc5b0-5f4e-4303-999a-9cd9efebaec1
> @a35g2000prf.googlegroups.com:
>
>
>
> > This work ("acthw successful" message appeared), as suggested by
> > Sinan:
> > system "/usr/local/bin/acthw", "-pw", "$newpw";
>
> I am glad it worked. But here is what I originally suggested:
>
> system '/usr/local/bin/acthw', '-pw', $newpw ;
>
> Note the differences.
>
> perldoc -q always
>
> Sinan
>
> --
> A. Sinan Unur <1...@llenroc.ude.invalid>
> (remove .invalid and reverse each component for email address)
> clpmisc guidelines: <URL:http://www.augustmail.com/~tadmc/clpmisc.shtml>
The difference is single quote '' and double quote "".
My concern is to handle both regular alphanumeric characters and
special characters such as '@' and '$'.
Are single quote '' and double quote "" equally good approach?
Or one approach is better than the other?
------------------------------
Date: Wed, 28 Nov 2007 14:32:14 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: handling perl string containing '@' and '$' with system function
Message-Id: <Xns99F6610391DE5asu1cornelledu@127.0.0.1>
wong_powah@yahoo.ca wrote in
news:524a303d-5c39-48c9-ab09-b720df1fdda9@s12g2000prg.googlegroups.com:
> On Nov 27, 11:08 pm, "A. Sinan Unur" <1...@llenroc.ude.invalid> wrote:
>> wong_po...@yahoo.ca wrote in
>> news:f30dc5b0-5f4e-4303-999a-9cd9efebaec1
>> @a35g2000prf.googlegroups.com:
>>
>>
>>
>> > This work ("acthw successful" message appeared), as suggested by
>> > Sinan:
>> > system "/usr/local/bin/acthw", "-pw", "$newpw";
>>
>> I am glad it worked. But here is what I originally suggested:
>>
>> system '/usr/local/bin/acthw', '-pw', $newpw ;
>>
>> Note the differences.
>>
>> perldoc -q always
>>
>> Sinan
>>
>> --
>> A. Sinan Unur <1...@llenroc.ude.invalid>
Please do not quote sigs.
> The difference is single quote '' and double quote "".
That is one of the differences. Although not an iron-clad rule, I agree
with others who recommend that double-quotes be reserved for strings
where interpolation is used.
The other difference is the that my version does not interpolate the
value of $newpw. To explain that, I pointed you to the relevant FAQ
entry:
perldoc -q always
> My concern is to handle both regular alphanumeric characters and
> special characters such as '@' and '$'.
Shells can give special meaning to some characters. Using the list form
of system, you are avoiding the shell. I don't see why any character
should be problematic in that context.
> Are single quote '' and double quote "" equally good approach?
> Or one approach is better than the other?
Each one is appropriate for the task for which they are designed:
Single-quotes for non-interpolated strings, double quotes for
interpolated strings.
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)
clpmisc guidelines: <URL:http://www.augustmail.com/~tadmc/clpmisc.shtml>
------------------------------
Date: Wed, 28 Nov 2007 04:38:11 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: handling perl string containing '@' and '$' with system function
Message-Id: <ju7v15-42k.ln1@osiris.mauzo.dyndns.org>
Quoth "John W. Krahn" <krahnj@telus.net>:
> wong_powah@yahoo.ca wrote:
> >
> > If I had a perl string $newpw which is inputed by a user and it may
> > contain special characters such as '@' and '$' (e.g. "5a@Wf7$X"). How
> > to pass it to the system function properly?
> > This does not work:
> > system("/usr/local/bin/acthw -pw \"$newpw\"");
>
> Why does it not work? What error message, if any, does it produce?
> Which version of Perl are you using? What operating system and version
> are you using? Does:
>
> /usr/local/bin/acthw -pw 5a@Wf7$X
>
> work on the command line?
Come now. Unix is a certain guess, and /bin/sh will expand $X inside
double quotes, so it's pretty clear what's going wrong. A bit more info
from the OP would have been better, but in this case it isn't necessary
to diagnose the problem.
To the OP: you can quote single arguments for the shell in a reasonably
safe and cross-platform manner using MakeMaker, though the interface is
a bit icky:
use ExtUtils::MakeMaker;
$newpw = MM->quote_literal($newpw);
system("/usr/local/bin/acthw -pw $newpw");
Note the absence of any extra quotes around $newpw: MM has handled those
for you. It is better to avoid using the shell where you can.
Ben
------------------------------
Date: Wed, 28 Nov 2007 13:03:26 -0700
From: Eric Schwartz <emschwar@pobox.com>
Subject: Re: Path to Perl
Message-Id: <871waarvch.fsf@pobox.com>
"Thrill5" <nospam@somewhere.com> writes:
> My question would be why is he using a shebang for the perl path on a
> windows machine in the first place?
To pass along command line flags like -T?
-=Eric
------------------------------
Date: Wed, 28 Nov 2007 08:58:00 -0600
From: brian d foy <brian.d.foy@gmail.com>
Subject: Re: Perl reference, what's the difference
Message-Id: <281120070858000563%brian.d.foy@gmail.com>
In article
<2cad07db-3665-457a-b3e5-a56c82714af8@s12g2000prg.googlegroups.com>,
Todd <xueweizhong@gmail.com> wrote:
> Hi nolo,
>
> > print { *STDOUT{IO} } "Hello\n";
> > see perldoc -f print
> > or if you're using any other expression more complex
> > than a scalar variable to retrieve it, you will have
> > to use a block returning the filehandle value
> > instead:
>
> Really nice. But do you ever know the difficulty in the compiler which
> causes this intention?
It's the Perl compiler having to guess what's coming next. The thingy
after the print could be the thing to print, or the filehandle to print
to.
print "Hello!\n";
print STDOUT "Hello!\n";
Since Perl 5.6, it's a bit more complicated because fileandles can be
stored in scalar variables. Notice there is no comma after $fh in the
print, just as there is no comma after the STDOUT.
open my($fh), ...;
print $message;
print $fh $message;
While parsign that, Perl has to guess that $fh is going to have a
filehandle reference in it even though it can't know that it actually
will at compile time. It looks either for a scalar variable or a
bareword to determine if I'm using a filehandle.
If I'm not using a scalar variable or a bareword and I have the
filehandle in something else, I need to give Perl the hint that the
thingy will have a filehandle reference by putting {} around the thing
that will have the filehandle reference. Remember, Perl is a dynamic
language, so that thingy won't have it's value until Perl runs it.
There's no type checking here.
print { $fh } "Hello!\n";
print { $handles{ $key } } "Hello!\n";
print { *STDOUT{IO} } "Hello!\n";
print { require IO::Interactive; IO::Interactive::interactive() }
"Hello!\n";
Good luck :)
------------------------------
Date: Wed, 28 Nov 2007 08:40:24 -0600
From: brian d foy <brian.d.foy@gmail.com>
Subject: Re: Scalar::Util is not using XS in Fedora 8, leading to performance problem
Message-Id: <281120070840247160%brian.d.foy@gmail.com>
In article <8663zn7boy.fsf@lifelogs.com>, Ted Zlatanov
<tzz@lifelogs.com> wrote:
> This may make your life easier, as it doesn't require the shell:
>
> perl -MCPAN -e'force(install => "Scalar::Util")'
even easier :)
% cpan -fi Scalar::Util
------------------------------
Date: Wed, 28 Nov 2007 12:49:14 -0600
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: Scalar::Util is not using XS in Fedora 8, leading to performance problem
Message-Id: <861waa434l.fsf@lifelogs.com>
On Wed, 28 Nov 2007 08:40:24 -0600 brian d foy <brian.d.foy@gmail.com> wrote:
bdf> In article <8663zn7boy.fsf@lifelogs.com>, Ted Zlatanov
bdf> <tzz@lifelogs.com> wrote:
>> This may make your life easier, as it doesn't require the shell:
>>
>> perl -MCPAN -e'force(install => "Scalar::Util")'
bdf> even easier :)
bdf> % cpan -fi Scalar::Util
Huh, that option is not documented as of 5.8.8, but it works. Thanks
for the info. Has the man page been fixed to show -f since? (I ask
since you're the author as of 5.8.8 :)
Ted
------------------------------
Date: Wed, 28 Nov 2007 09:22:05 -0800 (PST)
From: Koszalek Opalek <koszalekopalek@interia.pl>
Subject: Side effects of overloading quotes ""
Message-Id: <914a45bc-ea5a-4a04-982a-266ebd0bb639@i29g2000prf.googlegroups.com>
Hello,
I overloaded the quotes '""' in my class by using
use overload ('""' => \&getDesc);
I was hoping it will allow me to write
print ("Hello from object $obj.\n");
instead of
print ("Hello from object " . $obj->getDesc() . ".\n");
Well, it works that way but there are side effects that break my class
completely.
Problem 1)
Before overloading
if ($obj)
is true, if $obj is a reference to any object of class Obj.
If the reference is undef, $obj is false.
After overloading "", $obj is also false if getDesc() happens to
return an empty string! That's not what I wanted. If I did, I could
use
if ("$obj")
Problem 2)
Before overloading I could compare object references
if ($obj1 == $obj2)
and check if they point to the same location/object. I can no
longer do that once the '""' operator has been overloaded.
Operation "==": no method found,
left argument in overloaded package Obj,
right argument in overloaded package Obj at ./a.pl
line 38.
I can use eq instead of == if I also add falllback => 1 to the
overload pragma but that string-compares $obj1->dummy()
with $obj2->dummy() instead of object references. Again, if
I wanted to compare the string representation I could do
if ("$obj1" eq "$obj2")
Am I doing sth wrong or miss the point completely? Or is this
overload module broken beyond repair?
I enclose a short listing that demonstrates my point.
Uncomment one of the #use clauses to see how it breaks
things. Any help will be appreciated.
#!/usr/bin/perl
use strict;
use warnings;
{
package Obj;
#use overload ('""' => \&getDesc);
#use overload ('""' => \&getDesc, fallback => 1);
sub new ()
{
my $class = shift;
my $self = {};
bless $self, $class;
}
sub getDesc ()
{
return "";
};
};
my $obj1 = Obj->new();
my $obj2 = Obj->new();
### PROBLEM 1 ###
if ($obj1) {
print "true\n";
} else {
print "false\n";
};
### PROBLEM 2 ###
if ($obj1 == $obj2) {
print "same references\n";
} else {
print "different references\n";
};
__END__
Koszalek
------------------------------
Date: Wed, 28 Nov 2007 20:16:02 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Side effects of overloading quotes ""
Message-Id: <Xns99F69B4D64097asu1cornelledu@127.0.0.1>
Koszalek Opalek <koszalekopalek@interia.pl> wrote in news:914a45bc-ea5a-
4a04-982a-266ebd0bb639@i29g2000prf.googlegroups.com:
> I overloaded the quotes '""' in my class by using
> use overload ('""' => \&getDesc);
>
> I was hoping it will allow me to write
> print ("Hello from object $obj.\n");
> instead of
> print ("Hello from object " . $obj->getDesc() . ".\n");
>
> Well, it works that way but there are side effects that break my class
> completely.
perldoc overload mentions:
* *Boolean, string and numeric conversion*
'bool', '""', '0+',
If one or two of these operations are not overloaded, the remaining
ones can be used instead. "bool" is used in the flow control
operators (like "while") and for the ternary "?:" operation. These
functions can return any arbitrary Perl value. If the corresponding
operation for this value is overloaded too, that operation will be
called again with this value.
As a special case if the overload returns the object itself then it
will be used directly. An overloaded conversion returning the
object is probably a bug, because you're likely to get something
that looks like "YourPackage=HASH(0x8172b34)".
> Problem 1)
>
> Before overloading
> if ($obj)
> is true, if $obj is a reference to any object of class Obj.
> If the reference is undef, $obj is false.
> After overloading "", $obj is also false if getDesc() happens to
> return an empty string! That's not what I wanted. If I did, I could
> use
> if ("$obj")
Well, then, overload bool as well.
> Problem 2)
>
> Before overloading I could compare object references
> if ($obj1 == $obj2)
> and check if they point to the same location/object. I can no
> longer do that once the '""' operator has been overloaded.
Again, overload 0+.
> #!/usr/bin/perl
> use strict;
> use warnings;
>
>
> {
> package Obj;
> #use overload ('""' => \&getDesc);
> #use overload ('""' => \&getDesc, fallback => 1);
Don't comment out code in your posting. That makes it hard to figure out
exactly what code you ran.
> sub new ()
Don't specify prototypes for methods: They have no effect and their use
is misleading. All this time, I have not found a good reason to use
prototypes in my code.
> sub getDesc ()
Ditto for prototypes.
> {
> return "";
> };
>
> };
>
> my $obj1 = Obj->new();
> my $obj2 = Obj->new();
>
> ### PROBLEM 1 ###
> if ($obj1) {
> print "true\n";
> } else {
> print "false\n";
> };
>
> ### PROBLEM 2 ###
> if ($obj1 == $obj2) {
> print "same references\n";
> } else {
> print "different references\n";
> };
The solution to Problem 1 is to implement boolean conversion. The
solution to Problem 2 is also found in perldoc overload:
Public functions
Package "overload.pm" provides the following public functions:
overload::StrVal(arg)
Gives string value of "arg" as in absence of stringify overloading.
If you are using this to get the address of a reference (useful for
checking if two references point to the same thing) then you may be
better off using "Scalar::Util::refaddr()", which is faster.
Thus, you should also implement the equality operator.
So, here is a reworked example. I did change method names to my liking:
#!/usr/bin/perl
use strict;
use warnings;
package Obj;
use Scalar::Util qw( refaddr );
use overload
q{""} => \&to_string,
'bool' => \&to_bool,
q{0+} => \&to_val,
q{==} => \&is_identical,
;
sub new { bless {} => shift }
sub to_string { q{} }
sub to_bool { defined shift }
sub to_val { refaddr shift }
sub is_identical { refaddr shift == refaddr shift }
package main;
my $obj1 = Obj->new;
my $obj2 = Obj->new;
### PROBLEM 1 ###
print( $obj1 ? "true\n" : "false\n" );
### PROBLEM 2 ###
print( $obj1 == $obj2 ? "same\n" : "different\n" );
__END__
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)
clpmisc guidelines: <URL:http://www.augustmail.com/~tadmc/clpmisc.shtml>
------------------------------
Date: Wed, 28 Nov 2007 06:51:35 -0800 (PST)
From: tekwiz <ryoung@medicalpharmacies.com>
Subject: Re: ST
Message-Id: <4bc64906-b22a-45c9-a70f-1b042bed3244@s12g2000prg.googlegroups.com>
On Nov 27, 6:41 am, Michele Dondi <bik.m...@tiscalinet.it> wrote:
> On Mon, 26 Nov 2007 11:37:07 -0800 (PST), Paul Lalli
>
> <mri...@gmail.com> wrote:
> >perfectly obvious from the context. One says "That doesn't make
> >sense, use the module I wrote!!!". One says "That doesn't make sense,
>
> Hehe, I suppose uri's epitaph may be:
>
> our @uri=(make_sorter qw/GRT no_case/)->(slurp 'uri');
>
> Michele
> --
> {$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
> (($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
> .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
> 256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
Last reply. Final solution is as follows:
Created specific sort subs for each different report type needed. The
code will detect if a sort sub is written and use it if it is; else,
it does a UNIX shell sort. During the test data, I have approx.
120,000 - 877 byte records of approx. 85 fields to sort and sorting on
4 of them, some text, some numeric. With the UNIX sort, it takes 1:08.
With the Perl sort, it takes 38 seconds. Thanks for your help.
------------------------------
Date: Wed, 28 Nov 2007 07:12:01 -0800 (PST)
From: "avilella@gmail.com" <avilella@gmail.com>
Subject: Re: trace of method calls
Message-Id: <35c103ff-a592-418c-aff9-fb460114e502@e25g2000prg.googlegroups.com>
On Nov 28, 1:50 pm, bugbear <bugbear@trim_papermule.co.uk_trim> wrote:
> avile...@gmail.com wrote:
> > On Nov 28, 10:22 am, bugbear <bugbear@trim_papermule.co.uk_trim>
> > wrote:
> >> avile...@gmail.com wrote:
> >>> Hi,
> >>> I would like to trace all the method calls for a script. What is the
> >>> best module people would recommend for this?
> >> Dynamically, or statically?
>
> >> BugBear
>
> > I think what I want is statically. I can use breakpoints and "T", but
> > I rather want to run the script completely and then have a debug file
> > with all the method calls.
>
> That's "dynamic".
>
> BugBear
oh, ok, dynamic then :-)
Anyone?
------------------------------
Date: Wed, 28 Nov 2007 08:23:35 -0800 (PST)
From: Spiros Denaxas <s.denaxas@gmail.com>
Subject: Re: trace of method calls
Message-Id: <69b3bc0b-a5c4-45c5-be3f-14b8e74da0e7@s19g2000prg.googlegroups.com>
On Nov 28, 3:12 pm, "avile...@gmail.com" <avile...@gmail.com> wrote:
> On Nov 28, 1:50 pm, bugbear <bugbear@trim_papermule.co.uk_trim> wrote:
>
>
>
> > avile...@gmail.com wrote:
> > > On Nov 28, 10:22 am, bugbear <bugbear@trim_papermule.co.uk_trim>
> > > wrote:
> > >> avile...@gmail.com wrote:
> > >>> Hi,
> > >>> I would like to trace all the method calls for a script. What is the
> > >>> best module people would recommend for this?
> > >> Dynamically, or statically?
>
> > >> BugBear
>
> > > I think what I want is statically. I can use breakpoints and "T", but
> > > I rather want to run the script completely and then have a debug file
> > > with all the method calls.
>
> > That's "dynamic".
>
> > BugBear
>
> oh, ok, dynamic then :-)
>
> Anyone?
Hi,
then use the Perl profiler and analyze its output with dprofpp.
from the manpage:
-T Display subroutine call tree to stdout. Subroutine
statistics are
not displayed.
-t Display subroutine call tree to stdout. Subroutine
statistics are
not displayed. When a function is called multiple
consecutive
times at the same calling level then it is displayed once
with a
repeat count.
Hope this helps,
Spiros
------------------------------
Date: Wed, 28 Nov 2007 15:04:10 +0000
From: bugbear <bugbear@trim_papermule.co.uk_trim>
Subject: Re: two hash tables, keys comparision?
Message-Id: <13kr0rb3dcum99@corp.supernews.com>
robertchen117@gmail.com wrote:
> let's say I have two hash tables: new, old
>
> How to find out the keys in new, but not in old?
> How to find out the keys in old, but not in new?
>
> tell me the quickest way.
Such a politely phrased request...
BugBear
------------------------------
Date: Wed, 28 Nov 2007 07:28:52 -0800 (PST)
From: smallpond <smallpond@juno.com>
Subject: Re: two hash tables, keys comparision?
Message-Id: <85356d58-b29b-45cc-871c-c3327efbe1db@i12g2000prf.googlegroups.com>
On Nov 28, 10:04 am, bugbear <bugbear@trim_papermule.co.uk_trim>
wrote:
> robertchen...@gmail.com wrote:
> > let's say I have two hash tables: new, old
>
> > How to find out the keys in new, but not in old?
> > How to find out the keys in old, but not in new?
>
> > tell me the quickest way.
>
> Such a politely phrased request...
>
> BugBear
He did say "Thanks"
------------------------------
Date: Wed, 28 Nov 2007 15:40:19 +0000
From: bugbear <bugbear@trim_papermule.co.uk_trim>
Subject: Re: two hash tables, keys comparision?
Message-Id: <13kr2v4460v7u9d@corp.supernews.com>
smallpond wrote:
> On Nov 28, 10:04 am, bugbear <bugbear@trim_papermule.co.uk_trim>
> wrote:
>> robertchen...@gmail.com wrote:
>>> let's say I have two hash tables: new, old
>>> How to find out the keys in new, but not in old?
>>> How to find out the keys in old, but not in new?
>>> tell me the quickest way.
>> Such a politely phrased request...
>>
>> BugBear
>
> He did say "Thanks"
A little backwards, but I take your point.
BugBear
------------------------------
Date: Wed, 28 Nov 2007 20:18:04 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: two hash tables, keys comparision?
Message-Id: <Xns99F69BA53F119asu1cornelledu@127.0.0.1>
smallpond <smallpond@juno.com> wrote in news:85356d58-b29b-45cc-871c-
c3327efbe1db@i12g2000prf.googlegroups.com:
> On Nov 28, 10:04 am, bugbear <bugbear@trim_papermule.co.uk_trim>
> wrote:
>> robertchen...@gmail.com wrote:
>> > let's say I have two hash tables: new, old
>>
>> > How to find out the keys in new, but not in old?
>> > How to find out the keys in old, but not in new?
>>
>> > tell me the quickest way.
>>
>> Such a politely phrased request...
>>
>> BugBear
>
> He did say "Thanks"
where he should have said *please*.
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)
clpmisc guidelines: <URL:http://www.augustmail.com/~tadmc/clpmisc.shtml>
------------------------------
Date: Wed, 28 Nov 2007 19:49:39 +0000
From: Adam Funk <a24061@ducksburg.com>
Subject: Re: web crawling for books
Message-Id: <jbt025-i8c.ln1@news.ducksburg.com>
On 2007-11-25, alexxx.magni@gmail.com wrote:
> I have a large list of my library's books,
> and I would like to setup a Perl spider, going on the web for each
> author/title information, and returning useful info I didnt put into
> the records (editor, year, topic, isbn, ...).
> I already wrote down the basic spider's structure, but I'm not sure
> which site is more apt to such a search (considering also that its
> robots.txt should allow me access).
> Which site would you suggest for such a task?
You might want to look at Alexandria, which already does quite a bit
of this. It's written in Ruby, but the source code might give you
some ideas.
http://alexandria.rubyforge.org/
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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 V11 Issue 1075
***************************************