2007/8/24, Gunnar Hjalmarsson <[EMAIL PROTECTED]>: > Yoyoyo Yoyoyoyo wrote: > > I have a file that I need to use the substitute operator on to get > > rid of spaces, and apostrophes and such. The only way I can think of > > doing it is this: > > > > 1. Open the file and go through it one line at a time with the > > diamond operator. > > 2. Make the substitutions on the $_ variable and save the changes in > > an array. > > 3. Close the file, then re-open it and overwrite it with the array. > > > > I was just wondering if there was an easier or better way of doing > > this. > > Why not slurp the file into a scalar?
Why need to slurp the file into a scalar?It consume your memory quickly and maybe break the operation,given the file size is large. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/