This is an XY Problem. You are using basename correctly. Try changing print "$file\n"; to push @Files, $file; and adding my $file = join(' ', @Files); just before line 24. Meditate upon those changes and you will gain understanding.
In reply to Re: using basename on a list of filesnames
by jcb
in thread using basename on a list of filesnames
by flieckster
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |