Shawn is absolutely right. If you don't care to save the array, then you can use $_.
Johnny Roche Associate, Help Desk Harvard Management Company Tel: 617-720-6827 Fax: 617-878-6827 Email: roc...@hmc.harvard.edu -----Original Message----- From: Shawn H Corey [mailto:shawnhco...@gmail.com] Sent: Friday, December 03, 2010 11:33 AM To: beginners@perl.org Subject: Re: A strange problem with array outside I/O On 10-12-03 11:31 AM, Odin Liu wrote: > No, actually I need deal with these files twice. So I need to keep the > array of these files. But after the first time dealing with these files, > the array of these files had been changed. Only if you try to use $_ twice. Use a lexical variable for all your loops. -- 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/ The information contained in this e-mail may be confidential and is intended solely for the use of the named addressee. Access, copying or re-use of the e-mail or any information contained therein by any other person is not authorized. If you are not the intended recipient please notify us immediately by returning the e-mail to the originator. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/