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?
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
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;
}
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 '=
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