in reply to -s switch with -e

this is meant for program files. why not just
perl -e '$foo="bar";print $foo'
or just save the file as

#!/usr/bin/perl -s print $foo; #then in the command line #file.pl -foo=bar

Replies are listed 'Best First'.
Re^2: -s switch with -e
by jcc (Sexton) on Apr 18, 2006 at 01:39 UTC
    sorry... the impetus behind the question was this node. I was trying to wrap my mind around a solution I thought should be pretty slick but that I couldn't make work in practice.

    Thanks to everyone who helped me get my mind around this.
    Apologies to graff who's update I didn't consult in time.