--On Montag, 25. Februar 2002 10:24 -0900 Michael Fowler
<[EMAIL PROTECTED]> wrote:
> On Mon, Feb 25, 2002 at 07:45:30PM +0100, Birgit Kellner wrote:
>> for (@array) { # contains a bunch of numbers
>> my %hash = &get_record($_);
>> }
> Are you under the mistaken impression that 'for' is not identical to
> 'foreach' in everything but name?
No, I'm not.
The problem was, as others pointed out, that the called subroutine
"get_record" uses $_ in a while loop, and that apparently while loops don't
localize $_.
This explains why after execution of the while loop, the value of $_ is set
to what it was inside the subroutine - also for the code that called it.
Thanks to all who helped solving this,
Birgit Kellner
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]