On Jan 6, 2004, at 2:08 PM, [EMAIL PROTECTED] wrote:
Yo.
what Up.
I read in Learning Perl that there are no such constructs
like a case statement. Is there something similar or did I misread
this?
As folks have already pointed to both
the classic perlfaq, and implied that
one should consult
You can do something like this:
my $flip = "something";
SWITCH: {
( $flip =~ /^0$/ || $flip =~ /^1$/ || $flip =~ /^2$/ ) && do {
$local_pref = "FL"; last SWITCH; };
( $flip =~ /^3$/ || $flip =~ /^4$/ || $flip =~ /^5$/ ) && do {
$local_pref = "FU"; las
[EMAIL PROTECTED] wrote:
> People of the Perl,
>
> thanks for the infoI am familiar with perls subroutines so I will use
> these and this name instead of functions. Also, my intention was to avoid
> the if , then ,elif, then constructs, mentioned by Dan, for certain
> situations which is why
> "DBSMITH" == DBSMITH <[EMAIL PROTECTED]> writes:
DBSMITH> Also, my intention was to avoid the if , then ,elif, then
DBSMITH> constructs, mentioned by Dan, for certain situations
What is the source of your fear? Sounds like a phobia to me.
--
Randal L. Schwartz - Stonehenge Consulting
read the perldoc.
thanks
Derek B. Smith
OhioHealth IT
UNIX / TSM / EDM Teams
614-566-4145
"Jenda Krynicky" <[EMAIL PROTECTED]>
01/06/2004 05:18 PM
To: [EMAIL PROTECTED]
cc:
Subject: Re: case and functions
From: [EMAIL PROTECTED]
>
[EMAIL PROTECTED] wrote:
From: [EMAIL PROTECTED]
I read in Learning Perl that there are no such constructs like a case
statement. Is there something similar or did I misread this?
Ask the FAQ, run
perldoc -q "case statement"
Also
what about functions and function calls, do the
From: [EMAIL PROTECTED]
> I read in Learning Perl that there are no such constructs like a case
> statement. Is there something similar or did I misread this?
Ask the FAQ, run
perldoc -q "case statement"
> Also
> what about functions and function calls, do these exits or does the
> su
> Yo.
What's up dog? :)
>
> I read in Learning Perl that there are no such constructs
> like a case statement. Is there
Yes, there is.
Do you mean:
if(this) { do this }
elsif(that) { do that }
else { do the other }
> something similar or did I misread this? Als
There is no 'case' statement in Perl but it is easy to mimic such a construct.
Tony Esposito
Oracle Developer, Enterprise Business Intelligence
XO Communications
Plano, TX 75074
Work Phone: 972-516-5344
Work Cell: 972-670-6144
Email: [EMAIL PROTECTED]
-Original Message-
From: [EMAIL PRO