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
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
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
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);
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
Hello,
I am trying to create case statement, and I am not sure I am on the right track,
any comments?
Thanks,
Dave Gilden
SWITCH: {
## yacht form
if ($whichForm eq "123") {
$subject = "123 Form";
$recipient = "[EMAIL PROTECTED]";
$cc = "[EMAIL PROTECTED]";
LAST SWITCH;
}
## regatta form
Hi,
Perl as such doesnt have support case structures
u cud try using block which is almost similar to case struct..
A BLOCK by itself (labeled or not) is semantically equivalent to a loop
that executes once. Thus you can use any of the loop control statements
in it to leave or restart the
Jenda Krynicky wrote:
> From: Chris <[EMAIL PROTECTED]>
>
>>I have been looking in the Learning Perl book, and cannot find it.
>>
>>I am sure that it is just a terminology thing.
>>
>>In VB {Yeah the old VB again :P) I could do:
>>
>>Select Case $Junk
>> Case 1
>>Do Something
>> C
> On Thu, 28 Feb 2002, Chris wrote:
>
> > I have been looking in the Learning Perl book, and cannot find it.
>
> There isn't a syntactical element in Perl to do case statements (aka
> switch in C/C++ & Java). However, they can be done in a variety of ways:
I forg
From: Chris <[EMAIL PROTECTED]>
> I have been looking in the Learning Perl book, and cannot find it.
>
> I am sure that it is just a terminology thing.
>
> In VB {Yeah the old VB again :P) I could do:
>
> Select Case $Junk
> Case 1
> Do Something
> Case 2
> Do Somethi
Chris wrote:
>
> I have been looking in the Learning Perl book, and cannot find it.
> I am sure that it is just a terminology thing.
> In VB {Yeah the old VB again :P) I could do:
>
> Select Case $Junk
> Case 1
> Do Something
> Case 2
> Do Something
> Case 3
>
On Thu, 28 Feb 2002, Chris wrote:
> I have been looking in the Learning Perl book, and cannot find it.
There isn't a syntactical element in Perl to do case statements (aka
switch in C/C++ & Java). However, they can be done in a variety of ways:
use the Switch.pm module
or use
On 2/28/02 1:41 PM, Chris <[EMAIL PROTECTED]> wrote:
> I have been looking in the Learning Perl book, and cannot find it.
>
> I am sure that it is just a terminology thing.
>
> In VB {Yeah the old VB again :P) I could do:
>
> Select Case $Junk
> Case 1
> Do Something
> Case 2
> Do Something
>
I have been looking in the Learning Perl book, and cannot find it.
I am sure that it is just a terminology thing.
In VB {Yeah the old VB again :P) I could do:
Select Case $Junk
Case 1
Do Something
Case 2
Do Something
Case 3
Do Something
Case 4
--- Adam Turoff <[EMAIL PROTECTED]> wrote:
> On Tue, May 22, 2001 at 09:37:13AM -0700, Paul wrote:
> > Anybody know if there would likely be any problem with building a
> > "case" statement like the folowing (without installing Switch.pm)?
> >
> > sub rate ($) {
> > $_[0] eq 'A' ? .03 :
> >
--- Jeff Pinyan <[EMAIL PROTECTED]> wrote:
> On May 22, Paul said:
>
> >I know that in many C compilers, the a ? b : c construct with the
> >ternary ?: operator si not stable after the second or third nesting,
> >but I've never seen that sort of problem in tests I've run in Perl.
>
> The only t
On Tue, May 22, 2001 at 09:37:13AM -0700, Paul wrote:
> Anybody know if there would likely be any problem with building a
> "case" statement like the folowing (without installing Switch.pm)?
>
> sub rate ($) {
> $_[0] eq 'A' ? .03 :
> $_[0] eq 'B' ? .05 :
> $_[0] eq 'C' ? .06 :
>
On May 22, Paul said:
>I know that in many C compilers, the a ? b : c construct with the
>ternary ?: operator si not stable after the second or third nesting,
>but I've never seen that sort of problem in tests I've run in Perl.
The only to watch out for is precendence:
$a ? $b = $c : $b = $d;
Hi all.
I know that in many C compilers, the a ? b : c construct with the
ternary ?: operator si not stable after the second or third nesting,
but I've never seen that sort of problem in tests I've run in Perl.
Anybody know if there would likely be any problem with building a
"case" statement li
19 matches
Mail list logo