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 learn perl properly, and until you
do you will not be happy programming perl.
> my (@filenames, @files);
> for my $file (@files) {
> # my $filename = "$directory/*$file";
>
> # print "$filename\n";
>
>
> @files = <$directory/*$file> or die $!;
> print @files . "\n";
> push @filenames, @files;
> }
>
> $ ips.pl
> 29
> 41
--
Paul Johnson - [email protected]
http://www.pjcj.net
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/