Skip to content

Commit

Permalink
Add basic example of qx// on perlop.pod
Browse files Browse the repository at this point in the history
The page never gives a basic example. Only non-basic examples.

Yes, date will look different per locale. Please use a better example if you want.
  • Loading branch information
jidanni authored and khwilliamson committed Feb 2, 2024
1 parent 2787b24 commit 4f449b1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pod/perlop.pod
Original file line number Diff line number Diff line change
Expand Up @@ -2467,6 +2467,8 @@ list of lines (however you've defined lines with C<$/> or
C<$INPUT_RECORD_SEPARATOR>), or an empty list if the shell (or command)
could not be started.

print qx/date/; # prints "Sun Jan 28 06:16:19 CST 2024"

Because backticks do not affect standard error, use shell file descriptor
syntax (assuming the shell supports this) if you care to address this.
To capture a command's STDERR and STDOUT together:
Expand Down

0 comments on commit 4f449b1

Please sign in to comment.