A Perl 5 implementation of 'grep'

#!/usr/bin/perl -w

use strict;

my $pattern = shift;

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