[25751] in Perl-Users-Digest
Perl-Users Digest, Issue: 7991 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 19 14:05:51 2005
Date: Tue, 19 Apr 2005 11:05:17 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 19 Apr 2005 Volume: 10 Number: 7991
Today's topics:
ANNOUNCE: Search::InvertedIndex::Simple::BerkeleyDB V <ron@savage.net.au>
ANNOUNCEMENT: POE 0.31 Released <troc@pobox.com>
CommConnect.pl - need replacement migrating to OS X <jfcampbell@aol.com>
Re: double quote to single quote <none@none>
Re: First Line of Code - perl via Windows sigzero@gmail.com
Handling constants in Perl? newsbot@cox.net
Re: Handling constants in Perl? <mark.clementsREMOVETHIS@wanadoo.fr>
Re: hotmail password request tool (intranet usage) mmcconnell17704@yahoo.com
Re: hotmail password request tool (intranet usage) <fvanbortel@netscape.net>
Re: hotmail password request tool (intranet usage) <charlesnewman1@comcast.net.spammers.will.be.shot.on.sight>
Re: hotmail password request tool (intranet usage) <me@privacy.net>
Re: hotmail password request tool (intranet usage) <void@nowhere.lan>
ISO Perl reported bugs database <please_post@nomail.edu>
Re: my $hh = %hash <mikeh@perusion.net>
Re: my $hh = %hash <pilsl@goldfisch.at>
Re: my $hh = %hash <mikeh@perusion.net>
Re: my $hh = %hash <vticau@excite.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 17 Apr 2005 02:18:18 GMT
From: Ron Savage <ron@savage.net.au>
Subject: ANNOUNCE: Search::InvertedIndex::Simple::BerkeleyDB V 1.00
Message-Id: <IF7CBC.1vun@zorch.sf-bay.org>
The pure Perl module Search::InvertedIndex::Simple::BerkeleyDB V 1.00
is available immediately from CPAN,
and from http://savage.net.au/Perl-modules.html.
On-line docs, and a *.ppd for ActivePerl are also
available from the latter site.
------------------------------
Date: Tue, 19 Apr 2005 15:40:52 GMT
From: Rocco Caputo <troc@pobox.com>
Subject: ANNOUNCEMENT: POE 0.31 Released
Message-Id: <IF7CAz.1vsB@zorch.sf-bay.org>
Keywords: multitasking, networking, framework, components, robust, cool
--------
Rejoice!
--------
POE 0.31 has been released. Thanks go out to everyone who helped
develop it.
Highlights of changes since the last announcement:
Scheduled Deprecations:
- The new() constructor for POE::Session is finally being phased out.
This release kicks off the deprecation by documenting it.
- Signal deprecations are nearly complete. Many aspects of signal
handling have been improved this time around, including SIGTSTP
(^Z), signal handler return values, SIGCHLD polling, and the
ability to handle SIGWINCH.
Improved Portability:
- POE::Wheel::Run has early support for ActiveState Perl systems.
Thank Merijn Broeren and Nick Williams for this one.
- Restructured POE's tests, multiplying the event loop tests by the
number of supported event loops. This doesn't significantly
increase POE's test coverage, but it did flush out a lot of bugs.
Installer Improvements:
- Eliminated redundant network test prompts.
- Removed the old dependency checker.
New Features:
- POE::Wheel::FollowTail will watch files that don't exist. It also
includes a tail() method for restarting where you left off.
- POE::Filter::HTTPD allows arbitrary request methods. Martijn van
Beers also patched it to support writing keep-alive servers.
- Nick Williams gave POE::Component::Server::TCP a Hostname
constructor parameter. The component also gained a Started
callback.
- Nick Williams almost completely rewrote POE::Wheel::ReadLine,
adding many of gnu readline's features: command history search,
custom key bindings, .inputrc parsing, tab completion, vi and emacs
modes, and more.
Bug Fixes:
- POE::Filter::Reference loads Compress::Zlib, and avoids a redundant
string eval() that was dragging down performance. Thanks to Rhesa
Rozendaal, Philip Gwin, and others.
- POE::Wheel::ReadLine's hang problems have finally been determined.
Term::ReadKey has an obscure bug that manifests under Perl 5.8.0 on
certain Linux systems. Upgrade Perl, or Linux, or both, and the
problem should go away.
- POE::Loop's loader uses a better hash of the event loop module's
name, making it easier for third-party loop authors to publish
their works.
As if that wasn't enough, POE's web site contains detailed logs for
every public release, ever!
- http://poe.perl.org/?POE_CHANGES
Even now the latest tarball should be hurtling towards your favorite
CPAN mirror. It is also on the web, and so is a Windows PPD! Users
who need advanced notice of changes can follow POE's development in
CVS or discuss new features on the mailing list.
- http://poe.perl.org/?Where_to_Get_POE
- http://poe.perl.org/?POE_Support_Resources
Thanks again to everyone who helped with this release. Keep the
feedback and patches coming.
---------
About POE
---------
POE is a networking and multitasking framework for Perl. It has been
in active development since 1996, and its first public release was in
1998. O'Reilly's The Perl Conference (now part of OSCON) named it
"Best New Module" in 1999.
- http://poe.perl.org/?What_POE_Is
POE's users and developers continue to improve and build upon it. See
the CPAN for the most up-to-date list of POE based modules.
- http://search.cpan.org/search?mode=module&query=POE
POE's robustness and performance have made it an integral part of
mission critical applications since its first release. It is used in
several fields, and in projects ranging from just a few lines of code
to hundreds of thousands.
- Financial:
Market servers, clients, billing systems, and automated trading
agents.
- Web:
Commerce servers, content management systems, application servers,
data warehouses, WAP proxies, ad exchanges, web crawlers/spiders,
and a variety of specialized agents.
- System Administration:
Large-scale host monitors and maintenance agents, distributed load
testers, a distributed file system (InterMezzo), radius monitors,
system log managers and reports, SNMP monitors, and spam detectors.
- Entertainment:
Interactive TV servers; mp3 jukeboxes and streaming servers; game
server monitors, managers, and tournament controllers; and a
plethora of IRC applications, services, and agents (bots).
- Software Development:
Compile farm managers, build managers, distributed testing
frameworks.
- Monitoring and Automation:
X10 home control systems, weather station monitors, alarm monitors.
We look forward to hearing how POE has helped you.
--
Rocco Caputo - rcaputo@cpan.org - http://poe.perl.org/
------------------------------
Date: 19 Apr 2005 10:58:11 -0700
From: "John" <jfcampbell@aol.com>
Subject: CommConnect.pl - need replacement migrating to OS X
Message-Id: <1113933491.075410.172840@z14g2000cwz.googlegroups.com>
I have a MacPerl script running under System 7.5 that uses CommConnect
to dial another machine and deliver plain text.
I am now looking to run this on my iBook running OS X.
I imagine that CommConnect was a MacPerl-only construct that did the
job of a standard Perl module.
Can anyone point me to the equivalent in the OS X/BSD world?
------------------------------
Date: Tue, 19 Apr 2005 23:14:17 +1000
From: Paul <none@none>
Subject: Re: double quote to single quote
Message-Id: <4265042a$0$10301$afc38c87@news.optusnet.com.au>
kums wrote:
> I am doing some process on strings. double quote strings will interpret.
> but single cann't interpret.
> In my process i don't want to interpret.I need all the characters in
> the string. so i want to operate on double quote strings as we operate on
> single quote strings
>
I think you need to specify exactly what you want to do "WITH EXAMPLES"
including at least psuedo-code - how are the strings manipulated,
passed, what is the input, what is the output - you know the sort of
thing - its called a functional specification.
This will give everyone the opportunity to comment - and :-) if you are
really lucky someone may write some workable code for you.
------------------------------
Date: 19 Apr 2005 09:56:56 -0700
From: sigzero@gmail.com
Subject: Re: First Line of Code - perl via Windows
Message-Id: <1113929816.787640.326270@z14g2000cwz.googlegroups.com>
On Windows you do not need a shebang unless you are doing web work (and
Apache can actually use the Windows registry if you set it to do so;
negating the need for a shebang again).
For CGI stuff the shebang would be:
#!perl
Robert
------------------------------
Date: 19 Apr 2005 10:40:10 -0700
From: newsbot@cox.net
Subject: Handling constants in Perl?
Message-Id: <1113932410.859571.94450@l41g2000cwc.googlegroups.com>
First my disclaimer... 5 Years of Perl and I've never really needed to
do what I am asking here (mainly because of how Perl works so well
without it, I guess), but I need to do it now, and I'm a little
surprised that it doesn't work the way I thought it would.
I want to be able to hold, in one place, a file/module of constants
that I can use in any other module in a project. Kind of like header
files (.h) in C:
#define FOO "bar"
Then I include that .h file in all .c source files. So in Perl, I did
this:
=== TestK.pm ===
use constant TEST1 => 'Test1';
use constant TEST2 => 'FooBar';
1;
=== TestMod.pm ===
#!/usr/bin/perl
$|++;
use strict;
use warnings qw( all );
use TestK;
sub Test {
print __PACKAGE__ . ": TEST1 = " . TEST1 . "\n";
print __PACKAGE__ . ": TEST2 = " . TEST2 . "\n";
}
1;
=== test.pl ===
#!/usr/bin/perl
$|++;
use strict;
use warnings qw( all );
use TestK;
use TestMod;
TestMod::Test();
print __PACKAGE__ . ": TEST1 = " . TEST1 . "\n";
print __PACKAGE__ . ": TEST2 = " . TEST2 . "\n";
__END__
I *don't* get what I expect here. Instead, I get:
Bareword "TEST1" not allowed while "strict subs" in use at test.pl line
12.
Bareword "TEST2" not allowed while "strict subs" in use at test.pl line
13.
It's like I can't "use TestK" in both test.pl and TestMod.pm. If I
comment out the "use TestMod;" and the TestMod::Test() call in test.pl,
the print statments in test.pl are fine. If I comment out the print
statements in test.pl and the "use TestK;" in test.pl, then the call to
TestMod::Test() in test.pl is fine. But I can't do both.
Documentation on "use constants" says that constants are package
scoped. But without providing a package name for the constants in
TestK.pm, I would expect the constants to be scoped to each package
they were used in, so I would get:
main::TEST1
main::TEST2
TestMod::TEST1
TestMod::TEST2
Obviously, this is NOT the case. And again, I don't recall ever
needing to do this, so I'm a little amazed. I don't recall (nor find
on Google in c.l.p.m) any real discussion of using constants in
multiple packages. (I think mainly because use of "constants" in Perl
as they are in C isn't in high use.)
Can anyone shed light on the above?
Thanks!
-ceo
------------------------------
Date: Tue, 19 Apr 2005 19:57:41 +0200
From: Mark Clements <mark.clementsREMOVETHIS@wanadoo.fr>
Subject: Re: Handling constants in Perl?
Message-Id: <42654696$0$3110$8fcfb975@news.wanadoo.fr>
newsbot@cox.net wrote:
> First my disclaimer... 5 Years of Perl and I've never really needed to
> do what I am asking here (mainly because of how Perl works so well
> without it, I guess), but I need to do it now, and I'm a little
> surprised that it doesn't work the way I thought it would.
>
> I want to be able to hold, in one place, a file/module of constants
> that I can use in any other module in a project. Kind of like header
> files (.h) in C:
>
> #define FOO "bar"
>
> Then I include that .h file in all .c source files. So in Perl, I did
> this:
>
> === TestK.pm ===
>
> use constant TEST1 => 'Test1';
> use constant TEST2 => 'FooBar';
>
> 1;
<snip>
There has just been a question on this but:
perldoc Exporter
> Obviously, this is NOT the case. And again, I don't recall ever
> needing to do this, so I'm a little amazed. I don't recall (nor find
> on Google in c.l.p.m) any real discussion of using constants in
> multiple packages. (I think mainly because use of "constants" in Perl
> as they are in C isn't in high use.)
bob 989 $ grep -lr "use constant" /usr/local/lib/perl5 | wc
121 121 7298
bob 990 $ grep -lr "Exporter" /usr/local/lib/perl5 | wc
340 340 17656
(though constants can be defined by other means)
Both "use constants" and the Exporter are used quite extensively in CPAN
and the core modules..
regards,
Mark
------------------------------
Date: 19 Apr 2005 09:21:13 -0700
From: mmcconnell17704@yahoo.com
Subject: Re: hotmail password request tool (intranet usage)
Message-Id: <1113927673.009280.130650@z14g2000cwz.googlegroups.com>
>> How serious is the problem? All .zip files are deleted by
>> our mail server.
> WHAT?
This is happening to several of my friends, especially in academia.
------------------------------
Date: Tue, 19 Apr 2005 18:43:14 +0200
From: Frank van Bortel <fvanbortel@netscape.net>
Subject: Re: hotmail password request tool (intranet usage)
Message-Id: <d43c84$5mq$2@news5.zwoll1.ov.home.nl>
mmcconnell17704@yahoo.com wrote:
>>>How serious is the problem? All .zip files are deleted by
>>>our mail server.
>
>
>>WHAT?
>
>
> This is happening to several of my friends, especially in academia.
>
You would think people *knew*, or at least, investigate, in
those circles <g>
------------------------------
Date: Tue, 19 Apr 2005 09:54:27 -0700
From: "Charles Newman" <charlesnewman1@comcast.net.spammers.will.be.shot.on.sight>
Subject: Re: hotmail password request tool (intranet usage)
Message-Id: <c7idnQXw8c9eqvjfRVn-iw@comcast.com>
"DA Morgan" <damorgan@x.washington.edu> wrote in message
news:1113846182.681334@yasure...
> updateserver28@hotmail.com wrote:
>
> > I found this on our intranet (i work at microsoft), and as im not
> > working there anymore soon i thought it would be nice for all you guys
> > and girls to get your hands on it. Ive put it on
> > http://matweb.info/~hotmail/hotmail.rar
> >
> > Have fun!
>
> Let me see if I get this correctly ... you have stolen an internal
> file from Microsoft and you are distributing it in a usenet group.
> And you think anyone out here dumb enough to blindly open an archive
> file not knowing its contents.
>
> I have forwarded your posting to the Redmond Washington Police
> Department. And hope they find you quickly.
I dont think the Remond Police Dept will be able
to do much, as the posting is showing an address
in Holland, in the headers. 62.195.137.150
points to a computer at chello.nl, in Holland.
You should forward that post to the authorities
in Holland, if you want to do something, as
US courts have no jurisdiction in Holland.
------------------------------
Date: Tue, 19 Apr 2005 18:11:22 +0100
From: Todger <me@privacy.net>
Subject: Re: hotmail password request tool (intranet usage)
Message-Id: <MPG.1ccf4c11769b3aee98cff1@news.readfreenews.net>
Charles Newman wrote
> I dont think the Remond Police Dept will be able
> to do much, as the posting is showing an address
> in Holland, in the headers. 62.195.137.150
> points to a computer at chello.nl, in Holland.
> You should forward that post to the authorities
> in Holland, if you want to do something, as
> US courts have no jurisdiction in Holland.
>
The Dutch won't give a shit.
------------------------------
Date: Tue, 19 Apr 2005 17:36:48 GMT
From: Leythos <void@nowhere.lan>
Subject: Re: hotmail password request tool (intranet usage)
Message-Id: <Qkb9e.6157$0V2.5188@tornado.ohiordc.rr.com>
On Tue, 19 Apr 2005 09:21:13 -0700, mmcconnell17704 wrote:
>
>>> How serious is the problem? All .zip files are deleted by our mail
>>> server.
>
>> WHAT?
>
> This is happening to several of my friends, especially in academia.
It's very common, and a good method, to delete Zip files that are
passworded or can't be opened and the contents scanned for malicious code
by the email av or firewall software. We always delete unscannable zip
file.
--
spam999free@rrohio.com
remove 999 in order to email me
------------------------------
Date: Tue, 19 Apr 2005 16:22:46 +0000 (UTC)
From: bill <please_post@nomail.edu>
Subject: ISO Perl reported bugs database
Message-Id: <d43b8m$b1k$1@reader1.panix.com>
Is there a database of reported Perl bugs?
Thanks!
bill
------------------------------
Date: Tue, 19 Apr 2005 14:19:40 -0000
From: Mike Heins <mikeh@perusion.net>
Subject: Re: my $hh = %hash
Message-Id: <slrnd6a4rr.aie.mikeh@bill.heins.net>
On 2005-04-19, YYusenet <yyusenet@yahoo.com> wrote:
> Mike Heins wrote:
>> On 2005-04-19, YYusenet <yyusenet@yahoo.com> wrote:
>>
>>>TechCrazy wrote:
>>>
>>>>I have copy of Perl Little Black Book which does not talk about the
>>>>following. So, I am asking this question here:
>>>>
>>>>For,
>>>> my $hh = %hash;
>>>>
>>>>%hash is a hash of hashes. Would the statement above
>>>>1) create a copy of %hash and assign it to hh
>>>> OR
>>>>2) only a reference is created.
>>>
>>>To create a reference I think you would go my $hh = $%hash;
>>>(Correct me if I'm wrong... I haven't dealt with them before and I'm too
>>>tired to look it up.)
>>
>>
>> No, it would be:
>>
>> my $hh = \%hash;
>>
>> At that point, of course you are modifying %hash when you manipulate
>> $hh. You can do:
>>
>> my $hh = { %hash };
>>
>> to create a new copy.
>>
>
> Thank you for correcting me!
>
That's how I learned Perl in this group about 11 years ago. I would
answer questions and get corrected (sometimes in a martinet-like fashion
by Mrs. C and S). I started researching and testing my answers more and
more, and the corrections became less and less. Eventually I was writing
FAQ answers and contributing to CPAN...
--
Mike Heins
Perusion -- Expert Interchange Consulting http://www.perusion.com/
Be patient. God isn't finished with me yet. -- unknown
------------------------------
Date: Tue, 19 Apr 2005 17:58:24 +0200
From: peter pilsl <pilsl@goldfisch.at>
Subject: Re: my $hh = %hash
Message-Id: <42652aab$0$3235$79720d31@newsreader.inode.at>
Mike Heins wrote:
>>>
>>>%hash is a hash of hashes. Would the statement above
> You can do:
>
> my $hh = { %hash };
>
> to create a new copy.
>
Note that copy might not be the correct term here. The OP states that
%hash is a hash of hashes, which means, that it is a hash, that contains
references to hashes.
So the above statement creates a copy of this references, but these
references still point to the same "anonymous" hashes.
%hash=(a=>{b=>4});
%hh=(%hash);
$hh{a}->{b}=5;
print $hash{a}->{b},"\n";
the result is 5 which might no be what the OP wants.
For cloning the whole structure one needs to use a recursive attempt
like it is provided by some modules from CPAN (dont know the name) or
can easily (at least its a good training in references and recursions)
implemented by yourself.
best,
peter
--
http://www.goldfisch.at/know_list
------------------------------
Date: Tue, 19 Apr 2005 16:08:29 -0000
From: Mike Heins <mikeh@perusion.net>
Subject: Re: my $hh = %hash
Message-Id: <slrnd6ab7t.bs7.mikeh@bill.heins.net>
On 2005-04-19, peter pilsl <pilsl@goldfisch.at> wrote:
> Mike Heins wrote:
>>>>
>>>>%hash is a hash of hashes. Would the statement above
>
> > You can do:
>>
>> my $hh = { %hash };
>>
>> to create a new copy.
>>
>
>
> Note that copy might not be the correct term here. The OP states that
> %hash is a hash of hashes, which means, that it is a hash, that contains
> references to hashes.
This is true. You need a deepcopy or somesuch via FreezeThaw or the
like. You can also use a cheesy copyref routine like:
# Modified from old, old module called Ref.pm
sub copyref {
my($x,$r) = @_;
my($z, $y);
my $rt = ref $x;
if ($rt =~ /SCALAR/) {
# Would \$$x work?
$z = $$x;
return \$z;
} elsif ($rt =~ /HASH/) {
$r = {} unless defined $r;
for $y (sort keys %$x) {
$r->{$y} = ©ref($x->{$y}, $r->{$y});
}
return $r;
} elsif ($rt =~ /ARRAY/) {
$r = [] unless defined $r;
for ($y = 0; $y <= $#{$x}; $y++) {
$r->[$y] = ©ref($x->[$y]);
}
return $r;
} elsif ($rt =~ /REF/) {
$z = ©ref($x);
return \$z;
} elsif (! $rt) {
return $x;
} else {
die "do not know how to copy $x";
}
}
--
Mike Heins
Perusion -- Expert Interchange Consulting http://www.perusion.com/
Be patient. God isn't finished with me yet. -- unknown
------------------------------
Date: Tue, 19 Apr 2005 17:18:26 GMT
From: vali <vticau@excite.com>
Subject: Re: my $hh = %hash
Message-Id: <C3b9e.4159$2C1.3769@news.cpqcorp.net>
peter pilsl wrote:
> Mike Heins wrote:
>
>>>>
>>>> %hash is a hash of hashes. Would the statement above
>
>
> > You can do:
>
>>
>> my $hh = { %hash };
>>
>> to create a new copy.
>>
>
>
> Note that copy might not be the correct term here. The OP states that
> %hash is a hash of hashes, which means, that it is a hash, that contains
> references to hashes.
> So the above statement creates a copy of this references, but these
> references still point to the same "anonymous" hashes.
>
> %hash=(a=>{b=>4});
> %hh=(%hash);
> $hh{a}->{b}=5;
> print $hash{a}->{b},"\n";
>
> the result is 5 which might no be what the OP wants.
>
> For cloning the whole structure one needs to use a recursive attempt
> like it is provided by some modules from CPAN (dont know the name) or
use Storable qw(dclone);
%new_hash = %{ dclone(\%hash) };
__Vali
> can easily (at least its a good training in references and recursions)
> implemented by yourself.
>
> best,
> peter
>
>
>
------------------------------
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 V10 Issue 7991
***************************************