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?
[hippo]: Environments differ.
[vedagiri89]: so, how to fix that differ
[choroba]: option one is install everything from the vendor
[choroba]: option two is install everything by hand
[choroba]: option three is mixed the two, but know well what you're doing
[vedagiri89]: right..let me check

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (9)
As of 2018-06-19 11:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?



    Results (113 votes). Check out past polls.

    Notices?