in reply to perl on the commandline

The -p prints $_ after each line, while -n do not. So the two versions are almost the same (they will do the same):
perl -i.bak -ne 's/\s+//g;print' names perl -i.bak -pe 's/\s+//g;' names


T I M T O W T D I

Replies are listed 'Best First'.
Re: Re: perl on the commandline
by Anonymous Monk on Aug 21, 2001 at 23:31 UTC
    the file doesnt get modified. I want perl to strip the white space from the file but it doesn't do it. beware im am in windows terminal

      You are using single quotes, under windows you have to type the following: perl -pi.bak -e "s/\s+//g" names

      -- Hofmator