Re: case statement in perl

2012-08-02 Thread Paul.G
Thanks for everybody assistance, found a an appropiate solution to my problem. Without having to use the case statement. Cheers Paul From: Hal Wigoda To: beginners@perl.org Sent: Thursday, 2 August 2012 5:38 AM Subject: Re: case statement in perl so why

Re: case statement in perl

2012-08-01 Thread Paul.G
I have removed the switch funtion from the script. From: Uri Guttman To: beginners@perl.org Sent: Thursday, 2 August 2012 2:02 AM Subject: Re: case statement in perl On 08/01/2012 03:08 AM, Paul.G wrote: > The example below is just a test, I need to be a

Re: case statement in perl

2012-08-01 Thread Chris Nehren
On Wed, Aug 01, 2012 at 14:38:42 -0500 , Hal Wigoda wrote: > so why don't they get rid of it? I'm not sure which "it" you're referring to: Switch.pm or given/when. For better or worse, Perl has a strong culture of backwards compatibility. Perl is one of the few languages where you can use code wr

Re: case statement in perl

2012-08-01 Thread Hal Wigoda
so why don't they get rid of it? On Wed, Aug 1, 2012 at 2:33 PM, Chris Nehren wrote: > On Wed, Aug 01, 2012 at 12:02:04 -0400 , Uri Guttman wrote: >> On 08/01/2012 03:08 AM, Paul.G wrote: >> >The example below is just a test, I need to be able to insert >> >multiple values a command, those value

Re: case statement in perl

2012-08-01 Thread Chris Nehren
On Wed, Aug 01, 2012 at 12:02:04 -0400 , Uri Guttman wrote: > On 08/01/2012 03:08 AM, Paul.G wrote: > >The example below is just a test, I need to be able to insert > >multiple values into a command, those values can be either 1, 2 or > >upto 5. > > > > > you aren't getting the issue. the switch mo

Re: case statement in perl

2012-08-01 Thread Uri Guttman
On 08/01/2012 03:08 AM, Paul.G wrote: The example below is just a test, I need to be able to insert multiple values into a command, those values can be either 1, 2 or upto 5. you aren't getting the issue. the switch module was a major mistake and no one should be using it. you have to underst

Re: case statement in perl

2012-08-01 Thread John W. Krahn
Paul.G wrote: The example below is just a test, I need to be able to insert multiple values into a command, those values can be either 1, 2 or upto 5. Below is closer to the working example, but I will read that document and to help make a final decision. # Check Free PV's operation_CHECKFREE

Re: case statement in perl

2012-08-01 Thread Rob Coops
]"); > } >} ># lvsync >run("/usr/sbin/lvsync -T $sourcelv"); >logprint "Successful $NEWMIRROR mirrors \t\t synced"; > } > else { >cleanexit (10, "FAIL \t\t No Free PV's Available"); > } > > return 0; > } &g

Re: case statement in perl

2012-08-01 Thread Paul.G
t\t synced"; } else {    cleanexit (10, "FAIL \t\t No Free PV's Available"); } return 0; } ____ From: John W. Krahn To: Perl Beginners Sent: Wednesday, 1 August 2012 4:58 PM Subject: Re: case statement in perl Paul.G wrote: > Below is an extract from the perl

Re: case statement in perl

2012-07-31 Thread John W. Krahn
Paul.G wrote: Below is an extract from the perl script, the switch/case statement seemed like a simple solution. # Mail Program # operation_CHECKFREEPVS(); print "$numPV \n"; # print "$FreePV[1] $FreePV[0] $numPV\n"; if ($numPV ne 0 ) {

Re: case statement in perl

2012-07-31 Thread timothy adigun
case 2 { print "$FreePV[0] $FreePV[1] \n"; } > case 3 { print "$FreePV[0] $FreePV[1] $FreePV[2] \n"; } >} > } > else { >print "No PV's available \n"; > } > > > > From: Chris N

Re: case statement in perl

2012-07-31 Thread Paul.G
__ From: Chris Nehren To: beginners@perl.org Sent: Wednesday, 1 August 2012 2:54 PM Subject: Re: case statement in perl On Tue, Jul 31, 2012 at 23:47:45 -0500 , Hal Wigoda wrote: > Use the switch/case combination. > > On Tue, Jul 31, 2012 at 11:41 PM, Paul.G wrot

Re: case statement in perl

2012-07-31 Thread Chris Nehren
On Tue, Jul 31, 2012 at 23:47:45 -0500 , Hal Wigoda wrote: > Use the switch/case combination. > > On Tue, Jul 31, 2012 at 11:41 PM, Paul.G wrote: > > Hi All > > > > > > Does perl have a case statement or an equivalent? > > > > > > Cheers > > > > Paul Don't use Switch.pm. It's a source filter and

Re: case statement in perl

2012-07-31 Thread Hal Wigoda
Use the switch/case combination. On Tue, Jul 31, 2012 at 11:41 PM, Paul.G wrote: > Hi All > > > Does perl have a case statement or an equivalent? > > > Cheers > > Paul -- - Chicago Hal Wigoda -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands,

Re: Case statements

2005-04-12 Thread Jonathan Paton
On Apr 12, 2005 4:24 PM, David Gilden <[EMAIL PROTECTED]> wrote: > Hello, > > I am trying to create case statement, and I am not sure I am on the right > track, > any comments? perldoc Switch Jonathan Paton -- #!perl $J=' 'x25 ;for (qq< 1+10 9+14 5-10 50-9 7+13 2-18 6+13 17+6 02+1 2-10 00+4 0

RE: Case statements

2005-04-12 Thread Chris Devers
On Tue, 12 Apr 2005, Wagner, David --- Senior Programmer Analyst --- WGO wrote: > Chris Devers wrote: > > Also, as a side note, if $whichForm is numeric, you should just use > > the nueric comparisons rather than the string ones: > > > > if $whichForm eq "123" # bad! > > if $whichForm

RE: Case statements

2005-04-12 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Chris Devers wrote: > On Tue, 12 Apr 2005, David Gilden wrote: > >> I am trying to create case statement, and I am not sure I am on the >> right track, any comments? > > Would something like this get the same result? > > my %form_action = ( > 000 => sub {}, # silently ignore this one

Re: Case statements

2005-04-12 Thread Chris Devers
On Tue, 12 Apr 2005, David Gilden wrote: > I am trying to create case statement, and I am not sure I am on the right > track, > any comments? Would something like this get the same result? my %form_action = ( 000 => sub {}, # silently ignore this one 123 => handle_form(123);

Re: Case statements

2005-04-12 Thread Ing. Branislav Gerzo
David Gilden [DG], on Tuesday, April 12, 2005 at 10:24 (-0500) typed the following: DG> I am trying to create case statement, and I am not sure I am on the right track, DG> any comments? try to write at your console your subject, eg: perldoc -q "case statement" -- ...m8s, cu l8r, Brano. ["W

Re: Case-operator

2005-02-28 Thread Ricardo SIGNES
* Vladimir D Belousov <[EMAIL PROTECTED]> [2005-02-28T07:01:02] > Is in the perl operator like C/C++ 'case' ? I believe you are asking: Is there Perl equivalent to C's switch/case construct? Not exactly. To see the official Perl documentation on this, run: perldoc -q case This will search the F

Re: case and functions

2004-01-07 Thread drieux
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

Re: case and functions

2004-01-07 Thread William.Ampeh
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

Re: case and functions

2004-01-06 Thread R. Joseph Newton
[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

Re: case and functions

2004-01-06 Thread Randal L. Schwartz
> "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

Re: case and functions

2004-01-06 Thread DBSMITH
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] >

Re: case and functions

2004-01-06 Thread Chuck Fox
[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

Re: case and functions

2004-01-06 Thread Jenda Krynicky
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

RE: case and functions

2004-01-06 Thread Dan Muey
> 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

RE: case and functions

2004-01-06 Thread Esposito, Anthony
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

Re: case conversion problem

2003-09-11 Thread Kevin Pfeiffer
In article <[EMAIL PROTECTED]>, Jenda Krynicky wrote: > From: Gary Stainburn <[EMAIL PROTECTED]> >> I've got to tidy some data, including converting case. I need to >> convert >> >> ANOTHER COMPANY NAME LTD ** >> >> to >> >> Another Company Name Ltd ** >> >> while retaining spaces.

Re: case conversion problem

2003-09-05 Thread David Wall
--On Friday, September 05, 2003 2:14 PM +0100 Gary Stainburn <[EMAIL PROTECTED]> wrote: I've got to tidy some data, including converting case. I need to convert ANOTHER COMPANY NAME LTD ** to Another Company Name Ltd ** while retaining spaces. I've tried using split / join / lc

Re: case conversion problem

2003-09-05 Thread Paul Johnson
On Fri, Sep 05, 2003 at 12:29:31PM -0700, david wrote: > John Fisher wrote: > > > I am trying to figure out how clever it actually is. > > I reversed \L\u with \u\L expecting different results and got the same > > result. Another Company Name Ltd > > > > Why didn't reversing the metacharacters c

re: case conversion problem

2003-09-05 Thread david
John Fisher wrote: > I am trying to figure out how clever it actually is. > I reversed \L\u with \u\L expecting different results and got the same > result. Another Company Name Ltd > > Why didn't reversing the metacharacters change the results. > [snip] > > $pt=~s/(\w+)/\u\L$1/g > > $pt=~s/

re: case conversion problem

2003-09-05 Thread JOHN FISHER
I am trying to figure out how clever it actually is. I reversed \L\u with \u\L expecting different results and got the same result. Another Company Name Ltd Why didn't reversing the metacharacters change the results. the \L escape forces lowercase When written in lowercase (\l and \u), they affec

Re: case conversion problem

2003-09-05 Thread James Edward Gray II
On Friday, September 5, 2003, at 08:52 AM, Gary Stainburn wrote: On Friday 05 Sep 2003 2:25 pm, Jenda Krynicky wrote: From: Gary Stainburn <[EMAIL PROTECTED]> I've got to tidy some data, including converting case. I need to convert ANOTHER COMPANY NAME LTD ** to Another Company Name Ltd

Re: case conversion problem

2003-09-05 Thread Paul Johnson
Jenda Krynicky said: > From: Gary Stainburn <[EMAIL PROTECTED]> >> I've got to tidy some data, including converting case. I need to >> convert >> >> ANOTHER COMPANY NAME LTD ** >> >> to >> >> Another Company Name Ltd ** >> >> while retaining spaces. > > $text =~ s/(\w+)/\L\u$1/g;$y \L\

Re: case conversion problem

2003-09-05 Thread Gary Stainburn
On Friday 05 Sep 2003 2:25 pm, Jenda Krynicky wrote: > From: Gary Stainburn <[EMAIL PROTECTED]> > > > I've got to tidy some data, including converting case. I need to > > convert > > > > ANOTHER COMPANY NAME LTD ** > > > > to > > > > Another Company Name Ltd ** > > > > while retaining sp

Re: case conversion problem

2003-09-05 Thread Paul Johnson
Gary Stainburn said: > Hi folks, > > I've got a problem I hope you can help me with. > > I've got to tidy some data, including converting case. I need to convert > > ANOTHER COMPANY NAME LTD ** > > to > > Another Company Name Ltd ** > > while retaining spaces. > > I've tried using split

Re: case conversion problem

2003-09-05 Thread Jenda Krynicky
From: Gary Stainburn <[EMAIL PROTECTED]> > I've got to tidy some data, including converting case. I need to > convert > > ANOTHER COMPANY NAME LTD ** > > to > > Another Company Name Ltd ** > > while retaining spaces. $text =~ s/(\w+)/\L\u$1/g;$y Jenda = [EMAIL PROTECTED] === ht

Re: case conversion problem

2003-09-05 Thread James Edward Gray II
On Friday, September 5, 2003, at 08:14 AM, Gary Stainburn wrote: Hi folks, I've got a problem I hope you can help me with. I've got to tidy some data, including converting case. I need to convert ANOTHER COMPANY NAME LTD ** to Another Company Name Ltd ** while retaining spaces.

RE: Case conversions

2003-08-18 Thread Dan Muey
> > "Scott" == Scott Taylor <[EMAIL PROTECTED]> writes: > > Scott> Any one have or know of a function to convert ugly > "NAME, USER" > Scott> to "User Name"? > I'd do soemthign like this: my($name, $user) = split(/,/, $line); $name =~ s/^\s+//; $name = ucfirst(lc($n

Re: Case conversions

2003-08-15 Thread Randal L. Schwartz
> "Scott" == Scott Taylor <[EMAIL PROTECTED]> writes: Scott> Any one have or know of a function to convert ugly "NAME, USER" to "User Name"? s/NAME, USER/User Name/; :-) -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <[EMAIL PROTECTED]> http://www.stonehenge

Re: Case conversions

2003-08-15 Thread James Edward Gray II
On Friday, August 15, 2003, at 05:09 PM, Scott Taylor wrote: $var = 'NAME, USER'; print "$var\n"; @var = reverse split(', ',$var); print "@var\n"; $var = join(' ',(ucfirst lc $var[0],ucfirst lc $var[1])); # whitout the comma this time print "$var\n"; This works well, too, and join seems to fix t

Re: Case conversions

2003-08-15 Thread James Edward Gray II
On Friday, August 15, 2003, at 04:55 PM, Scott Taylor wrote: At 02:28 PM 08/15/2003, James Edward Gray II wrote: On Friday, August 15, 2003, at 04:20 PM, Scott Taylor wrote: Any one have or know of a function to convert ugly "NAME, USER" to "User Name"? Maybe something like: s/^(\w+), ?(\w+)$

RE: Case conversions

2003-08-15 Thread Scott Taylor
At 02:46 PM 08/15/2003, Degey, Didier wrote: -Original Message- From: Scott Taylor [mailto:[EMAIL PROTECTED] Sent: vendredi 15 août 2003 23:20 To: [EMAIL PROTECTED] Subject: Case conversions Any one have or know of a function to convert ugly "NAME, USER" to "User Name"? Strange email thing

Re: Case conversions

2003-08-15 Thread Scott Taylor
At 02:28 PM 08/15/2003, James Edward Gray II wrote: On Friday, August 15, 2003, at 04:20 PM, Scott Taylor wrote: Any one have or know of a function to convert ugly "NAME, USER" to "User Name"? Maybe something like: s/^(\w+), ?(\w+)$/ucfirst(lc $2) . ' ' . ucfirst(lc $1)/e Nice, very useful! On

Re: Case conversions

2003-08-15 Thread Jerry Rocteur
I've just used Elias' idea to change a file's content... Where file name is word: perl -i -p -e 's/(.)(.*)/$1\L$2/' word On Friday, Aug 15, 2003, at 23:29 Europe/Brussels, Elias Assmann wrote: On Fri, Aug 15, 2003 at 02:20:19PM -0700, Scott Taylor wrote: Any one have or know of a function to c

RE: Case conversions

2003-08-15 Thread Mark Anderson
> Any one have or know of a function to convert ugly "NAME, USER" to "User Name"? timtowtdi: $str = "User Name" if ($str eq "NAME, USER"); $str =~ s/^NAME, USER$/User Name/; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Case conversions

2003-08-15 Thread Degey, Didier
$var = 'NAME, USER'; print "$var\n"; @var = reverse split(', ',$var); print "@var\n"; $var = join(' ',(ucfirst lc $var[0],ucfirst lc $var[1])); # whitout the comma this time print "$var\n"; -Original Message- From: Scott Taylor [mailto:[EMAIL PROTECTED] Sent: vendredi 15 août 2003 23:20 T

Re: Case conversions

2003-08-15 Thread Elias Assmann
On Fri, Aug 15, 2003 at 02:20:19PM -0700, Scott Taylor wrote: > > Any one have or know of a function to convert ugly "NAME, USER" to "User > Name"? $ perl -le '$_ = "NAME"; s/(.)(.*)/$1\L$2/; print' Name The function to convert a string to lower case is "lc". HTH, Elias -- If you ta

Re: Case conversions

2003-08-15 Thread James Edward Gray II
On Friday, August 15, 2003, at 04:20 PM, Scott Taylor wrote: Any one have or know of a function to convert ugly "NAME, USER" to "User Name"? Maybe something like: s/^(\w+), ?(\w+)$/ucfirst(lc $2) . ' ' . ucfirst(lc $1)/e Hope that helps. James -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

Re: Case Statement

2003-07-27 Thread Janek Schleicher
Pablo Fischer wrote at Sat, 26 Jul 2003 23:35:14 +: > I need to evaluate a lot of conditionals, and of course the use of a lot of > if's its not the 'right' way, so Im using something like this: > > CASE: { > ($string == "match1") && do { > actions.. > last CASE; > };

Re: Case Statement

2003-07-26 Thread John W. Krahn
Pablo Fischer wrote: > > Hello Again! Hello, > I need to evaluate a lot of conditionals, and of course the use of a lot of > if's its not the 'right' way, so Im using something like this: > > CASE: { > ($string == "match1") && do { ^^^ > actions.. >

Re: Case Statement

2003-07-26 Thread Beau E. Cox
- Original Message - From: "Pablo Fischer" <[EMAIL PROTECTED]> To: "Perl Beginners" <[EMAIL PROTECTED]> Sent: Saturday, July 26, 2003 1:35 PM Subject: Case Statement > Hello Again! > > I need to evaluate a lot of conditionals, and of course the use of a lot of > if's its not the 'right'

RE: Case Insensitive

2002-12-03 Thread david
Jenda Krynicky wrote: > Better, but still incorrect. Glad that you point this out! :-) I always make that kind of mistake! david -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Case Insensitive

2002-12-03 Thread Jenda Krynicky
From: david <[EMAIL PROTECTED]> > Dylan Boudreau wrote: > > > I could be wrong here as I am still pretty new to perl but couldn't > > you just do it like this > > > > if ($x =~ /$y/i) > > > > Dylan > > > > almost correct! :-) how about: > > if($x =~ /^$y$/i) > > your reg. only checks to see

RE: Case Insensitive

2002-12-03 Thread david
Dylan Boudreau wrote: > I could be wrong here as I am still pretty new to perl but couldn't you > just do it like this > > if ($x =~ /$y/i) > > Dylan > almost correct! :-) how about: if($x =~ /^$y$/i) your reg. only checks to see if $y is within $x, not equal. david -- To unsubscribe, e-m

Re: Case Insensitive

2002-12-03 Thread wiggins
0, "Rob Dixon" <[EMAIL PROTECTED]> wrote: > That would work fine, or you could change both to the same case for the > duration of the comparison: > > if ( "\U$x" eq "\U$y" ) > > Rob > > > - Original Message - > From:

RE: Case Insensitive

2002-12-03 Thread Beau E. Cox
Ain't perl great? There are always at least 58 ways to do anything/everthing! :) Aloha => Beau. -Original Message- From: Rob Dixon [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 03, 2002 3:41 AM To: Dylan Boudreau; [EMAIL PROTECTED] Subject: Re: Case Insensitive That wo

RE: Case Insensitive

2002-12-03 Thread Beau E. Cox
Or, you could: if (lc $x eq lc $y) { ... } lc changes to lower case. Aloha => Beau. -Original Message- From: SATAR VAFAPOOR [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 03, 2002 3:27 AM To: [EMAIL PROTECTED] Subject: Case Insensitive Hello all, I want to make comaprisons in an

Re: Case Insensitive

2002-12-03 Thread Rob Dixon
That would work fine, or you could change both to the same case for the duration of the comparison: if ( "\U$x" eq "\U$y" ) Rob - Original Message - From: "Dylan Boudreau" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, D

Re: Case Insensitive

2002-12-03 Thread Nigel Wetters
On Tue, 2002-12-03 at 13:26, SATAR VAFAPOOR wrote: > I want to make comaprisons in an if statement without caring > about upper or lower case eg $x='T'; $y='t' if($x eq $y). can > the i that is used in regex be used here or is there another way. Simplest way is to convert both to lower case, u

RE: Case Insensitive

2002-12-03 Thread Dylan Boudreau
I could be wrong here as I am still pretty new to perl but couldn't you just do it like this if ($x =~ /$y/i) Dylan -Original Message- From: SATAR VAFAPOOR [mailto:[EMAIL PROTECTED]] Sent: December 3, 2002 9:27 AM To: [EMAIL PROTECTED] Subject: Case Insensitive Hello

Re: case

2002-04-23 Thread Chas Owens
On Tue, 2002-04-23 at 10:30, Chas Owens wrote: > On Mon, 2002-04-22 at 06:52, walter valenti wrote: > > Hi, > > > > there is in Perl a statement "case" like in "C" or in "Pascal" ??? > > > > Walter > > Damian Conway has written a module to implement a switch for Perl as a > proof of concept

Re: case

2002-04-23 Thread Chas Owens
On Mon, 2002-04-22 at 06:52, walter valenti wrote: > Hi, > > there is in Perl a statement "case" like in "C" or in "Pascal" ??? > > Walter Damian Conway has written a module to implement a switch for Perl as a proof of concept for Perl 6. You can install it by saying perl -MCPAN -e "inst

Re: case

2002-04-22 Thread drieux
On Monday, April 22, 2002, at 04:18 , Gary Stainburn wrote: > On Monday 22 April 2002 12:07 pm, Marc te Vruchte wrote: >> Well, there isn't a real case statement as in C or Pascal, but, you can >> emulate one through a block =) we went around the Idea of also using a HashSwitch - if you were do

Re: case

2002-04-22 Thread Gary Stainburn
On Monday 22 April 2002 12:07 pm, Marc te Vruchte wrote: > Well, there isn't a real case statement as in C or Pascal, but, you can > emulate one through a block =) > > > SWITCH: for ($str_fruit) { > if (/apple/) { > ... > last SWITCH; > } > if (/banana

RE: case

2002-04-22 Thread Marc te Vruchte
Well, there isn't a real case statement as in C or Pascal, but, you can emulate one through a block =) SWITCH: for ($str_fruit) { if (/apple/) { ... last SWITCH; } if (/banana/) { ... last SWITCH; }