#!/usr/bin/perl -- ## whateveritis.pl ## 2015-04-17-02:31:50 ## ## ## ## ## ## perltidy -olq -csc -csci=3 -cscl="sub : BEGIN END " -otr -opr -ce -nibc -i=4 -pt=0 "-nsak=*" ## perltidy -olq -csc -csci=10 -cscl="sub : BEGIN END if " -otr -opr -ce -nibc -i=4 -pt=0 "-nsak=*" ## perltidy -olq -csc -csci=10 -cscl="sub : BEGIN END if while " -otr -opr -ce -nibc -i=4 -pt=0 "-nsak=*" ## perltidy -olq -csc -csci=10 -cscl="sub : BEGIN END if while for " -otr -opr -ce -nibc -i=4 -pt=0 "-nsak=*" #!/usr/bin/perl -- use strict; use warnings; use Path::Tiny qw/ path /; Main( @ARGV ); exit( 0 ); sub Main { my $outfile = "/project/ls1socdft/user/pooja/test_plan_checker/dfta/perl/parse_xls/script/result.log"; my $infile = "/project/ls1socdft_nobackup/rev2.0/user/Shah-B53654/dft/dfta/tpc/get_pat_info/output_0/report/report_all_wgl.pm"; my @final_array = SelectFinalFromInfile( $infile, $outfile ); SomethingElse( @final_array ); } ## end sub Main sub SelectFinalFromInfile { my( $infile, $outfile ) = @_; my $infh = path( $infile )->openr_raw; my $outfh = path( $outfile )->openrw_raw; my @final; while( <$infh> ) { next if m/^$/ or m/return/i or m/1;/; push @final, $_; print $outfh $_; } close $infh; close $outfh; return @final; } ## end sub SelectFinalFromInfile __END__