Re: perl glob returning number

2010-06-25 Thread John W. Krahn
Noah wrote: Hi there, Hello, why is the perl glob command returning a number and not the filenames? my (@filenames, @files); You are creating a new variable named @files which will be empty. for my $file (@files) { Because @files is empty this loop will not execute and *nothing* will

Re: perl glob returning number

2010-06-25 Thread Paul Johnson
On Fri, Jun 25, 2010 at 02:56:34PM -0700, Noah wrote: > Hi there, > > why is the perl glob command returning a number and not the filenames? It's not, it's just the way you are printing it. Try changing that dot to a comma, or C< print "@files\n"; > You need to understand context in order to le

perl glob returning number

2010-06-25 Thread Noah
Hi there, why is the perl glob command returning a number and not the filenames? my (@filenames, @files); for my $file (@files) { #my $filename = "$directory/*$file"; #print "$filename\n"; @files = <$directory/*$file> or die $!; print @files . "\n"; push @filenames, @f