MESSAGE
DATE | 2004-11-20 |
FROM | Billy
|
SUBJECT | Re: [hangout] Perl vs. PHP
|
Ruben Safir Secretary NYLXS wrote:
>>that is NOT THE SAME THING! >>if $var matches blah and blah2, you're going >>to execute sub1, sub2, and sub3. In a switch >>statement, you only want ONE of these to happen. >> >> > > >BTW - what is the C standard for a switch???? > >Why do you need that break? > > Like I thought... >
The C switch will evaluate the expression (once), and jump to a case that matches the expr. The case usually ends in a break, but it doesn't have to. Other case statements can be sprinkled in the code block.
The break is almost always there. So I used it in my example.
Okay, sometimes it isn't there, and you get lovely features like the phone system crash of 1991-01-15.
What's the Perl alternative to that behavior? You haven't offered one. 'last' is Perl's 'break'.
____________________________ NYLXS: New Yorker Free Software Users Scene Fair Use - because it's either fair use or useless.... NYLXS is a trademark of NYLXS, Inc
|
|