Jeff 'japhy' Pinyan wrote:

> Second, you probably want to glob():
>
>   while (glob "xyz_*") {
>     open FILE, $_ or die "can't read "$_: $!";
>     # do stuff with FILE
>     close FILE;
>   }
>
> Or use the magic of @ARGV:
>
>   {
>     local @ARGV = glob "xyz_*";
>     while (<>) {
>       # do stuff with each line of the file(s)
>     }
>   }
>
> Notice that glob() returns ONE filename at a time when called in scalar
> context (like $x = glob(...) or while (glob(...))) but all of them when
> called in list context (like @files = glob(...)).

Aaah it work like a charm and I must say it was a lot more beautiful than my
solution which was using system calls...:
@PROVSKOTTSFILER = `ls provskott_*`;

foreach $n (@PROVSKOTTSFILER) {
open (INPUT, "$n") || die "Nope\n"

thx
/Håkan

Reply via email to