Gossamer Forum
Home : General : Perl Programming :

switch??

Quote Reply
switch??
just want to know is there a switch in perl like in C/java?
Quote Reply
Re: [0069] switch?? In reply to
What kind of switches? Like here;

http://perldoc.com/...unc.html#DESCRIPTION

... with the -w etc switches you can use?

Cheers

Andy (mod)
andy@ultranerds.co.uk


IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Quote Reply
Re: [0069] switch?? In reply to
Do you mean like this in VB?

Code:
Select Case (Variable)
case "xyz"
MsgBox "Hi"
case "abc"
MsgBox "Bye"
End Select
Quote Reply
Re: [0069] switch?? In reply to
Nope, no official syntax, but a lot of ways to do it. See:

http://www.perldoc.com/...h-or-case-statement-

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] switch?? In reply to
Oh, and if you really want some powerful switch handling, there's always:

http://search.cpan.org/...witch-2.09/Switch.pm

(but it's slow as it actually rewrites your code on the fly -- but very cool).

Cheers,

Alex
--
Gossamer Threads Inc.