Why doesn't RETURN work?

2001-10-24 Thread Gross, Stephan
I have a subroutine sub xyz { if ($a = $b) { return; } } When I run this in the debugger, it stays frozen on the RETURN statement. Shouldn't the RETURN break out of the xyz subroutine? Also, this used to work until I made some changes. Am I missing something obvious?

RE: Why doesn't RETURN work?

2001-10-24 Thread Barry Carroll
mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 24, 2001 2:47 PM To: 'Beginner Perl' Subject: Why doesn't RETURN work? I have a subroutine sub xyz { if ($a = $b) { return; } } When I run this in the debugger, it stays frozen on the RETURN statement. Shouldn

RE: Why doesn't RETURN work?

2001-10-24 Thread RArul
How about if($a == $b) ? -Original Message- From: Gross, Stephan [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 24, 2001 9:47 AM To: 'Beginner Perl' Subject: Why doesn't RETURN work? I have a subroutine sub xyz { if ($a = $b) { return; }

RE: Why doesn't RETURN work?

2001-10-24 Thread Gross, Stephan
nesday, October 24, 2001 9:59 AM To: 'Gross, Stephan'; 'Beginner Perl' Subject: RE: Why doesn't RETURN work? Hi, 'if ($a = $b)' is not comparing $a to $b, it is assigning the value of $b into $a If you want to test for numeric equivalence, use two '=

Re: Why doesn't RETURN work?

2001-10-24 Thread Brett W. McCoy
On Wed, 24 Oct 2001, Gross, Stephan wrote: > I have a subroutine > > sub xyz > { > > if ($a = $b) > { >return; > } > } > > > When I run this in the debugger, it stays frozen on the RETURN statement. > Shouldn't the RETURN break out of the xyz subroutine? > Also, this used