in reply to Re: autoconverting print to say
in thread autoconverting print to say
Chances are print "...\n" isn't used in conjunction with $/.
I'd look for $/ to make sure it's not going to interfere, then use something like
while (<>) { s/print(.*?)\\n("\)?;)/say$1$2/; s/(say.*?)[.,]\s*""(\)?;)/say$1$2/; print; }
Then, I'd do a quick diff between the original and the modified file to verify the change. Don't forget to look for missed occurrences, including local $\ = "\n"; print "foo";
|
|---|