Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^3: Mysterious append failure.

by dave_the_m (Monsignor)
on Dec 09, 2004 at 12:48 UTC ( #413506=note: print w/replies, xml ) Need Help??


in reply to Re^2: Mysterious append failure.
in thread Mysterious append failure.

Was forgetting for a minute that declaring $b there would actually scope it inside the loop.
This isn't quite true - the output of Deparse is wrong. The lexical is scoped wider than the loop, as can be seen here:
$ perl585 -le '$x=99; my $x = $_ for 1..3; print $x' $
(Note that $::x isn't printed, the lexical $x is instead.) However, the initialising and releasing of $x is scoped to within the loop.

That may be construed as a bug. There again, statement modifiers on my declarations are usally buggy, and are best avoided.

Dave.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://413506]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (3)
As of 2022-05-21 07:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (76 votes). Check out past polls.

    Notices?