Some underlining information about the operating system is needed to explain your problem. When typing the command 'df' on your terminal window, your interface to the operating system is a program called a shell. There are many shell programs ( I prefer the korn shell myself ) and each different shell program has it's own definitions of what sequences are correct.
Running your perl script under 'unix' or 'linux', your interface to the operating system is 'perl', but how 'perl' is called also matters. When your perl script calls the operating system with 'system', qx//, backticks etc., you can't be sure that perl will get the exact same results as when you typed it on the command line. Most often the results are the same or similar. (Note: This is why others have mentioned the '$', it has to be escaped to get it to the shell. But shell considerations also matter.)
This is especially true when the perl script is called from 'cron', allowing it to be called on a specific schedule.
Another approach is too change the shell to the same as your Unix system (if it is available).
Good Luck
"Well done is better than well said." - Benjamin Franklin
In reply to Re: print question
by flexvault
in thread print question
by bp4a
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |