quote qqx
Documentation for quote qqx
assembled from the following types:
language documentation Quoting Constructs
From Quoting Constructs
(Quoting Constructs) quote qqx
If one wishes to use the content of a Perl 6 variable within an external command, then the qqx
shell quoting construct should be used:
my = "there";say ; # OUTPUT: «hello there»
Again, the output of the external command can be kept in a variable:
my = "cool";my = "-i";my = "/usr/share/dict/words";my = ;# runs the command: grep -i cool /usr/share/dict/wordssay ; # OUTPUT: «CooleyCooley'sCoolidgeCoolidge'scool...»
See also run and Proc::Async for better ways to execute external commands.