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

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Beginner: Re: [Laurent_R] iterating through an array using XML::Simple: Edit Log


Oct 23, 2012, 5:31 AM

Views: 2111
Re: [Laurent_R] iterating through an array using XML::Simple

Don't use quotes marks around $i in your array subscript.

This too, but there are more problems with this (and the OP would have found out that something is wrong if he had enabled strict and warnings).

Still, I wonder, why this code did not die; maybe there is some obscure feature in Perl which I don't know yet? Consider the code snippet of the posting:


You were of course correct in mentioning, that the array index must be a number, not a string. However, the OP claimed that element 0 was always selected, and this piece of code certainly does not supply a zero.

Further, wie see that the OP uses an array slice, not an array element. How is it possible to apply the arrow operator, if the left argument is a slice (i.e. a list) instead of a scalar? Obviously it does something (instead of just terminating with an error message)....

(This post was edited by rovf on Oct 23, 2012, 5:32 AM)

Edit Log:
Post edited by rovf (Veteran) on Oct 23, 2012, 5:32 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