pnkhakre has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: bash script to perl script
by Anonymous Monk on Oct 19, 2013 at 03:40 UTC
Re: bash script to perl script
by marto (Cardinal) on Oct 19, 2013 at 09:59 UTC
Re: bash script to perl script
by thomas895 (Deacon) on Oct 20, 2013 at 08:29 UTC

    It's easy! Just use magic like so:

    #!/usr/bin/perl use strict; use warnings; # ^^ part of every spell system("/path/to/script");

    Wow! It really is that easy! Now just skip past this unobtrusive black box below if you like the simplicity...

    ~Thomas~ 
    "Excuse me for butting in, but I'm interrupt-driven..."
      I wrote a much better translator. It's self-contained:
      #!/usr/bin/perl use strict; use warnings; my $pipe; open $pipe, '|-', '/bin/sh'; while (<DATA>) { print $pipe $_; } close $pipe; __DATA__ echo "hello world" for i in 1 2 3 4; do printf "this is iteration %d of the loop\n" $i done