Search code examples
perllintperl-tidy

How can I do an in-place update of a file with perltidy?


If I want to an in-place update of a file with perltidy, how can I do it? Let's say I want to run perl-tidy on foo.pl but I want to the changes to be in foo.pl


Solution

  • You would use the options -b and -bext='/'

    perltidy -b -bext='/' foo.pl
    

    Taken from the man page

    Make sure you don't have -st provided or the -b and -bext options do nothing; this was actually my problem.