--- Kaustav Bhattacharya <[EMAIL PROTECTED]> wrote:
> Mark,
> I only recently started coding in PERL so don't take the following as
> official.
> 
> There is no CASE statement in PERL. Instead you use something called
> SWITCH.

Another trick, possibly not for beginners but sometimes handy:

my %switch = ( 
   abc => sub { do_abc_code(); },
   def => \&def_sub,
   ghi => sub { $ghi++ },
);

foreach my $val (@LIST_OF_STUFF) {
   &$switch{$val};
}

This is presented merely as an excercise for the adventurous;
DON'T expect it to be a fast way to write production code until you
really understand it!

Feel free to write me and ask if you're actually interested, tho,
lol....

Paul

__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/

Reply via email to