| [reply] |
| [reply] |
#!/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...
Of course, that's not really useful, what I proposed there.
Despite the question being laughably shallow and lazy, I feel compelled, pnkhakre -- should you choose to read this -- at least a little bit on how to achieve your goal.
Perl isn't too difficult from most shells, when you think about it. Only, there's lots more system calls in a shell script because that's what it was designed for. Perl is more of a text processing language, which you can read all about in the relevant manual pages(you know how to find those, yes? if not- better start looking, it's pretty easy to find).
While you could just change everything, it's better to leave most things be if they work. A startup script, for example, is not likely to see much improvement if written in Perl instead of the original shell language.
But hey, it's your choice -- don't let me stop you!
~Thomas~
"Excuse me for butting in, but I'm interrupt-driven..."
| [reply] [d/l] |
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
| [reply] [d/l] |