in reply to Re: global vars and one liners
in thread global vars and one liners

>perl -wMstrict -lne "@::i{ /\w+/g } = () }{ print for keys %::i" words2.txt bar baz qux foo
OK, it works (Windose)! Now c'mon, how's it work? What's that strange  }{ thingy in the middle of it all? Can you give a documentation ref. for more info on that?

Replies are listed 'Best First'.
Re^3: global vars and one liners
by ccn (Vicar) on Sep 15, 2009 at 19:21 UTC

    It is so called eskimo operator: }{

    see perldoc perlrun about -n switch
    and compare output of the following two commands

    perl -MO=Deparse -ne "$a + $b" perl -MO=Deparse -ne "$a }{ $b"
    Note: double quotes because of Windows. Linux requires single quotes for the code given