John W. Krahn wrote:
> Shawn H Corey wrote:
>> Steve Bertrand wrote:
>>> You can replace them all with this:
>>>
>>> my $station = $channels{ $opt_s };
>>
>> my $station = $channels{ $opt_s } || help();
>
> my $station = $channels{ $opt_s } or help();
my $station = $channels{ $opt_s } || '' or help();
>
> Or:
>
> ( my $station = $channels{ $opt_s } ) || help();
( my $station = $channels{ $opt_s } || '' ) || help();
Removes the warning about undefined value. Of course, if help() returns
with `return '';` then this version can be used:
my $station = $channels{ $opt_s } || help();
--
Just my 0.00000002 million dollars worth,
Shawn
Programming is as much about organization and communication
as it is about coding.
I like Perl; it's the only language where you can bless your
thingy.
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/