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-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 passe

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: > {

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 w

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 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 se

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 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

2002-02-22 Thread plopez
ines > > > > my $buffer='BUFFER TEXT or array ref'; > my $res=$self->MySub($buffer); > >sub MySub > { > my $self=shift; > my $buffer=shift; > my $result; > > > #your code > > > return $re

RE: Repost: problems with elsif and $self

2002-02-22 Thread Martin Moss
TECTED] > [mailto:[EMAIL PROTECTED]]On Behalf Of > Thomas R Wyant_III > Sent: Friday 22 February 2002 15:33 > To: Cc: [EMAIL PROTECTED] > Subject: Re: Repost: problems with elsif and $self > > > > <[EMAIL PROTECTED]> wrote: > > > > > > Problem 1:

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

2002-02-22 Thread Cory Trese
essage- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]]On Behalf Of > Thomas R Wyant_III > Sent: Friday, February 22, 2002 10:33 AM > To: Cc: [EMAIL PROTECTED] > Subject: Re: Repost: problems with elsif and $self > > > > <[EMAIL PROTECTED]> wrote: >

Re: Repost: problems with elsif and $self

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

Re: Repost: problems with elsif and $self

2002-02-21 Thread Carl Jolley
On Thu, 21 Feb 2002 [EMAIL PROTECTED] wrote: > I fat fingered the last post and am reposting. I am running win2k sp w/ AS > Perl 5.6.1 > > Problem 1: > > if/elsif fails. The first if stmt evaluates to false, but then the > subsequent elsif stmts are never tested, such as: > > if() > { > > }