in reply to Re: Before getopts...
in thread Before getopts...

This works on Win32:

perl -e "$$_==1 && print for sort keys %main::" -s -- -" Just" -" anot +her " -"Perl " -"hacker,"
Note the two quirks: 1) using " instead of ' and 2) cmd.exe always adds an extra newline for you.

        - tye (but my friends call me "Tye")

Replies are listed 'Best First'.
Re: (tye)Re: Before getopts...
by a (Friar) on Jan 05, 2001 at 09:13 UTC
    and no '-s' which was part of the fun. Actually, -le gives me:
    Just
    Another
    Perl
    Hacker

    and -se gets (just like -e alone):
    Just Another Perl Hacker

    Guess I'll be looking up -l now ... Oh, sets $\ to $/ so that makes sense.

    a

      But there is a -s in tye's one-liner... It wouldn't work otherwise.