in reply to when does the definition of a my variable take effect?

After the my statement is executed. In the read FH, my $buffer, $len case, you're using my as an lvalue, while in the posted snippet, you try to use the variable as an rvalue before the my has executed.

Update: D'oh! Brainfart. I said rvalue where it's an lvalue and vice versa. Post fixed.

Makeshifts last the longest.

  • Comment on Re: when does the definition of a my variable take effect?

Replies are listed 'Best First'.
Re: Re: when does the definition of a my variable take effect?
by John M. Dlugosz (Monsignor) on Aug 23, 2002 at 03:18 UTC
    What makes $buffer an rvalue? It is modified by the call to read, so it must be an lvalue.