toadi has asked for the wisdom of the Perl Monks concerning the following question:
Hello,
I have a program written bij someone else. But I can't figure one thing out :)
I print out the array so I'm sure the array has elements.
I printout $#user_geg and it prints 27.
I printout $user_geg[27] and prints it's value
Then the other guy written:
if( defined @user_geg[0..$#user_geg] ) { }
On a SunOS infratest 5.8 Generic_108528-03 sun4u sparc SUNW,Ultra-80 with This is perl, v5.6.1 built for sun4-solaris
This works...
On a SunOS fritz 5.8 Generic sun4u sparc SUNW,Ultra-1 with This is perl, v5.6.0 built for sun4-solaris
I had to write:
if( defined @user_geg[0..$#user_geg-1] ) { }
To get in the if????
Plz enlighten me!!!!!!
--
My opinions may have changed,
but not the fact that I am right
I print out the array so I'm sure the array has elements.
I printout $#user_geg and it prints 27.
I printout $user_geg[27] and prints it's value
Then the other guy written:
if( defined @user_geg[0..$#user_geg] ) { }
On a SunOS infratest 5.8 Generic_108528-03 sun4u sparc SUNW,Ultra-80 with This is perl, v5.6.1 built for sun4-solaris
This works...
On a SunOS fritz 5.8 Generic sun4u sparc SUNW,Ultra-1 with This is perl, v5.6.0 built for sun4-solaris
I had to write:
if( defined @user_geg[0..$#user_geg-1] ) { }
To get in the if????
Plz enlighten me!!!!!!
--
My opinions may have changed,
but not the fact that I am right
Edit: Added <code> tags. larsen
Back to
Seekers of Perl Wisdom