in reply to bash script to perl script

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..."

Replies are listed 'Best First'.
Re^2: bash script to perl script
by Anonymous Monk on Oct 21, 2013 at 14:04 UTC
    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