in reply to Re^2: globing directory names with spaces
in thread globing directory names with spaces
The problem is that the contents of the files are not#!/usr/bin/perl use strict; use warnings; use File::Find; my @java_files; my $pattern = shift; if ($pattern eq '') { print "defaulting the directory to the current one\n"; $pattern = '.'; } print "$pattern\n"; find(\&wanted, $pattern); foreach my $file (@java_files) { open OUTFILE, "$file"; while(<OUTFILE>) { print "$_\n"; } } my $java_files = @java_files; print "++ Total number of java files in project = $java_files\n"; sub wanted() { if (/\.java$/i) { push(@java_files, $_); } }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: globing directory names with spaces
by Aristotle (Chancellor) on Sep 16, 2002 at 16:49 UTC |