in reply to -s switch with -e

Since noone explained the solution, I will:

Perl will absorb everything that starts with a dash until it meets something that doesn't start with dash or until it meets "--". The code attached to -e is considered part of -e, so it doesn't interrupt the scanning for options.

-s scans whatever is left would otherwise go to @ARGV.

Interpreted as perl options vv vvvvvvvvvv vvvvvv perl -s -e "print" -foo=a a b ^ ^ @ARGV, which -s scans Interpreted as perl options vv perl -s script.pl -foo=a a b ^^^^^^ ^ ^ @ARGV, which -s scans Interpreted as perl options vv vvvvvvvvvv vv perl -s -e "print" -- -foo=a a b ^^^^^^ ^ ^ @ARGV, which -s scans