Re: What does "}{" mean?

Ian Phillipps <[email protected]>
Newsgroups gmane.comp.lang.perl.fun
Message-ID <[email protected]>
On Fri, 06 Feb 2004 at 09:45:43 -0500, [email protected] wrote:

> What does the construct "}{" mean?  As in
>   $ perl -pe ' } { $_="foo\n"' /dev/null
>   foo

> I figure it has to do with how the -p switch affects the script that
> is passed to the interpreter.  Is this documented anywhere?

Yes, in perlrun under "-p" (And -n)

Where it says that your program is surrounded by a loop, take that
absolutely literally. Write out your program inside the loop, and the
meaning of '}{' will become apparent - if not necesssarily clear :-)

Ian
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.