On 02/22/2012 03:02 AM, timothy adigun wrote:
So, if John suggestion doesn't work as it should, then you may have to
enable slurp mode like this:
$/=undef or local $/;
So your code could read:
{
.....
$/=undef; ## or use local $/;
those are not equivilent. the first is setting $/ to undef and it will
last past the block, affecting all other <> calls. the local one will
set it only for the duration of this block but also for any calls made
inside this block that also may do <> ops. in general neither is a good
idea. use File::Slurp if you want to read whole files in. it is cleaner
and also faster than setting $/ to undef.
$text=~s/george/tim/;
........
}
uri
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/