-n causes Perl to assume the following loop around your program, which makes it iterate over filename argu- ments somewhat like sed -n or awk: LINE: while (<>) { ... # your program goes here }