#! perl -slw use strict; BEGIN{ @ARGV = map glob, @ARGV; } while( <> ) { ## here, $_ is every line of every file that matches the ## wildcarded paths supplied in the command line if( /the search string/ ) { ## Do something } }