Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Fun with two-dimensional arrays

by arturo (Vicar)
on Aug 09, 2001 at 21:01 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://103500]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-03-29 15:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found