I want to write a Perl 6 program that performs the same operation on an undetermined number of files, just like how you can use rm file1.txt file2.txt file3.txt in Linux.
My code looks like this:
#!/usr/bin/env perl6
my @args = @*ARGS.perl;
for @args -> $arg {
say $arg
}
However, when I invoke it as ./loop_args.pl6 file1.txt file2.txt I get the following output: ["file1.txt", "file2.txt"]
What am I doing wrong? I just want it to be an array.