in reply to Running External Commands
The best way (to my knowledge) to do that is to use backticks, assigning the
result to a scalar (the output doesn't have to be a single line,
or a single word or anything.
For example:
You should be very careful though, if you decide to pass to the command options from the user's input (for example through a CGI script). But that's a fact, either you use backticks or system.$result=`/bin/tail -15 /var/adm/messages`;
|
---|
Replies are listed 'Best First'. | |
---|---|
RE: Re: Running External Commands
by ivey (Beadle) on Jun 06, 2000 at 18:38 UTC |
In Section
Seekers of Perl Wisdom