in reply to Should options in the shebang line generally behave like switches given in the commandline?

From my point of view switch processing should be the same in both cases.
There are subtle differences between switches given on the command line, and given on the she-bang line. Switches given on the command line are passed to the perl process when the process starts, using the normal OS way of passing arguments using one of the exec calls. They can be processed beforing doing anything else. Not so for switches on the she-bang line - then perl has to already open a stream for instance. This means for instance that you cannot give a -C on the she-bang line, unless you give it on the command line as well. And there are also subtle differences between perl foo and ./foo when it comes to switches (Too late for "-T" option for instance).

As for the -d switch, I don't know enough of the debugger to be of any help there.

  • Comment on Re: Should options in the shebang line generally behave like switches given in the commandline?
  • Select or Download Code

Replies are listed 'Best First'.
Re^2: Should options in the shebang line generally behave like switches given in the commandline?
by ikegami (Patriarch) on Jan 29, 2010 at 15:56 UTC

    This means for instance that you cannot give a -C on the she-bang line

    There's no reason for -C not to work from the shebang line. It's a known bug noone's gotten around to fixing yet.