Perl Home
PERL Functions
© 2011 TutorialsPoint.COM
|
PERL qx(EXPR) Function
Syntax
Definition and Usage
qx() is a alternative to using back-quotes to execute system commands. For example, qx(ls -l) will execute the UNIX ls command using the -l command-line option. You can actually use any set of delimiters, not just the parentheses.
Return Value
Example
Try out following example:
#!/usr/bin/perl -w
# summarize disk usage for the /tmp directory
# and store the output of the command into the
# @output array.
@output = qx(du -s /tmp);
print "@output\n";
|
It will produce following results:
|

|
|
|