http://qs1969.pair.com?node_id=468506


in reply to Re: /usr/bin/perl -w?
in thread /usr/bin/perl -w?

For this very reason, I recommend that you end the shebang line with --.

Replies are listed 'Best First'.
Re^3: /usr/bin/perl -w?
by ysth (Canon) on Jun 20, 2005 at 23:00 UTC
    Some people take the approach of creating a "/usr/bin/perl\r" link to /usr/bin/perl :)

      That works when you're root. It doesn't work when you're just an average user.

      Even as root on multi-user systems, I'd rather not give the users training wheels, as it teaches them to be sloppy, and to learn to do things wrong. (Like when I had to explain to someone that 'rm *' doesn't prompt you for which files to delete on every unix system... but the sysadmin on the system they learned had aliased 'rm' to 'rm -i')

Re^3: /usr/bin/perl -w?
by kaif (Friar) on Jun 21, 2005 at 06:20 UTC

    And Unix commands in general, too! Because of shell design and such, typing rm * in a directory which contains a file named -rf could delete everything (except the file -rf)! You should do rm -- * instead. I have actually been bitten by this once or twice, but luckily not by -rf but something more mundane.

      I've seen some people use this to their advantage too, by creating files called '-i' in directories containing things they don't want to lose. That way an inadvertant rm * will become interactive.


      We're not surrounded, we're in a target-rich environment!