in reply to qx and $!
On a Mac, it prints nothing.
However, if you change this to:
qx executes the system's date command and returns it as a quoted string. $! refers to the last error thrown by a statement that isn't in an eval block.
Why it's a 'Bad file descriptor' or 'Illegal seek' is interesting. I don't know. I suspect, however, that this is what you really wanted to know when you posed this question. (?)
At any rate... I'd like to know. I'll test it tomorrow on a Linux system, since my Mac doesn't seem to freak out on an unset $!.
However, if you change this to:
... you'll get the date printed on the command line.perl -e 'print qx(date);'
qx executes the system's date command and returns it as a quoted string. $! refers to the last error thrown by a statement that isn't in an eval block.
Why it's a 'Bad file descriptor' or 'Illegal seek' is interesting. I don't know. I suspect, however, that this is what you really wanted to know when you posed this question. (?)
At any rate... I'd like to know. I'll test it tomorrow on a Linux system, since my Mac doesn't seem to freak out on an unset $!.
Bro. Doug :wq
In Section
Seekers of Perl Wisdom