In general, shell builtin commands are only meaningful in the context of an interactive shell, so trying to use them from within a perl script usually won't make sense. Note that each "system()" call in perl invokes a new, distinct shell process that executes whatever command is passed in the call, so there is no shell command history in that context -- in other words, even if the "history" builtin works from within the system call, it will just return an empty result.
Maybe if you provide a snippet of your code, and/or some more detail about what you're trying to accomplish, someone here can suggest a simple way to do what you want.
As a wild guess at that, I wonder if maybe your current perl script is executing a bunch of system calls, and you want to log the all of them; why not just open a log file at the start of the script, and each time you make a system call, print a line to that log?
In reply to Re: help on system function
by graff
in thread help on system function
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |