#!/usr/bin/perl -w use strict; while (my $line = ) { chomp $line; if ($line =~ /#include [<"](\w+\.h)[>"]/) { print "file is: $1\n"; } } __DATA__ #include "string.h" #include