in reply to Re^6: magic-diamond <> behavior -- WHAT?! (sanity)
in thread magic-diamond <> behavior -- WHAT?!
Now, if you actually want to have files that start with '<', '>', '|' or whitespace, or end with '|' or whitespace, then you are in for a lot of suffering - not just from Perl, but from the shell as well. But still, Perl has a documented solution (see for instance, 'perlopentut'):
Yes, and that works with -i as well.BEGIN {s!^(\s)!./$1!,s/^/</,s/$/\0/ for @ARGV}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^8: magic-diamond <> behavior -- WHAT?! (-i)
by tye (Sage) on Oct 31, 2008 at 04:07 UTC | |
|
Re^8: magic-diamond <> behavior -- WHAT?! (sanity)
by ikegami (Patriarch) on Oct 30, 2008 at 23:46 UTC | |
|
Re^8: magic-diamond <> behavior -- WHAT?! (sanity)
by educated_foo (Vicar) on Oct 28, 2009 at 02:43 UTC |