Re: "Secret" operators

[email protected] (Vladi Belperchinov-Shabanski)
Newsgroups perl.fwp
Organization CSA
Message-ID <[email protected]>
On Tue, 1 Feb 2005 15:57:33 +0100
[email protected] (Philippe 'BooK' Bruhat) wrote:

> 
> There's also @{[]} but I don't know f it has a name.
> 
> Usage: print "splatt @{[ ... ]} pow"
> where ... is any valid expression, and the result list is join()ed with $"
> (space).

[] construct reference to anonymous array, @{} dereferences the array ref. 
finally the array is interpolated inside string.

it is equal to:

  @a = ( 1, 2, 3 );
  print "splatt @a pow";

the only use is to force array context inside string:

  %a = ( 1, 2, 3 );
  print "splatt @{[%a]} pow";
  
but don't think it is usefull (except obfuscation bonus:))

--
Vladi Belperchinov-Shabanski <[email protected]> <[email protected]>
Personal home page at http://cade.datamax.bg/
DataMax SA   http://www.datamax.bg
there is still one truth on which we can depend
we've started something we can never end
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.