No, it's not as complicated, €, ¥, £ and ¢ are currency symbols like $. A simple €arr is a scalar which is meant to hold a array_ref. It's identical to $arr! Unlike @arr which has another place in the symbol table, changing $arr also means changing €arr (or ¥arr, there is no typechecking *). Just the dereferencing syntax is different!
€one = @two; @one = €two; @one = @two; €one = €two; €one = \@two; # is translated to $one = @two; @one = $two; @one = @two; $one = $two; $one = \@two;

> Suppose you have this @¥hash{foo,bar}[2], what does the @ belong to? Is it @{¥hash{foo,bar}}[2] or @{¥hash{foo,bar}[2]}?

the grouping of @€[..] is indented to be the opposit of @$[..], that means "listyfy" the biggest possible part, so it is @ {¥hash{foo,bar}[2]}.

Think of it as

sub aref2list ($) { return @{ $_[0] } } aref2list($hash->{foo,bar}[2]);

The first alternative can be achieved as you typed it @{¥hash{foo,bar}}[2] which is identical with  @{ $hash->{foo,bar} }[2]. You can still use curlies for grouping, just the default grouping was changed. and if you want the old default behavior just write  @$hash{foo,bar}[2].

Some remarks::

1. I'd prefer to get rid of this old multi-dimensional hash syntax. With the new sigils there is no need anymore to use it. If we abandon it we can use the notation for slices.

2. I'm not sure anymore if using @€ and %¥ this way is a good choice ... maybe better *€ and *¥, which is closer to perl6. ( or identical? I can't tell ...)

> P.S.: You said you are sometimes using _cref ... looks like you'd need (at least) one more sigil.

Yes, and I think ¢ is a good choice! 8 ) but the benefit of writing  ¢coderef(paras) instead of  $coderef->(paras) alone doesn't justify this discussion. That's why I'm focussing on arrays and hashes!

Cheers Rolf

PS: There seems to be a bug in the board's software. Occasionally previewing ¥ is translated to Â¥ by the cgi. Can't reproduce when and why! I have to correct every symbol manually! : (

UPDATE: (*) To be precise, i can't realize typechecking with a codefilter, but I think it's worth thinking about a runtime typechecking and warning, if the scalar in €arr is an array_ref or not. A (slow) solution could be achieved with tieing the scalar and checking with ref when STORE is called.


In reply to Re^6: Two more Features Perl 5 Maybe Needs by LanX
in thread Five Features Perl 5 Needs Now by Arunbear

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.