Y
Yakov
I find it strange in the examlpe below
1 open(my $fh, my $name="</no/such/file") ||
2 warn "Error name=$name\n";
3 print "name=$name";
that $name is not in the scope, at line 2 (in the warn() arg).
The assignment to $name in line 1 definitely already happened. So
how come $name is not known at line 2 ? Is this a feature or a bug ?
What is the explanation ? Does perl, like, wait for the semicolon to
add $name to the hashtable or variables ?
This is counterintuitive to me ... (comparing to C foo() { int x=1,
y=x; } )
Thanks
Yakov
1 open(my $fh, my $name="</no/such/file") ||
2 warn "Error name=$name\n";
3 print "name=$name";
that $name is not in the scope, at line 2 (in the warn() arg).
The assignment to $name in line 1 definitely already happened. So
how come $name is not known at line 2 ? Is this a feature or a bug ?
What is the explanation ? Does perl, like, wait for the semicolon to
add $name to the hashtable or variables ?
This is counterintuitive to me ... (comparing to C foo() { int x=1,
y=x; } )
Thanks
Yakov