Replace \$list with a file name - it's as simple as that. See the documentation for open.
The \$list syntax allows a string to be used as a file and is an excellent way of providing a "file" in a small stand alone sample script.
Generally if you don't understand everything that is going on in a script you should read the documentation (in this case "perldoc -f open" would help), or ask someone. Simply copying code you don't understand is "cargo culting" and is an excellent way of getting into bad habits and wasting a lot of time.
In reply to Re: list from file
by GrandFather
in thread list from file
by persianswallow
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |