[31218] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 2463 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Jun 7 21:09:46 2009

Date: Sun, 7 Jun 2009 18:09:10 -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           Sun, 7 Jun 2009     Volume: 11 Number: 2463

Today's topics:
        Compiling to binary <verpory@hotmail.com>
    Re: Compiling to binary <RedGrittyBrick@SpamWeary.foo>
        Constructing a scalar reference <invalid@invalid.invalid>
    Re: Constructing a scalar reference <tadmc@seesig.invalid>
    Re: Constructing a scalar reference <kst-u@mib.org>
    Re: FAQ 0.00 Does it cost my program more if I use "use jidanni@jidanni.org
    Re: FAQ 0.00 Does it cost my program more if I use "use <willem@snail.stack.nl>
    Re: FAQ 0.00 Does it cost my program more if I use "use <tadmc@seesig.invalid>
    Re: FAQ 4.59 How can I know how many entries are in a h jidanni@jidanni.org
    Re: FAQ 4.59 How can I know how many entries are in a h <willem@snail.stack.nl>
        Luxuriescars oubaid.98@gmail.com
        new CPAN modules on Sun Jun  7 2009 (Randal Schwartz)
        nntp.perl.org vs <Message-ID> jidanni@jidanni.org
        Overview Of New Intel Core i7(Nehalem) Processor <whatnextur@gmail.com>
    Re: perl-quote.el v.1 <user42@zip.downwithspam.com.au>
    Re: Simple array iteration not working? <no.email@please.post>
    Re: Simple array iteration not working? sln@netherlands.com
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Sun, 07 Jun 2009 12:13:30 +0000
From: verpory <verpory@hotmail.com>
Subject: Compiling to binary
Message-Id: <Xns9C2353AD269CAverpory@74.209.131.13>

Is there some sort of module or something to compile *.pl files to Linux 
binaries? I want to be able to distribute my perl scripts without people 
being abl to edit them.


------------------------------

Date: Sun, 07 Jun 2009 19:29:53 +0100
From: RedGrittyBrick <RedGrittyBrick@SpamWeary.foo>
Subject: Re: Compiling to binary
Message-Id: <_ZKdna2srPK6mrHXnZ2dnUVZ8l-dnZ2d@bt.com>

verpory wrote:
> Is there some sort of module or something to compile *.pl files to Linux 
> binaries? I want to be able to distribute my perl scripts without people 
> being abl to edit them.

That is a Frequently Asked Question

The standard answer is here: `perldoc -q "compile my perl"`.


-- 
RGB


------------------------------

Date: Sun, 07 Jun 2009 21:42:56 +0100
From: Chet Butcher <invalid@invalid.invalid>
Subject: Constructing a scalar reference
Message-Id: <h0h8oq$mq0$4@aioe.org>

Hi

In the following sequence

$r = {}; # a hashref
$r = []; # an arrayref
$r = ?; # a scalar ref

What is ? ? I want to pass a ref to a scalar (pass by reference)
without resorting to

  my $r;
  mySub( \$r );

I just want to use

  my $r = (something);
  mySub( $r );

to be consistent with

  my $r = {}; # or  my $r = [];
  mySub( $r );

I know it's not a big drama on the surface, but I'm trying to overload
the method to return various results depending on the reference type,
and I dont want the \ in some calls and not others. 

Thanks



------------------------------

Date: Sun, 7 Jun 2009 17:16:36 -0500
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: Constructing a scalar reference
Message-Id: <slrnh2of24.j76.tadmc@tadmc30.sbcglobal.net>

Chet Butcher <invalid@invalid.invalid> wrote:

> In the following sequence
>
> $r = {}; # a hashref
> $r = []; # an arrayref
> $r = ?; # a scalar ref
>
> What is ? ?


Troll alert!

This was posted here in August 2006 and again last January...


-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"


------------------------------

Date: Sun, 07 Jun 2009 15:38:02 -0700
From: Keith Thompson <kst-u@mib.org>
Subject: Re: Constructing a scalar reference
Message-Id: <lnbpozu0tx.fsf@nuthaus.mib.org>

Chet Butcher <invalid@invalid.invalid> writes:
> In the following sequence
>
> $r = {}; # a hashref
> $r = []; # an arrayref
> $r = ?; # a scalar ref
>
> What is ? ? I want to pass a ref to a scalar (pass by reference)
> without resorting to
>
>   my $r;
>   mySub( \$r );
>
> I just want to use
>
>   my $r = (something);
>   mySub( $r );
>
> to be consistent with
>
>   my $r = {}; # or  my $r = [];
>   mySub( $r );
>
> I know it's not a big drama on the surface, but I'm trying to overload
> the method to return various results depending on the reference type,
> and I dont want the \ in some calls and not others. 

Why did you redirect followups to comp.lang.c?

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
Nokia
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"


------------------------------

Date: Mon, 08 Jun 2009 03:35:47 +0800
From: jidanni@jidanni.org
Subject: Re: FAQ 0.00 Does it cost my program more if I use "use" in a loop?
Message-Id: <87tz2rkfak.fsf@jidanni.org>

Let's work on a new FAQ:
Q: Does it cost my program more if I use "use" in a loop or subroutine?
A: Apart from the fact that some uses of "use" have a lexical effect (and
hence, moving them out of the block can change the meaning of the
program), the fact is that there's no significant efficiency difference
where you place your "use". Hence you can put it

use Data::Dumper; #here, neatly grouped together with other "use"s at
#the top of your program.
while(...){
         use Data::Dumper; #Or instead here, grouped with the call that
         print Dumper($foo, $bar); #uses it. More suited to temporary
         #code you want to manage in one piece.
}


------------------------------

Date: Sun, 7 Jun 2009 19:39:41 +0000 (UTC)
From: Willem <willem@snail.stack.nl>
Subject: Re: FAQ 0.00 Does it cost my program more if I use "use" in a loop?
Message-Id: <slrnh2o5rt.295c.willem@snail.stack.nl>

jidanni@jidanni.org wrote:
) Let's work on a new FAQ:

Do you know what the acronym FAQ stands for ?


SaSW, Willem
-- 
Disclaimer: I am in no way responsible for any of the statements
            made in the above text. For all I know I might be
            drugged or something..
            No I'm not paranoid. You all think I'm paranoid, don't you !
#EOT


------------------------------

Date: Sun, 7 Jun 2009 16:55:30 -0500
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: FAQ 0.00 Does it cost my program more if I use "use" in a loop?
Message-Id: <slrnh2odqi.j76.tadmc@tadmc30.sbcglobal.net>

Willem <willem@snail.stack.nl> wrote:
> jidanni@jidanni.org wrote:
> ) Let's work on a new FAQ:
>
> Do you know what the acronym FAQ stands for ?


Let's work on a new TIJFOATIWIHKAE:

Things I Just Found Out About That I Wish I Had Known About Earlier.


And if you read the obvious docs (perldoc -f use & perldoc -f require),
carefully, then you already know the answer:

    No, because require demands that a library file be included 
    if it hasn't already been included.
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"


------------------------------

Date: Mon, 08 Jun 2009 03:21:46 +0800
From: jidanni@jidanni.org
To: brian@stonehenge.com
Subject: Re: FAQ 4.59 How can I know how many entries are in a hash?
Message-Id: <87ws7nkfxx.fsf@jidanni.org>

PerlFAQ Server <brian@stonehenge.com> writes:
> 4.59: How can I know how many entries are in a hash?
>
>     If you mean how many keys, then all you have to do is use the keys()
>     function in a scalar context:
>
>         $num_keys = keys %hash;
>
>     The keys() function also resets the iterator, which means that you may
>     see strange results if you use this between uses of other hash operators
>     such as each().

Please add:

If you mean ALL the entries, even recursively, then try e.g.,

use Data::Walk; #from CPAN
my $count = 0;
walkdepth( sub {$count++;}, %HoH );
print "count=$count\n";


------------------------------

Date: Sun, 7 Jun 2009 19:36:17 +0000 (UTC)
From: Willem <willem@snail.stack.nl>
Subject: Re: FAQ 4.59 How can I know how many entries are in a hash?
Message-Id: <slrnh2o5lh.28vp.willem@snail.stack.nl>

jidanni@jidanni.org wrote:
) PerlFAQ Server <brian@stonehenge.com> writes:
)> 4.59: How can I know how many entries are in a hash?
)>
)>     If you mean how many keys, then all you have to do is use the keys()
)>     function in a scalar context:
)>
)>         $num_keys = keys %hash;
)>
)>     The keys() function also resets the iterator, which means that you may
)>     see strange results if you use this between uses of other hash operators
)>     such as each().
)
) Please add:
)
) If you mean ALL the entries, even recursively, then try e.g.,
)
) use Data::Walk; #from CPAN
) my $count = 0;
) walkdepth( sub {$count++;}, %HoH );
) print "count=$count\n";

There's nothing F about the A-ing of that Q.


SaSW, Willem
-- 
Disclaimer: I am in no way responsible for any of the statements
            made in the above text. For all I know I might be
            drugged or something..
            No I'm not paranoid. You all think I'm paranoid, don't you !
#EOT


------------------------------

Date: Sat, 6 Jun 2009 23:23:34 -0700 (PDT)
From: oubaid.98@gmail.com
Subject: Luxuriescars
Message-Id: <90143fe5-0560-4b75-9215-8ecb8560276d@a36g2000yqc.googlegroups.com>

Do you want to know about luxuries cars? i think it is easy to you
people to get information about luxuries cars.
for more info visit
www.oubaidluxuriescars.blogspot.com


------------------------------

Date: Sun, 7 Jun 2009 04:42:28 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Sun Jun  7 2009
Message-Id: <KKuqEt.9sJ@zorch.sf-bay.org>

The following modules have recently been added to or updated in the
Comprehensive Perl Archive Network (CPAN).  You can install them using the
instructions in the 'perlmodinstall' page included with your Perl
distribution.

App-CPAN2Pkg-1.1.0
http://search.cpan.org/~jquelin/App-CPAN2Pkg-1.1.0/
generating native linux packages from cpan 
----
Audio-Ecasound-Multitrack-0.9974
http://search.cpan.org/~ganglion/Audio-Ecasound-Multitrack-0.9974/
Perl extensions for multitrack audio processing 
----
BerkeleyDB-0.39
http://search.cpan.org/~pmqs/BerkeleyDB-0.39/
Perl extension for Berkeley DB version 2, 3 or 4 
----
CGI-Inspect-0.4
http://search.cpan.org/~awwaiid/CGI-Inspect-0.4/
Inspect and debug CGI apps with an in-browser UI 
----
CPAN-Testers-WWW-Reports-Mailer-0.17
http://search.cpan.org/~barbie/CPAN-Testers-WWW-Reports-Mailer-0.17/
CPAN Testers Reports Mailer 
----
CPAN-Testers-WWW-Statistics-0.64
http://search.cpan.org/~barbie/CPAN-Testers-WWW-Statistics-0.64/
CPAN Testers Statistics website. 
----
CPAN-Testers-WWW-Statistics-0.65
http://search.cpan.org/~barbie/CPAN-Testers-WWW-Statistics-0.65/
CPAN Testers Statistics website. 
----
Catalyst-Controller-SOAP-1.17
http://search.cpan.org/~druoso/Catalyst-Controller-SOAP-1.17/
Catalyst SOAP Controller 
----
Catalyst-Engine-Stomp-0.05
http://search.cpan.org/~bobtfish/Catalyst-Engine-Stomp-0.05/
write message handling apps with Catalyst. 
----
Catalyst-Plugin-Authentication-0.10012
http://search.cpan.org/~bobtfish/Catalyst-Plugin-Authentication-0.10012/
Infrastructure plugin for the Catalyst authentication framework. 
----
Catalyst-Runtime-5.80005
http://search.cpan.org/~mramberg/Catalyst-Runtime-5.80005/
The Catalyst Framework Runtime 
----
Class-MOP-0.85
http://search.cpan.org/~drolsky/Class-MOP-0.85/
A Meta Object Protocol for Perl 5 
----
Continuity-1.01
http://search.cpan.org/~awwaiid/Continuity-1.01/
Abstract away statelessness of HTTP, for stateful Web applications 
----
Crypt-RSA-1.99
http://search.cpan.org/~vipul/Crypt-RSA-1.99/
RSA public-key cryptosystem. 
----
DBI-1.608_90
http://search.cpan.org/~timb/DBI-1.608_90/
Database independent interface for Perl 
----
Data-Dumper-2.121_20
http://search.cpan.org/~smueller/Data-Dumper-2.121_20/
stringified perl data structures, suitable for both printing and eval 
----
Data-Pageset-Render-0.14
http://search.cpan.org/~mgrimes/Data-Pageset-Render-0.14/
Subclass of Data::Pageset that generates html, text, etc. for page navigation 
----
DateTime-Format-Natural-0.76_02
http://search.cpan.org/~schubiger/DateTime-Format-Natural-0.76_02/
Create machine readable date/time with natural parsing logic 
----
Email-MIME-Kit-Assembler-Markdown-0.091560
http://search.cpan.org/~rjbs/Email-MIME-Kit-Assembler-Markdown-0.091560/
build multipart/alternative messages from Markdown alone 
----
Email-Sender-0.091560_002
http://search.cpan.org/~rjbs/Email-Sender-0.091560_002/
a library for sending email 
----
Enbugger-2.007
http://search.cpan.org/~whitepage/Enbugger-2.007/
Enables the debugger at runtime. 
----
File-List-Object-0.187
http://search.cpan.org/~csjewell/File-List-Object-0.187/
Object containing a list of files (filelist, packlist). 
----
HTML-Template-Compiled-Filter-Whitespace-0.08
http://search.cpan.org/~steffenw/HTML-Template-Compiled-Filter-Whitespace-0.08/
whitespace filter for HTML output 
----
HTML-TurboForm-0.45
http://search.cpan.org/~camelcase/HTML-TurboForm-0.45/
----
HTTP-Engine-FirePHP-0.01
http://search.cpan.org/~marcel/HTTP-Engine-FirePHP-0.01/
Log to FirePHP from within HTTP::Engine 
----
Hash-FieldHash-0.07
http://search.cpan.org/~gfuji/Hash-FieldHash-0.07/
A lightweight field hash implementation 
----
Language-Prolog-Yaswi-0.17
http://search.cpan.org/~salva/Language-Prolog-Yaswi-0.17/
Yet another interface to SWI-Prolog 
----
List-Analyse-Sequence-0.01
http://search.cpan.org/~altreus/List-Analyse-Sequence-0.01/
Analyse a list for sequences. 
----
List-Analyse-Sequence-Analyser-OL-RomanNumerals-0.01
http://search.cpan.org/~altreus/List-Analyse-Sequence-Analyser-OL-RomanNumerals-0.01/
Find Roman numeral sequences. 
----
Locale-Maketext-TieHash-L10N-0.12
http://search.cpan.org/~steffenw/Locale-Maketext-TieHash-L10N-0.12/
Tying language handle to a hash 
----
Log-Handler-0.56
http://search.cpan.org/~bloonix/Log-Handler-0.56/
Log messages to several outputs. 
----
Moose-0.80
http://search.cpan.org/~drolsky/Moose-0.80/
A postmodern object system for Perl 5 
----
MooseX-MethodAttributes-0.14
http://search.cpan.org/~bobtfish/MooseX-MethodAttributes-0.14/
code attribute introspection 
----
Net-Amazon-0.51
http://search.cpan.org/~boumenot/Net-Amazon-0.51/
Framework for accessing amazon.com via REST 
----
Net-Appliance-Frontpanel-0.01
http://search.cpan.org/~oliver/Net-Appliance-Frontpanel-0.01/
Images of network devices with clickable HTML imagemaps 
----
Net-Libproxy-0.01
http://search.cpan.org/~goneri/Net-Libproxy-0.01/
Perl binding for libproxy ( http://code.google.com/p/libproxy/ ) 
----
Net-SSH2-0.21
http://search.cpan.org/~rkitover/Net-SSH2-0.21/
Support for the SSH 2 protocol via libssh2. 
----
Net-Twitter-3.00004
http://search.cpan.org/~mmims/Net-Twitter-3.00004/
A perl interface to the Twitter API 
----
Net-Twitter-Lite-0.01000
http://search.cpan.org/~mmims/Net-Twitter-Lite-0.01000/
A perl interface to the Twitter API 
----
Net-Twitter-Lite-0.01001
http://search.cpan.org/~mmims/Net-Twitter-Lite-0.01001/
A perl interface to the Twitter API 
----
Object-Simple-1.0001
http://search.cpan.org/~kimoto/Object-Simple-1.0001/
Light Weight Minimal Object System 
----
Object-Simple-1.0002
http://search.cpan.org/~kimoto/Object-Simple-1.0002/
Light Weight Minimal Object System 
----
Object-Simple-1.0003
http://search.cpan.org/~kimoto/Object-Simple-1.0003/
Light Weight Minimal Object System 
----
POE-Component-SmokeBox-Uploads-CPAN-Mini-1.00
http://search.cpan.org/~bingos/POE-Component-SmokeBox-Uploads-CPAN-Mini-1.00/
Obtain uploaded CPAN modules via a CPAN::Mini mirror 
----
Parse-Constructor-Arguments-0.091570
http://search.cpan.org/~nperez/Parse-Constructor-Arguments-0.091570/
Parse Moose constructor arguments using PPI 
----
PerlIO-Util-0.70
http://search.cpan.org/~gfuji/PerlIO-Util-0.70/
A selection of general PerlIO utilities 
----
PerlMagick-6.53
http://search.cpan.org/~jcristy/PerlMagick-6.53/
----
PerlMagick-6.54
http://search.cpan.org/~jcristy/PerlMagick-6.54/
----
Rose-DBx-Garden-Catalyst-0.14
http://search.cpan.org/~karman/Rose-DBx-Garden-Catalyst-0.14/
plant Roses in your Catalyst garden 
----
Scalar-Alias-0.05
http://search.cpan.org/~gfuji/Scalar-Alias-0.05/
Perl extention to declare lexical scalar aliases 
----
Validator-Custom-0.0203
http://search.cpan.org/~kimoto/Validator-Custom-0.0203/
Custom validator 
----
Versionify-Dispatch-0.0.1
http://search.cpan.org/~cebjyre/Versionify-Dispatch-0.0.1/
A function dispatcher that respects versions, with fallback. 


If you're an author of one of these modules, please submit a detailed
announcement to comp.lang.perl.announce, and we'll pass it along.

This message was generated by a Perl program described in my Linux
Magazine column, which can be found on-line (along with more than
200 other freely available past column articles) at
  http://www.stonehenge.com/merlyn/LinuxMag/col82.html

print "Just another Perl hacker," # the original

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion


------------------------------

Date: Mon, 08 Jun 2009 04:02:23 +0800
From: jidanni@jidanni.org
Subject: nntp.perl.org vs <Message-ID>
Message-Id: <87hbyrke28.fsf_-_@jidanni.org>

Alas, nntp.perl.org does not support getting articles by <Message-ID>. Try e.g.,
use Net::NNTP;
for (qw/news.gmane.org nntp.perl.org/) {
    my $nntp = Net::NNTP->new( $_, Debug => 1 );
    $nntp->head('<934f64a20906041932o258d27f4k50e61dbe33005a9a@mail.gmail.com>');
}
According to http://tools.ietf.org/html/rfc3977 If such non support was
intentional, they should return "503 feature not supported" I suppose.


------------------------------

Date: Sat, 6 Jun 2009 19:18:00 -0700 (PDT)
From: "whatnext@gmail.com" <whatnextur@gmail.com>
Subject: Overview Of New Intel Core i7(Nehalem) Processor
Message-Id: <4953244e-a0f7-4907-8c72-6f072b8d22b9@t21g2000yqi.googlegroups.com>

Before entering on the details about the architectural features
present on the Nehalem CPUs, let=92s make a summary of the base elements
that are common to the many different versions: server, desktop and
notebook. It=92s worth noticing how the new architecture engineering
process used by Intel aims at obtaining CPUs that can be used in all
three sectors, by simply slightly changing architecture and CPU
characteristics to better adapt to each of the sectors.

for more info visit  http://www.intel-intel99.blogspot.com


------------------------------

Date: Sun, 07 Jun 2009 11:54:20 +1000
From: Kevin Ryde <user42@zip.downwithspam.com.au>
Subject: Re: perl-quote.el v.1
Message-Id: <87d49g7qr7.fsf@blah.blah>

Ilya Zakharevich <nospam-abuse@ilyaz.org> writes:
>
> I would find the opposite conversion more often useful...

It's there too :).  Incidentally even when there's no backslashing to
de-mangle I quite like having the two quotes changed in one keystroke.

>> Parens are added for __ and N__ because __'' doesn't work, a
>> quote there is the old-style package name separator, it must be
>> __('').
>
> Do not know: would not SPACE (instead of parens) be a better alternative?

Personal preference no doubt :).  When I started it I think I found
parens clearer, and I don't think I knew __ was prototyped.  N__ might
be prototyped only in the next upcoming Locale::TextDomain, which could
be a compatibility consideration if still using an older one.


------------------------------

Date: Sun, 7 Jun 2009 15:35:40 +0000 (UTC)
From: kj <no.email@please.post>
Subject: Re: Simple array iteration not working?
Message-Id: <h0gmob$6fd$1@reader1.panix.com>

In <264767b6-b925-463a-86f4-e52e1aa145c8@s16g2000vbp.googlegroups.com> brian.haines@gmail.com writes:

>This code:

>	my @sref = @{$softwareListRef};
>	print Dumper(@sref);

>	for (my $i = 0; $i<@sref ; $i++) {
>		my $sn = $sref[$i];
>		print Dumper($sn);

>Generates this output:

>$VAR1 = [
>          'autoTestSoftware001',
>          'autoTestSoftware050'
>        ];
>$VAR1 = [
>          'autoTestSoftware001',
>          'autoTestSoftware050'
>        ];

>Note that the array @sref is properly de-referenced and printed. Then,
>inexplicably, the array item is selected by index and when printed, is
>equal to the original array. Foreach does the same thing. What's going
>on?


I'm not sure what you expect.  In your code, @sref is an array
containing *exactly one element* that happens to be an arrayref,
pointing to an array of two elements.  As far as Dumper is concerned,
Dumper(@sref) is no different from Dumper($sref[0]).

Put this right before the code you showed:

  $softwareListRef = $softwareListRef->[0];

and see if the resulting code behaves more along the lines of what
you want.  If so, this means that the way you are constructing
$softwareListRef is incorrect (you have one extra level of
referencing).

kj



-- 


------------------------------

Date: Sun, 07 Jun 2009 11:47:35 -0700
From: sln@netherlands.com
Subject: Re: Simple array iteration not working?
Message-Id: <tq1o25p2goarhb4lv1i3mgk2c247ci3pbr@4ax.com>

On Sat, 6 Jun 2009 12:00:54 -0700 (PDT), brian.haines@gmail.com wrote:

>This code:
>
>	my @sref = @{$softwareListRef};
>	print Dumper(@sref);
>
>	for (my $i = 0; $i<@sref ; $i++) {
>		my $sn = $sref[$i];
>		print Dumper($sn);
>
>Generates this output:
>
>$VAR1 = [
>          'autoTestSoftware001',
>          'autoTestSoftware050'
>        ];
>$VAR1 = [
>          'autoTestSoftware001',
>          'autoTestSoftware050'
>        ];
>
>Note that the array @sref is properly de-referenced and printed. Then,
>inexplicably, the array item is selected by index and when printed, is
>equal to the original array. Foreach does the same thing. What's going
>on?

This is right, @sref contains a single ref to 
 [
    'autoTestSoftware001',
    'autoTestSoftware050'
 ]
then dumped, then dumped again in the for loop, thats why VAR1,VAR1..
Below is using a ref to a double element array of ref's:

use strict;
use warnings;
use Data::Dumper;

my @ar1 = ('autoTestSoftware001','autoTestSoftware050');
my @ar2 = ('autoTestSoftware051','autoTestSoftware100');
my $softwareListRef = [\(@ar1, @ar2)];

# same as:
# my $softwareListRef = [
#   ['autoTestSoftware001','autoTestSoftware050'],
#   ['autoTestSoftware051','autoTestSoftware100'],
# ];

my @sref = @{$softwareListRef};
print Dumper(@sref);

for my $sn (@sref) {
	print Dumper($sn); 
}

__END__

$VAR1 = [
          'autoTestSoftware001',
          'autoTestSoftware050'
        ];
$VAR2 = [
          'autoTestSoftware051',
          'autoTestSoftware100'
        ];
$VAR1 = [
          'autoTestSoftware001',
          'autoTestSoftware050'
        ];
$VAR1 = [
          'autoTestSoftware051',
          'autoTestSoftware100'
        ];

-sln


------------------------------

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 2463
***************************************


home help back first fref pref prev next nref lref last post