> i am trying to write a perl script to tidy up any lines in a file that don't > contain alphabetic characters or single instances of character. i've noticed > that the even lines are being skipped when read in eg 0,2,4,6 - the script > is run on window - any ideas?
> while (<INPUT>) { This line reads the first (and other odd lines of INPUT) and places the contents into $_ > chomp($test=<INPUT>); This line reads the second (and other even lines of INPUT) and places the contents into $test The following lines print $test to OUTPUT 1 regardless of what is in it > if ( $test =~/\w/) > {print OUTPUT1 "$test\n"} > if ( $test !~/[A-Za-z]/) > {print OUTPUT1 "$test\n"} > else > {print OUTPUT "$test\n"} The contents of $_ are overwritten on the next call of the while line. Hope this helps, /\/\ark -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>