now what can I use to replace the printf, to use to delete?
You have now entered a situation i dont like. You seem to want to want to replace the original file. for the most part i dont like to do that (at first). I dont like to modify my only copy of the original data. What i do instead is write a new file, then use the new file in later processing.
Note also the change from printf to print. You should read about what printf does in regards to the first argument being a format. What you wanted instead was print.use strict; use warnings; main(@ARGV); sub main { open(my $in ,'<', "gtype.txt"); open(my $out ,'>', "fixed-gtype.txt"); while( my $line = <$in> ) { my $line = substr($line,1); print $out $line; } } close $in; close $out;
In reply to Re^5: foreach type of deal?
by huck
in thread foreach type of deal?
by hoagies
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |