in reply to Re^3: Two more Features Perl 5 Maybe Needs
in thread Five Features Perl 5 Needs Now
But I bet the non-reference character of @array will be the number one or at least on top three.
Almost every propaganda against perl I've seen so far lists this as a problem, and I haven't met any perl hacker til now, who didn't run into this trap.
I just wanted to propose extended sigils helping to destroy this argument without breaking compability like perl6 does.
And these sigils can be seen as a replacement of the PBP-rule to flag every reference variable with a trailing "_ref".
Which symbols to choose for these sigils is a matter of debate, since the characters less than 128 are already overloaded with syntactical meaning. Especially € is mapped on different positions.
UPDATE:
I know some people who decided only to use refs of arrays and hashes to avoid these problems. I tried this myself, but it's not that easy. e.g. you cant write push $arr_ref, expr;, slices with -> are not possible $arr_ref->[1..5] and nested structures need to be put in parens to get the listform:compare this withfor ( @{ $arr_ref->[idx1][idx2] } ) { ... }
(*) prototype mechanism has to be extended for this.push €arr, expr; # (*) €arr[1..5]; for ( @€arr[idx1][idx2] ) { ... };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Two more Features Perl 5 Maybe Needs
by jdporter (Paladin) on Dec 21, 2008 at 19:38 UTC | |
by chromatic (Archbishop) on Dec 21, 2008 at 20:39 UTC | |
by jdporter (Paladin) on Dec 21, 2008 at 20:57 UTC | |
by Lawliet (Curate) on Dec 21, 2008 at 20:23 UTC | |
by LanX (Saint) on Dec 21, 2008 at 20:00 UTC | |
by jdporter (Paladin) on Dec 21, 2008 at 20:50 UTC | |
by LanX (Saint) on Dec 21, 2008 at 21:34 UTC |