So Path::Tiny it like autodies for you :)
#!/usr/bin/perl -- use strict; use warnings; use Path::Tiny; my( $inFile, $outFile ) = @ARGV; my $outfh = path( $outFile )->openw_raw; my $infh = path( $infile )->openr_raw; while( my $line = <$infh>){ chomp $line; if ($line =~ /\>/) { my @modify_line = split(/\s/,$line); $line = $modify_line[0]; } print $outfh "$line\n"; } close $infh; close $outfh;
In reply to Re: How do I modify a line within the file itself?
by Anonymous Monk
in thread How do I modify a line within the file itself?
by newbie4659
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |