Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: perl -pi -e s'/^\s+//'g $file

by goibhniu (Hermit)
on Apr 12, 2011 at 18:37 UTC ( #899025=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
        #!/usr/bin/perl -pi.orig
        s/foo/bar/;
    
  2. or download this
        #!/usr/bin/perl
        $extension = '.orig';
        LINE: while (<>) {
    ...
        print;    # this prints to original filename
        }
        select(STDOUT);
    
  3. or download this
    #!/usr/bin/perl
    
    ...
    $cmd="perl -pi -e s\'\/^\\s+\/\/'g $file";
    print "$cmd\n";
    system($cmd);
    
  4. or download this
    #!/usr/bin/perl
    
    ...
    $cmd="perl -pi -e s\'\/^\\s+\/\/'g $file";
    print "$cmd\n";
    system($cmd);
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://899025]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2018-10-22 12:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When I need money for a bigger acquisition, I usually ...














    Results (119 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!