Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: Array of array

by wfsp (Abbot)
on Jun 04, 2009 at 13:00 UTC ( #768422=note: print w/replies, xml ) Need Help??


in reply to Re: Array of array
in thread Array of array

...sorry for the repetition.
There's no need to be sorry. I like to see a few versions of a solution. I often pick up handy techniques comparing different approaches.

A minor nit though, your snippet won't compile throws a warning under strict and warnings. This is a bit better.

#!/usr/bin/perl use warnings; use strict; use Data::Dumper; my @arr1 = qw{one two three}; my @arr2 = qw{four five six}; my @mainarr; push @mainarr, \@arr1, \@arr2; #print Dumper @mainarr->[1]; # <- line 12 #Using an array as a reference is deprecated at C:\perm\monk.pl line 1 +2. #C:\perm\monk.pl syntax OK print Dumper $mainarr[1]; __DATA__ $VAR1 = [ 'four', 'five', 'six' ];

My motto: "Test it _before_ you post it." :-)

update: it does compile ("syntax OK") but it throws a warning

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://768422]
help
Chatterbox?
[Tanktalus]: SwaJime: wouldn't status & status < 13 be true if status was 0?
[SwaJime]: I thought 0 was false, and false AND anything would be false ...
[SwaJime]: unless & is higher precedence than <
[SwaJime]: couldn't find bitwise in precedence list for sybase
[SwaJime]: I bet that is why ... and that makes it to be I think terribly written code :-|

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (8)
As of 2017-08-22 18:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Who is your favorite scientist and why?



























    Results (338 votes). Check out past polls.

    Notices?