Bob,
I got it from "Perl Black Book" by S. Holzner, section on globs.  Very very 
good book to learn Perl from, extremely easy to read, excellent for 
beginners and I'm not going to know this for a long while but I think it is 
an excellent book for intermediate Perl dudes too.  End of section reads 
like this:
________________
Let me give you a useful hint: Using the glob function internally, Perl 
allows you to write expressions like this, which will print the names of 
the files with the extension .txt:

while (<*.txt>) {
         print;
}
________________



> > while(<*.txt>)
> > {
> > ### do stuff, given a filename
> > }
>
>Use glob():
>
>    my $patterns = '*.txt *.this *.that';
>    for (glob($patterns)) { ... }
>
>P.S. I'm surprised this works with while(). I didn't realize fileglobs
>were magical inside while(), but it appears they are... Is this documented?
>
>--
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to