Is there a more elegant way of processing input coming from either the command line arguments or STDIN if no files were given on the command line? I'm currently doing it like this:
sub MAIN(*@opt-files, Bool :$debug, ... other named options ...) {
# note that parentheses are mandatory here for some reason
my $input = @opt-files ?? ([~] .IO.slurp for @opt-files) !! $*IN.slurp;
... process $input ...
}
and it's not too bad, but I wonder if I'm missing some simpler way of doing it?