scripting - More precedence- Shebang line or perl command? -


i have multiple perl scripts shebang line outdated. thats is, shebang points older version of perl.

old per path:

#!/data/oracle10.0/perl/bin/perl 

the new version of perl in

#!/data/**oracle11.0**/perl/bin/perl 

i have softlinked perl command location of new version of perl.

perl -> /data/oracle11.0/perl/bin/perl 

now, shebang points older version , perl command points newer version.

so, when perl sample.pl, shebang gets ignored.

i wrote sample scripts see that. seems shebang line ignored when used perl command. remember not case older version of perl (shebang considered on perl command).

so question is, did new version of perl(5.10) , older version (5.8) have different behaviour respect shebang line? new version of perl ignore shebang line if perl command passed it?

when run perl myscript.pl starts perl binary , gives myscript.pl input, runs. in case, always first perl binary $path, regardless of perl version. mpapec said in comment, can determine perl using command which perl.

when run ./myscript.pl shell looks shebang line and, if 1 present, executes program listed in shebang , gives file contents input. (if not, shell attempts process file's contents.) in case, always perl @ path shebang, again regardless of perl version.

this basic *nix behavior , has not changed between perl versions (because it's not managed perl in first place).


Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -