in reply to How does my work with a trailing conditional

I don't see how it would affect your shared memory problems at all, but note that:
my $string .= 'appended stuff' if ($conditional1);
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 = $string . 'appended stuff' if ($conditional1); #which is basically (or is it not and that's the problem?): my $string = undef . 'appended stuff' if ($conditional1);

To answer your 2) & 3), this code will leave $string as undef:
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
    Well usually you don't make code of that quality, of course. But when you have one or more of the following:
  • you have a tight deadline,
  • you are editing someone else's code,
  • you are adding functionality to older code,
  • you are coding tired,
  • you are coding without a prior design,
  • chances are that you make mistakes. Usually, you rely on errors and warnings. Yet, if those are not available, it can be hard to solve an error presented.