How can I run external programs using Perl 6? (e.g. like "system" in Perl 5)

Christopher Bottoms

I can use system in Perl 5 to run external programs. I like to think of system like a miniature "Linux command line" inside Perl. However, I cannot find documentation for system in Perl 6. What is the equivalent?

Christoph

In addition to using shell or run, which replace system from Perl 5, you can also use NativeCall to invoke the libc system function.

On my Windows box, it looks like this:

use NativeCall;
sub system(Str --> int32) is native("msvcr110.dll") { * };
system("echo 42");

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

I can create filehandles to strings in Perl 5, how do I do it in Perl 6?

From Dev

How can I add an external, third-party dependency to a perl6 project?

From Dev

How can I get detailed job run info from SLURM (e.g. like that produced for "standard output" by LSF)?

From Dev

How can I translate this Perl5/PCRE to Perl 6 regex?

From Dev

How to run external command in parallel using AnyEvent and Perl

From Dev

How to run external command in parallel using AnyEvent and Perl

From Dev

How can I Run Programs on Windows Login

From Dev

how can i interact with the external file system using jquery

From Dev

How can I inspect a Perl 6 module?

From Dev

How I can create post like system using jquery

From Dev

How can I replace a single space in every entry of an aray with a tab using Perl? Can I use sed-like commands?

From Dev

How can I disable blocks of code in Perl like with #ifdef in C?

From Dev

How can I view the contents of a hash in Perl6 (in a fashion similar to the Perl 5 modules Data::Dump or Data::Show)?

From Dev

How can i run a php script on a server every month without running a cron job. e.g. using .htaccess

From Dev

How can I extract some data out of the middle of a noisy file using Perl 6?

From Dev

How to run programs with arguments like 'arg=val' (e.g. dd) in rc shell (Linux version ported from Plan9 OS)?

From Dev

How can I modify a system command used in Perl script with aliases?

From Dev

How can I install missing perl modules on an embedded system?

From Dev

How can I make Perl's system() not block?

From Dev

How can I use the Environment Modules system in Perl?

From Dev

How can I get the CPU time for a perl system call?

From Dev

How can I run multiple programs sequentially, from one solution?

From Dev

how can I run old programs from a MIPS?

From Dev

How i can create a layout in android like graph, without using any external library

From Dev

How can I run a program from bash ignoring its stdout so i can run more programs?

From Dev

how to run system command in perl script with Cygwin

From Dev

How can I execute an external commands in C/Linux without using system, popen, fork, exec?

From Dev

how can I make the uiviewcontroller visible only once during first run of the app (e.g. tutorial)?

From Dev

How can I build software using Qt 5.5 which runs on old Linux systems (e.g. RedHat 4 or RedHat 5)?

Related Related

  1. 1

    I can create filehandles to strings in Perl 5, how do I do it in Perl 6?

  2. 2

    How can I add an external, third-party dependency to a perl6 project?

  3. 3

    How can I get detailed job run info from SLURM (e.g. like that produced for "standard output" by LSF)?

  4. 4

    How can I translate this Perl5/PCRE to Perl 6 regex?

  5. 5

    How to run external command in parallel using AnyEvent and Perl

  6. 6

    How to run external command in parallel using AnyEvent and Perl

  7. 7

    How can I Run Programs on Windows Login

  8. 8

    how can i interact with the external file system using jquery

  9. 9

    How can I inspect a Perl 6 module?

  10. 10

    How I can create post like system using jquery

  11. 11

    How can I replace a single space in every entry of an aray with a tab using Perl? Can I use sed-like commands?

  12. 12

    How can I disable blocks of code in Perl like with #ifdef in C?

  13. 13

    How can I view the contents of a hash in Perl6 (in a fashion similar to the Perl 5 modules Data::Dump or Data::Show)?

  14. 14

    How can i run a php script on a server every month without running a cron job. e.g. using .htaccess

  15. 15

    How can I extract some data out of the middle of a noisy file using Perl 6?

  16. 16

    How to run programs with arguments like 'arg=val' (e.g. dd) in rc shell (Linux version ported from Plan9 OS)?

  17. 17

    How can I modify a system command used in Perl script with aliases?

  18. 18

    How can I install missing perl modules on an embedded system?

  19. 19

    How can I make Perl's system() not block?

  20. 20

    How can I use the Environment Modules system in Perl?

  21. 21

    How can I get the CPU time for a perl system call?

  22. 22

    How can I run multiple programs sequentially, from one solution?

  23. 23

    how can I run old programs from a MIPS?

  24. 24

    How i can create a layout in android like graph, without using any external library

  25. 25

    How can I run a program from bash ignoring its stdout so i can run more programs?

  26. 26

    how to run system command in perl script with Cygwin

  27. 27

    How can I execute an external commands in C/Linux without using system, popen, fork, exec?

  28. 28

    how can I make the uiviewcontroller visible only once during first run of the app (e.g. tutorial)?

  29. 29

    How can I build software using Qt 5.5 which runs on old Linux systems (e.g. RedHat 4 or RedHat 5)?

HotTag

Archive