in reply to Re: Fileglob in scalar context question
in thread Fileglob in scalar context question
While you are probably right about being confused about "the stuff between the angles", the original program did have a wild card in it. In the first pass through the loop, it would look like </home/scott/manydirs/0/*test.txt>.
However, on thinking about this problem more, I think I would rewrite the code to look like this:
Which is probably what I would have done if I was doing this from scratch, but when presented with another's code, it is often hard to think of the "right" thing to do right away.#!/usr/bin/perl -w use strict; my @EXON_IN = </home/scott/manydirs/[0-9]*/*test.txt>; foreach my $file (@EXON_IN){ #do whatever it was my coworker wanted to do #Greg, are you looking? }
Thanks,
Scott
|
|---|