Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • 1
    undef $/ means the rest of the file will be slurped in memory which for a 50 GB file is probably not a good idea, and probably won't be much more efficient than say using $/ = \32768 and a loop. Commented Mar 3, 2013 at 20:33
  • Run perl with the -i flag and it will do it in situ for you! Commented Mar 4, 2013 at 17:59
  • @alexis: not sure how that would go. Commented Mar 4, 2013 at 18:03
  • 1
    See my answer for an example. Commented Mar 4, 2013 at 18:10