#!/usr/bin/perl -w use strict; while(<>) { if ($_ =~ m/^\w+(.*)\)$/g) { print $1,"\n"; } }