LYCOS RETRIEVER Beta Retriever Home  |  What is Lycos Retriever?   
Switch: Cases
built 645 days ago
If $val held the number 1, the above switch block would call the first three handle_... subroutines, jumping to the next case test each time it encountered a next. After the thrid case block was executed, control would jump to the end of the enclosing switch block.
Source:
SPDT switch symbol This switch can be on in both positions, switching on a separate device in each case. It is often called a changeover switch. For example, a SPDT switch can be used to switch on a red lamp in one position and a green lamp in the other position.
In other cases, the switch is used to create a "mirror" image of data that can go to an external device. Since most switch port mirroring provides only one mirrored stream, network hubs can be useful for fanning out data to several read-only analyzers, such as intrusion detection systems and packet sniffers.
Fall-though (trying another case after one has already succeeded) is usually a Bad Idea in a switch statement. However, this is Perl, not a police state, so there is a way to do it, if you must.
Source:
SEARCH
MORE ABOUT