Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: How to make this code more flexible

by DanielM0412 (Acolyte)
on Jul 21, 2011 at 21:14 UTC ( [id://915998]=note: print w/replies, xml ) Need Help??


in reply to Re: How to make this code more flexible
in thread How to make this code more flexible

why print out the first row third column?? (i had an error in that line) and will this work if you dont specify the dimensions to be 5 by 7? cuz thats wat im going for,

Replies are listed 'Best First'.
Re^3: How to make this code more flexible
by Sandy (Curate) on Jul 21, 2011 at 22:11 UTC
    Why'd I print the first row, third column? I was just demonstrating. It worked for me when I tested it, so I don't know why it does not work for you. Note that I changed the return from a hash to an array.

    The whole idea is that you specify the matrix size in the call to the sub.

    So, you are just learning? Play with the code a bit to see what happens. That's one of the best ways to learn.

      okay, and the data dumper shows nothing but "undefined"
        My code gives exactly the following.
        perl tst.pl $VAR1 = [ [ '11', '12', '13', '14', '15', '16', '17' ], [ '21', '22', '23', '24', '25', '26', '27' ], [ '31', '32', '33', '34', '35', '36', '37' ], [ '41', '42', '43', '44', '45', '46', '47' ], [ '51', '52', '53', '54', '55', '56', '57' ] ]; 1st row, 3rd column: 13
        You need to compare carefully the differences between what I wrote, and what you wrote.

        Are you calling the function with three parameters?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (6)
As of 2024-03-28 09:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found