I always find it strange that people loop and push when often it's map or grep that's needed.
opendir(MYDIR,"dir") or die "$!\n"; @txtfiles = grep { /\.txt$/ } readdir MYDIR; closedir MYDIR;
Granted, your exposition was annotated for learning purposes.
In reply to Re^2: How to create the varibles with the file names
by duff
in thread How to create the varibles with the file names
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |