#!/usr/bin/env perl use strict; use warnings; if (scalar @ARGV) { print "Processing CLI args: @ARGV ...\n"; } else { print "Reading from STDIN\n"; while (<>) { chomp; print "Got $_\n"; } }