RE: Repost: problems with elsif and $self

2002-02-25 Thread Carl Jolley
On Fri, 22 Feb 2002, John Deighan wrote: At 04:16 PM 2/22/2002 -0500, Carl Jolley wrote: On Fri, 22 Feb 2002, Cornish, Merrill wrote: $self- {PERMIT} eq undef That's not valid. It should be !defined($self-{PERMIT}); What makes you say that it not valid? It passes syntax checks.

RE: Repost: problems with elsif and $self

2002-02-25 Thread Jeffrey
The problem as I see it is that the two statements ($var eq undef) and (!defined($var)) potentially mean different things. Yes you can make them do the same thing, but not always. I think that this was the point. --- Carl Jolley [EMAIL PROTECTED] wrote: my $var = ''; if ($var eq undef) {

Re: Repost: problems with elsif and $self

2002-02-22 Thread Thomas R Wyant_III
[EMAIL PROTECTED] wrote: snip! Problem 1: if/elsif fails. The first if stmt evaluates to false, but then the subsequent elsif stmts are never tested, ... snip! C:\1Tmptype foo.pl if (0) { print FALSE is TRUE!\n; } elsif { print FALSE is FALSE.\n; } C:\1Tmpperl foo.pl

RE: Repost: problems with elsif and $self [thread kill]

2002-02-22 Thread Cory Trese
: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Thomas R Wyant_III Sent: Friday, February 22, 2002 10:33 AM To: plopez Cc: [EMAIL PROTECTED] Subject: Re: Repost: problems with elsif and $self [EMAIL PROTECTED] wrote: snip! Problem 1: if/elsif fails. The first if stmt

RE: Repost: problems with elsif and $self

2002-02-22 Thread Martin Moss
Wyant_III Sent: Friday 22 February 2002 15:33 To: plopez Cc: [EMAIL PROTECTED] Subject: Re: Repost: problems with elsif and $self [EMAIL PROTECTED] wrote: snip! Problem 1: if/elsif fails. The first if stmt evaluates to false, but then the subsequent elsif stmts are never tested

RE: Repost: problems with elsif and $self

2002-02-22 Thread Cornish, Merrill
$self- {PERMIT} eq undef That's not valid. It should be !defined($self-{PERMIT}); Merrill ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: Repost: problems with elsif and $self [thread kill]

2002-02-22 Thread Tillman, James
I vote this thread be stopped ;) It is obvious that the code in question is bogus. Look at the elsif statement ... it is certainly invalid. You can't just have hanging elsif (you need at least elsif(0) {, which the perl compiler/parser will probably convert to else { ...)

RE: Repost: problems with elsif and $self

2002-02-22 Thread Jeffrey
I have to say that there are a number of ugly things about this code. No offense meant -- let me show what I mean. !($foo =~ /match_me/) is more easily written (and clearer) as $foo !~ /match_me/ The first and last clause of the if-elsif chain are identical. The conditions for the sixth and

Re: Repost: problems with elsif and $self

2002-02-22 Thread Dirk Bremer
I would like to suggest to the originator of this post that he considers one Perl's case-type structures instead of all of the elsif statements: SWITCH: { if (test1) {do something; last SWITCH;} if (test2) {do something; last SWITCH;} if (test3) {do something; last SWITCH;} ... } I

Re: Repost: problems with elsif and $self

2002-02-22 Thread Jeffrey
I know that the case-type structure is notd as preferable, but frankly I don't see why. Instead of 'elsif', you have to add 'last SWITCH;' to each if statement. How is this better? Or is there something stating that the 'last' statement is faster/more efficient than an 'elsif'? And while I'm

Re: Repost: problems with elsif and $self

2002-02-22 Thread Keith C. Ivey
Dirk Bremer [EMAIL PROTECTED] wrote: I would like to suggest to the originator of this post that he considers one Perl's case-type structures instead of all of the elsif statements: But if/elsif *is* one of Perl's case-type structures, since Perl doesn't have switch/case. SWITCH: {