Re: What does "}{" mean?

Michael W Thelen <[email protected]>
Newsgroups gmane.comp.lang.perl.fun
Message-ID <[email protected]>
* Leo <[email protected]> [2004-02-07 13:22]:
> > Golfers also use the fact that in a -p/-n program the next character 
> > is a ;, for example 
> 
> What do you mean by 'the next character is a ';''?

As some others have pointed out, not only is the loop literally constructed
around your code, but a semicolon is also inserted.  That is why the "print q"
trick works, and it's also why you can omit the final semicolon of @; at the
end of Ton's example program:

> > #!perl -alp0
> > s!.+!$;[@$z{$&,$_}=%$z]=$z=$_.$&for@F,@F!eg;$_=pop@

-- Mike

-- 
Michael W. Thelen
A satirist is a man who discovers unpleasant things about himself and then
says them about other people.
                -- Peter McArthur
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.