Re: What does "}{" mean?

Stefan Stiasny <[email protected]>
Newsgroups gmane.comp.lang.perl.fun
Organization Legion of Dynamic Discord
Message-ID <[email protected]>
On Fri, Feb 06, 2004 at 09:45:43AM -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?

from the perlrun manpage:

 -p   causes Perl to assume the following loop around your
      program, which makes it iterate over filename argu­
      ments somewhat like sed:

      LINE:
         while (<>) {
            ...             # your program goes here
         } continue {
             print or die "-p destination: $!\n";
         }

cheers
sc

-- 
stefan stiasny <[email protected]> 
In an evolving universe, who stands still moves backwards.
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.