in reply to string manipulation question

Actually, you're second code block is bad... but I'm guessing that was just a mistake on entering it here. You have too many ';'s.

But onto the real question... I don't see any better looking way other then replacing the undef with ''. Like so:

my $str = "a load of constant stuff..." . ($option ? "optional bit in the middle " : '') . "loads more stuff";
In fact, if you're using #!/usr/bin/perl -w and use the undef method, you'll get the following warning:
Use of uninitialized value in concatenation (.) or string at ./pm.pl l +ine 7.
If $option returns false.

- FrankG