in reply to Running a module?

#!/bin/sh eval "exec /opt/perl/bin/perl -I`dirname $0` -M`basename $0 .pm` -e ma +in $*" if $running_under_some_shell; package main; sub main { print "Hello from main\n"; } 1;

That seems to work for me.

Abigail

Replies are listed 'Best First'.
Re: Re: Running a module?
by bschmer (Friar) on Sep 19, 2003 at 15:11 UTC
    Duh, must have too much water on the brain. Now if I could just get perl to load a module that doesn't end in .pm life would be perfect.
      BEGIN{ require "Foo.baz"; Foo->import(); }
      #!/bin/sh eval "exec /opt/perl/bin/perl -I`dirname $0` -e 'require q!base!; main + ()' $*" if $running_under_some_shell; package main; sub main { print "Hello from main\n"; } 1;

      Abigail