![]() |
|
good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Declare my variable in sysread - Mojo::File::slurpby srchulo (Sexton) |
on Dec 21, 2018 at 16:46 UTC ( #1227574=perlquestion: print w/replies, xml ) | Need Help?? |
srchulo has asked for the wisdom of the Perl Monks concerning the following question: Hi Monks, I have a question about some code I saw in Mojo::File. In the slurp method, you see this:
Inside the while, you see my $buffer used as the first argument to sysread, and then used in the body of the while loop. I've never seen this before, where you declare a variable as an argument and then access it later. Can anyone explain how this works? Is the body of the while loop able to access $buffer because the while loop's scope includes anything in the parentheses or the body of the loop?
Back to
Seekers of Perl Wisdom
|
|