#!/usr/bin/perl use strict; use warnings; while ( my $line = <> ) { if ( $line =~ m/fred/ ) { print $line; } }