in reply to Making two loops into one
Do not use user-input filenames this way unless you place full trust in your user (and even then, it's a lousy habit to develop); this form of open can be used to run arbitrary processes (e.g. $input = "rm -rf /some/critical/directory |"). Use three arg open instead, or explicitly specify the mode and a space, e.g.:chomp($input = <STDIN>); ... chomp($output = <STDIN>); ... open (INPUT, "$input") || die "died opening input\n";#opening up ngc18 +8cata and putting it into INPUT# open (STDOUT, ">$output") || die "died opening output\n"; #opening up +ngc188cat2 and setting output of out#
open(INPUT, "<", $input) or die ... open(OUTPUT, ">", $output) or die ... or open(INPUT, "< $input") or die ... open(OUTPUT, "> $output") or die ...
|
|---|