MESSAGE
DATE | 2004-11-20 |
FROM | Ruben Safir
|
SUBJECT | Re: [hangout] Perl vs. PHP
|
> > > That's my least favorite Perl feature. They give you this as a > consolation prize: > > for($var){ > /foo/ and do { stuff; last }; > /bar/ and do { barstuff; last }; > /bat/ and do { batstuff; last }; > /baz/ and do { bazstuff; last }; > do { defaultstuff; last }; > }
No
sub1 if ($var =~ blah ); sub2 if ($var =~ blah2); sub3 if (var =~ blah2);
And there is a zillion other ways.
Even hook up a sub ref to a hash.
Ruben
> ____________________________ > NYLXS: New Yorker Free Software Users Scene > Fair Use - > because it's either fair use or useless.... > NYLXS is a trademark of NYLXS, Inc >
____________________________ NYLXS: New Yorker Free Software Users Scene Fair Use - because it's either fair use or useless.... NYLXS is a trademark of NYLXS, Inc
|
|