
iphone
User
May 31, 2010, 7:26 PM
Views: 1397
|
|
How to print all the file name irrespective of the file extension?
|
|
|
Hi friends, I am trying to all the lines that has a ".c" extension using the following script,for some reason the the matching pattern "$_ =~ /^.*\.c\z/s"doesn't seem to work.Can some pls help?When i run this script nothing gets printed use strict; open FILE, "<features.txt"; my @line = <FILE>; #print "Lined that matched $find\n"; foreach (@line) { chomp(@line); if ($_ =~ /^.*\.c\z/s) { print "in f"; print "$_\n"; } } close (FILE);
(This post was edited by iphone on Aug 22, 2010, 11:55 PM)
|