Interesting. So if I need deal with an array of files, and I have to use the
array after reading each file. I have to save another copy of the array?

Anyway, thanks for helping.

On Sat, Dec 4, 2010 at 12:16 AM, Shawn H Corey <[email protected]>wrote:

> 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.
>



-- 
*Odin Liu
*
RD Engineer
work mail: [email protected]
blog: http://blog.odichy.org/
profile: https://www.google.com/profiles/odinushuaia

Reply via email to