in reply to Need help stripping characters in an array please.

way 1: (Doing it late)

foreach my $file (@files) { next if $file =~ m#/CVS/#; next if $file =~ m#~#; $file =~ s#^\./##; push(@noCvsDirs, $file); }

way 2: (Doing it early)

my $full_file = ($dir eq '.' ? $file : "$dir/$file");

way 3: (Doing it early, the portable way!!)

use File::Spec (); my $full_file = ( File::Spec->canonpath( File::Spec->catfile($dir, $file) ) );

* The \ in /\~/ can be removed: /~/

* m#/CVS/# is more readable than /\/CVS\//.

* m#/CVS/# and m#~# can actually be combined into m#/CVS/|~#.