faber has asked for the wisdom of the Perl Monks concerning the following question:

Hi guys, I'm not sure if this has been asked, the signal to noise ratio on the various search engines I've tried is not good for answering the question... Anyways. I want to correct user behaviour like this: sh ./something.pl with something.pl being a perl script.

Replies are listed 'Best First'.
Re: Correcting user behaviour?
by FalseVinylShrub (Chaplain) on Feb 05, 2011 at 01:03 UTC

    Hi

    You mean, something like this:

    #!/usr/bin/perl eval 'exec /usr/bin/perl -wS $0 ${1+"$@"}' if $running_under_some_shell;

    ?

    See Running Under Some Shell for details.

    FalseVinylShrub

    Disclaimer: Please review and test code, and use at your own risk... If I answer a question, I would like to hear if and how you solved your problem.

Re: Correcting user behaviour?
by Anonymous Monk on Feb 05, 2011 at 00:04 UTC
    Anyways. I want to correct user behaviour like this: sh ./something.pl with something.pl being a perl script.

    Um, shebang

      shebang is ignored in my example.
        You didn't really give an example that I can see. Can you be a little more explicit about what behavior you're trying to correct? Just what is it that the user has done that you think is wrong?
        So what?