in reply to Re: Not getting desire output by using switch statement in Perl
in thread Not getting desire output by using switch statement in Perl

You can use the ternanry operator to save you typing print twice:
print exists $a{$_} ? $a{$_} : 'Everything else', "\n";

This is how I use the ?:.

لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Replies are listed 'Best First'.
Re^3: Not getting desire output by using switch statement in Perl
by Lennotoecom (Pilgrim) on Jan 06, 2014 at 22:27 UTC
    awesome, thank you