X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=src%2Fssic.pl;fp=src%2Fssic.pl;h=e5fa2be81774fa9052bd7ef21e2cb6c923bce75f;hb=e09c119b75cfd9f6e62f50083edf4a812be66134;hp=db7a39f047c033c381daa95e3fc40c7037069b94;hpb=6ada252e60e6e9904764eeff808e7b0a265840ca;p=ssic.git diff --git a/src/ssic.pl b/src/ssic.pl index db7a39f..e5fa2be 100644 --- a/src/ssic.pl +++ b/src/ssic.pl @@ -112,11 +112,19 @@ sub compile error(4, "Input and output files are equal\n"); } - if (not open($input_fh, "<", $input)) { - error(4, "%s: %s\n", $input, $!); + if ($input eq "-") { + $input_fh = *STDIN; + } else { + if (not open($input_fh, "<", $input)) { + error(4, "%s: %s\n", $input, $!); + } } - if (not open($output_fh, ">", $output)) { - error(4, "%s: %s\n", $output, $!); + if ($output eq "-") { + $output_fh = *STDOUT; + } else { + if (not open($output_fh, ">", $output)) { + error(4, "%s: %s\n", $output, $!); + } } %ENV = (