sub warning
{
- my ($fmt, $args) = @_;
+ my ($fmt, @args) = @_;
- printf("ssic: Warning: " . $fmt, $args);
+ printf("ssic: Warning: " . $fmt, @args);
}
sub error
{
- my ($status, $fmt, $args) = @_;
+ my ($status, $fmt, @args) = @_;
- printf("ssic: Error: " . $fmt, $args);
+ printf("ssic: Error: " . $fmt, @args);
exit($status);
}
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 = (