On 10-12-03 11:12 AM, Odin Liu wrote:
Still confusing. We know that inner loop's $_ overwrite the outer loop's
$_ only in the inner loop. When the inner loop was over, the $_ would be
it was in outer loop before the inner loop begin. Outer $_ would be
restored by Perl automatically.

But why this behavior changes when the inner loop is a diamond
operation? If it is a Perl syntax, then how can I open a list of file,
read their content, and then keep the file name list as it was?

No, the behaviour is different because the inner loop is a while one. A local copy of $_ would be made if the inner loop was another foreach one.


--
Just my 0.00000002 million dollars worth,
  Shawn

Programming is as much about organization and communication
as it is about coding.

The secret to great software:  Fail early & often.

Eliminate software piracy:  use only FLOSS.

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to