Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Fun with two-dimensional arrays

by arturo (Vicar)
on Aug 09, 2001 at 21:01 UTC ( #103500=note: print w/replies, xml ) Need Help??


in reply to Fun with two-dimensional arrays

No need to hardcode the values. You could set variables (or constants) to hold them, and put those in there. Or if you want to get even more "dynamic", you can use $#array to get the highest index of @array ($#$arrayref, btw =).

I forget which module you can use to determine these values ahead of time.

Now, I'm not *certain* of what you mean by "wrong order", but you can always do

foreach my $x (reverse @array) { #...}

as well. HTH!

update Oh, I get it now. You want to process row-by-row, you get column-by-column. Sorry bout 'dat.

perl -e 'print "How sweet does a rose smell? "; chomp ($n = <STDIN>); +$rose = "smells sweet to degree $n"; *other_name = *rose; print "$oth +er_name\n"'

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://103500]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (13)
As of 2019-07-23 14:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If you were the first to set foot on the Moon, what would be your epigram?






    Results (27 votes). Check out past polls.

    Notices?