#!/usr/bin/perl use strict; use warnings; my $filein=shift(@ARGV) or die "No imput file specified\n"; my $fileout=shift(@ARGV) or 'STDOUT'; open(my $fhin, '<', $filein) or die "cannot open $filein $!\n"; my $fhout=\*STDOUT; open($fhout,'>',$fileout) if($fileout ne 'STDOUT'); while(my $line=<$fhin>) { chomp($line); my $l=length($line); print $fhout "$line\n" if($l<15 and $l>10); } close($fhout); close($fhin);