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,