http://www.perlmonks.org?node_id=1064973


in reply to Sanity check: Tiny wrapper script for /bin/mail

looks reasonable, but couldn't you just use exec on a one liner?

perl -e "exec('/bin/mail',@ARGV) if @ARGV";

Replies are listed 'Best First'.
Re^2: Sanity check: Tiny wrapper script for /bin/mail
by Corion (Patriarch) on Nov 29, 2013 at 15:33 UTC

    I thought the same, but the idea is to see if input is available on STDIN, not @ARGV :-).

      Doh! Well spotted -- I completely missed that, sorry for the noise.

        Not to worry, I tried quite a few... less thought out approaches myself. My wrapper script could ofcourse be golfed down to a completely unreadable oneliner but I decided to go for readability instead. My co-workers are creative bastards and would certainly come up with a way to get back at me. :-)

        -- FloydATC

        Time flies when you don't know what you're doing