Add support for compressed files via magic ARGV:
s{
^ # make sure to get whole filename
(
[^'] + # at least one non-quote
\. # extension dot
(?: # now either suffix
gz
| Z
)
)
\z # through the end
}{gzcat '$1' |}xs for @ARGV;
(quotes around $_ necessary to handle filenames with shell metacharacters in)
Now the <> feature will decompress any @ARGV files that end with ".gz" or ".Z":
while (<>) {
print;
}