print $_ if $_ =~ /whatever/; #or, since regexps default to use $_ print $_ if /whatever/;