in reply to Re^2: Different meanings of $0 under the same operating system
in thread Different meanings of $0 under the same operating system

Ahh, but it is ... since, when used as a file name, '-' is an alternative id for stdin - witness most of the *NIX filter commands e.g. sort, join et al

A user level that continues to overstate my experience :-))
  • Comment on Re^3: Different meanings of $0 under the same operating system

Replies are listed 'Best First'.
Re^4: Different meanings of $0 under the same operating system
by JavaFan (Canon) on Nov 04, 2009 at 08:23 UTC
    That many *NIX filter commands take '-' to be STDIN is an application convention. It's not something either the OS, or any of the standard libraries treat as special. In perl < foo, - isn't passed as an argument to any function of the exec family. It's not UNIX that is 'locating' the script.
Re^4: Different meanings of $0 under the same operating system
by ikegami (Patriarch) on Nov 04, 2009 at 02:36 UTC

    I don't see your point. Are you saying opening '-' should give me the script, or are you saying that opening '-e' would normally give me the command line arguments?

    >perl -le"print $0" -e >perl -lE"print $0" -e