in reply to string manipulation question
But onto the real question... I don't see any better looking way other then replacing the undef with ''. Like so:
In fact, if you're using #!/usr/bin/perl -w and use the undef method, you'll get the following warning:my $str = "a load of constant stuff..." . ($option ? "optional bit in the middle " : '') . "loads more stuff";
If $option returns false.Use of uninitialized value in concatenation (.) or string at ./pm.pl l +ine 7.
- FrankG
|
|---|