Gunnar Hjalmarsson <mailto:[EMAIL PROTECTED]> wrote:

: Siegfried Heintze wrote:
 
: : It produces this output:
: : 
: : len = 5
: :  v=
: :  v=
: :  v=5
: :  v=
: :  v=
: :  v=34
: 
: No, it doesn't. It produces a fatal error.

    I got four warnings:

Use of uninitialized value in print at aa.pl line 20.
Use of uninitialized value in print at aa.pl line 20.
Use of uninitialized value in print at aa.pl line 20.
Use of uninitialized value in print at aa.pl line 20.
len = 5
 v=
 v=
 v=5
 v=
 v=
 v=34


: - Copy and paste code that you post, do not retype it!
: 
: - Enable warnings in your program!
: 
: : How do I modify the program so it only produces this
: : output:
: : 
: : len = 5
: :  v[2]=5
: :  v[5]=34
: 
: That output wouldn't be correct, since the array contains
: six elements, not five.
: 
: This code:
: 
:      my $ref = $me->{verd_result}->[0];
:      print "len = " . @$ref, "\n";
:      for ( 0 .. $#$ref ) {
:          defined $ref->[$_] and print " v[$_]=$ref->[$_]\n";   
: } 
: 
: outputs:
: len = 6
:   v[2]=5
:   v[5]=34


    You are not answering the question:

print
q~len = 5
 v[2]=5
 v[5]=34~;

    Sorry, I know its not helpful. I just couldn't
resist. :)


Charles K. Clarkson
-- 
Mobile Homes Specialist
254 968-8328







-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to