CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner: Re: [Alaskan5] Array question: Edit Log



Laurent_R
Veteran / Moderator

Jun 10, 2013, 11:54 AM


Views: 652
Re: [Alaskan5] Array question

Just a very small stupid error on my part.

Change the relevant line to:


Code
print "$values[$row][$col] \n";


(No space between $value and the subscript)

and it should output:


Code
$ perl get_row.pl 
6
5
13
35
9
6
65
255
54


The basic idea is that, interpolated within a string, you should not leave an extra space between the name of the array and the subscript. If you leave a space, Perl does not know that is it supposed to interpolate "$values [$row][$col]" as an array of arrays. Without the space, it works.


(This post was edited by Laurent_R on Jun 10, 2013, 11:56 AM)


Edit Log:
Post edited by Laurent_R (Veteran) on Jun 10, 2013, 11:56 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives