P is for Practical | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
In the absence of further info, I'd have to suspect a bad build then. Looking at this further, I am a bit confused as to what the if line does anyway. When I saw it, I thought it was a smart way to test all the values in @user_geg for definedness, but I just ran the following script:
But as you can see, the only value being tested is the last value. Which makes sense as an array slice is just a list, and a list in a scalar context is just its last value. Which means that the test is equivalent to if ( $user_geg[$#user_geg] ) {...} That means that your change to $#user_geg-1 is testing the last but one value, which strongly suggests that the last value is undefined? My only suggestion is to preceed the if with print defined $user_geg[27]; and see what you get? But if you are seeing output from print $user_geg[27];, it should be defined! Sorry I can't suggest better. Well It's better than the Abottoire, but Yorkshire! In reply to Re: Re: Re: defined array question
by BrowserUk
|
|