Help I'm struggling to have these two pieces of codes do what I want it to do
With code (1) I'm trying to recursively decends into directories to find all the files that end in .jpg. With code (2) I'm trying to read in the extentionfrom the command line. -------code(1) ----------------- #!/usr/local/bin/perl -w # first example... use strict; # declarations... my @files = `ls -F`; my @jpegs; my $extension = "jpg"; foreach ( @files ){ next if /private/i; chomp; if(/\.$extension$/){ push(@jpegs, $_); } } foreach (@jpegs) { print "$_\n"; } --------------------------------------------------------- ---------code(2) #!/usr/local/bin/perl -w # first example... use strict; # declarations... my @files = `ls -F`; my @jpegs; print "Enter a file extension (e.g jpg): "; chomp(my $extension = <STDIN>); print "\n"; until ($extension =~ /^[A-Za-z]{3}$/) { print "Please enter a three letter extension. E.g jpg txt doc: "; chomp($extension = <STDIN>); print "\n"; } print "Searching for *.$extension"; foreach ( @files ){ next if /private/i; chomp; if(/\.$extension$/){ push(@jpegs, $_); } } foreach (@jpegs) { print "$_\n"; } == Brought to you by Ananzi Shopping for specials, competitions and free goodies! [http://www.ananzishopping.co.za] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]