in reply to Re: String Manupulation
in thread String Manupulation
perl -pe 's/ /-/;' file.in > file.out or perl -pi.bak -e 's/ /-/;' file.out
I think that's it. You might want to check out -l for making all the line endings work nicely. This came up on the SPUG mailing list recently (SPUG: Docs on "-l" wrong?), where I described -l as "Automagically takes care of line endings, so you don't have to think about chomp or \n - high DWIMage factor." That's how it was first explained to me, and it covers the basics.
We had one-liners come up on the SPUG mailing list in April (SPUG:Best One-Liners and Scripts for UNIX) and the discussion was quite instructive - that's where I started learning about the flags.
Oh, yeah. One more flag which you need to know: -c will check your code to see if it compiles. Not strictly one-linerish, but it is technically a command line flag. :)
"Uhh ... that'll take me three weeks, broken down as follows: 1 day for coding, the rest for meetings to explain why I only need 1 day for coding."
|
|---|