in reply to List or Scalar?
Why not justfor( -5..@{$term} ) {
I think you got carried away with the specialized idiom of how to force values to be interpolated within strings, such as you used infor( -5..$term ) {
But even here you could have just saidprint "\$term is @{$term}\n";
print "\$term is $term\n";
The value @{$term} is evaluating to an undefined value, which is somehow getting converted into a value of zero. If I say
directly I get nasty warnings "Use of uninitialized value in foreach loop entry at hagen.pl line 36." Also if I use a variable with an undef value.for( -5..undef ) {
Why so?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: List or Scalar?
by hagen (Friar) on Aug 27, 2003 at 08:20 UTC |