L
Liang
hi,
I want to convert a file from dos formate to unix format. This is very easy
in unix. But in dos environment, the script can't work.
The perl version I used is:5.001.
Anyone knows the clue? thanks in advance,
open(INPUT, "<$opt_f");
rename( $opt_f, "$opt_f.bak") || die "Unable to rename $opt_f\n$!\n";
open(OUTPUT, ">$opt_f");
while(<INPUT>) {
if ( s/\r\n/\n/ ) {
$linesFixed++;
}
print OUTPUT;
}
I want to convert a file from dos formate to unix format. This is very easy
in unix. But in dos environment, the script can't work.
The perl version I used is:5.001.
Anyone knows the clue? thanks in advance,
open(INPUT, "<$opt_f");
rename( $opt_f, "$opt_f.bak") || die "Unable to rename $opt_f\n$!\n";
open(OUTPUT, ">$opt_f");
while(<INPUT>) {
if ( s/\r\n/\n/ ) {
$linesFixed++;
}
print OUTPUT;
}