http://www.perlmonks.org?node_id=948824


in reply to Loop Break

Check to see if your code is what you thought it was, using B::Deparse (Tip #6 from the Basic debugging checklist) :
use File::Glob (); foreach $file (glob('*.*')) { if ($file =~ /\.c/) { $filename = $file; print /$filename\n/; } }
As Anon points out, you're really using m///