in reply to How does my work with a trailing conditional
Doesn't make much sense -- should just use the '=' operator instead of the '.=' operator, since there's nothing to append to since you're only just now declaring the variable. (Usage is fine in the last example) Maybe that's the problem since it's essentially doing something like this?my $string .= 'appended stuff' if ($conditional1);
my $string = $string . 'appended stuff' if ($conditional1); #which is basically (or is it not and that's the problem?): my $string = undef . 'appended stuff' if ($conditional1);
my $conditional1 = 0; my $string = 'blah' if $conditional1; # $string is undef
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How does my work with a trailing conditional
by basje (Beadle) on Apr 22, 2005 at 14:17 UTC |