A Perl implementation of 'grep'

#!/usr/bin/perl -w

use strict;

my $pattern = shift;

while(<>) {
  print if(/$pattern/);
}