Wildcarding in a Perl @ARGV Context?

Hello folks!

While "sedding" about again, I ran into this little conundrum du jour:

#!/usr/bin/perl

use strict;
use warnings;
use diagnostics;

@ARGV = ('./afile.dat', './*.txt');

$^I = '';
while (<>)
{
    s/Twinkies/Dinner/g;
    print;
}

When run, perl complains,

...but, of course, "afile.dat" gets its dinner in good order.

So, how would one reform the @ARGV line to process the collected textfiles scattered about on this dir as well?

Thanks a bunch :wink:

Bumping up posts or double posting is not permitted in these forums.

Please read the rules, which you agreed to when you registered, if you have not already done so.

You may receive an infraction for this. If so, don't worry, just try to follow the rules more carefully. The infraction will expire in the near future

Thank You.

The UNIX and Linux Forums.