in reply to Re^2: Input Output Question
in thread Input Output Question
poj#!perl use strict; opendir(DIR,'../input') or die "$!"; while (readdir DIR){ unless (/^[.]{1,2}$/){ print "parsing $_\n"; open IN,'<','../input/'.$_ or die "Could not open $_ for input : $!"; open OUT,'>','../output/'.$_ or die "Could not open $_ for output : $!"; while (my $line = <IN>){ # process $line print OUT $line; } close IN; close OUT; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Input Output Question
by rjt (Curate) on Jul 15, 2013 at 10:21 UTC |