View Single Post
Old 07-31-2003, 05:46 PM  
NetRodent
Confirmed User
 
Join Date: Jan 2002
Location: In the walls of your house.
Posts: 3,985
Quote:
Originally posted by NetRodent
Save your money. The following should do what you want. I didn't try running it so there may be typos.

Code:
$input_file = '/path/to/input/file';
$output_file = '/path/to/output/file';

open(I,"<$input_file") || die "Cannot read $input_file: $!\n";
open(O,">$output_file") || die "Cannot write $output_file: $!\n";
while() {
   chomp;
   $_ =~ s/^\s+//;
   $_ =~ s/\s+$//;
   if(length($_) hahahaha 7) {
      print O $_."\n";
   }
}
close I;
close O;
Bah! The html filter strikes again. The "while() {" statement above should actually be "while(&lt;I&gt;) {".
__________________
"Every normal man must be tempted, at times, to spit on his hands, hoist the black flag, and begin slitting throats."
--H.L. Mencken
NetRodent is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote