> I want to match files that have no period in their filename. > > So far I have: > > use strict; > use warnings; > > my $start_dir = $ARGV[0] || "."; > use File::Find; > print "Temp file list:\n"; > find sub { > return unless -f; > my $file=$File::Find::name; > if( $_ =~ /[^.]/) { > print "$file\n"; > } > }, $start_dir; > > I'm getting mixed up with the character class: if I have [.] > it matches only the files with a dot; [^.] matches everything. > > What am I doing wrong?
Hi The error lies in the '[^.] matches everything' - that is not true - it matches everything that contains one character other than a period/dot. Your if-statement should probably look like this: if( $_ =~ /^[^.]+$/) { - this should match anything where the entire filename has no periods in it. /Henning _______________________________________________ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs