DeaconBlues has asked for the wisdom of the Perl Monks concerning the following question:
Hello,
I have run into a problem with 'my' and some bad code. I would like to know how Perl handles this situation.
The code looks something like this:
sub foo { my $string .= 'appended stuff' if ($conditional1); $string .= 'more appended stuff' if ($conditional2); }
The code does not fail syntax checking. Under mod perl (Apache::Registry) I am getting shared memory issues across daemons.
If $conditional1 is false:
This works fine, btw.
sub foo { my $string = ''; $string .= 'appended stuff' if ($conditional1); $string .= 'more appended stuff' if ($conditional2); }
Thanks for any help.
s/pre/code/g - dvergin 2005-04-24
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How does my work with a trailing conditional
by ikegami (Patriarch) on Apr 21, 2005 at 16:19 UTC | |
|
Re: How does my work with a trailing conditional
by dragonchild (Archbishop) on Apr 21, 2005 at 16:31 UTC | |
by dave_the_m (Monsignor) on Apr 21, 2005 at 19:03 UTC | |
|
Re: How does my work with a trailing conditional
by jdhedden (Deacon) on Apr 21, 2005 at 19:14 UTC | |
|
Re: How does my work with a trailing conditional
by davidrw (Prior) on Apr 21, 2005 at 16:18 UTC | |
by basje (Beadle) on Apr 22, 2005 at 14:17 UTC |