perl5.10

Where are some good resources for learning the new features of Perl 5.10?

Hi! I didn't realize until recently that Perl 5.10 had significant new features and I was wondering if anyone could give me some good resources for learning about those. I searched for them on Google and all I found was some slides and a quick overview. Some of the features (to me at least) would be nice if they had more explanation. ...

Did Perl 5.10 mess something up with prototypes?

I know this type of thing I want to do used to work in 5.8. Am I doing something wrong? Is there a way to get back there in Perl 5.10? Here's the module: package TableMod; use base qw<Exporter>; our @EXPORT_OK = qw<mod_table>; use Data::Dumper; sub mod_table (\%@) { print Dumper( @_ ); } 1; And here is the script: use strict; use ...

Help troubleshoot a consistently repeatable mod_perl2 / $SIG{__DIE__} bug

This is mod_perl2 on Apache 2.2, ActiveState Perl 5.10 for win32. I override $SIG{__DIE__} and turn on DBI's RaiseError flag, which AFAICT from the docs, should call my override when a database call fails. It seems to almost always, except in one case, and I can't understand why. My script has an our $page variable, and being mod_perl...

Can a value be uninitialized, but still defined, in Perl?

Running ActiveState Perl 5.10.1 on win32. How is it that this code: die(defined($r->unparsed_uri =~ '/(logout.pl)?$')); ...dies with 1, whereas changing the same line to say this: die($r->unparsed_uri =~ '/(logout.pl)?$'); ...dies with Use of uninitialized value in die? How is it defined yet uninitialized? I thought uninitialize...

Perl IO modules possibly causing issues in Net::DNS module

Hi! I’m porting some software that I wrote for a White Russian OpenWRT system to a new Kamikaze 8.09.1 OpenWRT system but I am having some serious issues that I’m hoping you can help me with. Old system Linux kernel 2.4.34 MIPSEL arch Perl 5.8.7 Net::DNS 0.48 IO 1.21 IO::Socket 1.28 IO::Socket::INET 1.28 New system Linux kernel 2.6.26...

Why doesn't Perl file glob() work outside of a loop in scalar context?

According to the Perl documentation on file globbing, the <*> operator or glob() function, when used in a scalar context, should iterate through the list of files matching the specified pattern, returning the next file name each time it is called or undef when there are no more files. But, the iterating process only seems to work from ...

Can I make sure Perl code written on 5.10+ will run on 5.8?

Some of the new features of Perl 5.10 and 5.12, such as "say", are defined as features, that you can enable or disallow explicitly using the "feature" pragma. But other additions, like the named capture groups of regexes, are implicit. When I write Perl using a 5.10+ interpreter, but want it to also run on 5.8, can I make Perl complain ...

The good, the bad, and the ugly of lexical $_ in Perl 5.10+

Starting in Perl 5.10, it is now possible to lexically scope the context variable $_, either explicitly as my $_; or in a given / when construct. Has anyone found good uses of the lexical $_? Does it make any constructs simpler / safer / faster? What about situations that it makes more complicated? Has the lexical $_ introduced any b...

How does O=Deparse work, and does Perl have and fold constant arrays?

I'm wondering, does -MO=Deparse show you all of the Perl optimizations, and why doesn't this get folded in Perl 5.10? $ perl -MO=Deparse -e'[qw/foo bar baz/]->[0]' ['foo', 'bar', 'baz']->[0]; -e syntax OK Some on IRC thought that O=Deparse might not be showing it all, but it certainly shows some constant folding. $ perl -MO=Deparse -...