I have a bad habit of throwing in a one line command wihtin perl code like this:
#!/usr/bin/perl $file="test"; $cmd="perl -pi -e s\'\/^\\s+\/\/'g $file"; print "$cmd\n"; system($cmd);
Is there a quick and proper way of doing the above in a script without having something like this:
open(DATA, "$file"); while(<DATA>){ chomp; $line=$_; $line=~ s/^\s+//g; print "$line\n"; }
Thanks again for your help much appreciated.
In reply to perl -pi -e s'/^\s+//'g $file by david_lyon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |