On Fri, 18 Feb 2005, Lucio Crusca wrote: > What I need is to call an external executable passing a filename as > the only argument and then returning its output to the caller of the > perl script, e.g: > > $reply=`myfilter.sh $filename`; > print $reply; > > Is the above code correct for my purpose (assuming $filename is defined)?
Sure, I guess, but you've reduced the code so much that there doesn't seem to be much point to use Perl at all. Are you using this -- #!/usr/bin/perl $filename="..."; $reply=`myfilter.sh $filename`; print $reply; -- when you could be using this -- #!/bin/sh filename="..." myfilter.sh $filename -- ? Or does this SMTP server really force you to wrap that in Perl code? (That said, a name like "myfilter.sh" implies that you're comfortable with Bourne shell scripting, and Perl really isn't very different from that -- it offers most of the same functionality, many of the same keywords and constructs, and is much more flexible. Learning Perl shouldn't be such a big leap for anyone comfortable with shell scripting, and in the long run, it *will* make your life easier.) -- Chris Devers -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>