Leo Schalkwyk wrote:
> >things. sh is better for some. Using them together blows.
> 
> I'm in favor of generality, and the idea of Inline::anything is really
> cool, but I'm having trouble imagining anything for which sh is better
> than perl. I'd be really interested an example ... perhaps I'm also
> missing some advantages you might get from Inline rather than backticks
> or
> perl -e'use Shell;print ls'

I knew I'd get called on that comment ;)

Well, I don't want to start a huge thread on this, but I've found that
if you want to use Perl to make more than a few system() calls, and be
able to branch on the return codes of those calls, it can get pretty
ugly. You might as well stick to shell. But inevitably you'll want Perl
for something. Inline whould just organize things nicely. Since you can
define functions in bash, you could do something like:

----8<----
use Inline Bash;

my $dir = shift;

grok($dir) or die "Couldn't grok $dir: $!";

__END__
__Bash__

function grok() {
    echo Grokking $1;
    # ...
}
----8<----

Inline would automatically reverse the shell return code and put STDERR
in $!. I haven't begun to think through all the details, but I do think
I'd use it more than Inline::Python ;)

Cheers, Brian


-- 
perl -le 'use Inline C=>q{SV*JAxH(char*x){return newSVpvf
("Just Another %s Hacker",x);}};print JAxH+Perl'

Reply via email to