or$ perl -we 'print "$_\n" for < a b c >;' a b c
my $array_ref = [< 1 2 3 4 5 >];
Playing around with it a bit, I found out that even things like
seem to work (as long as what is inside the angle brackets does not look too much like a file handle).use Data::Dump < pp >;
It seems like < ... > works a lot like qw(...) in that there are no commas needed to separate the parts, but also a bit like qq(...) (or plain "...") in that variables are substituted. Like in this example:
$ perl -we 'use Data::Dump < pp >; $x="foo"; pp <a 2 $x b>;' ("a", 2, "foo", "b")
I am wondering why I have never seen this syntax in any literature (or do I just get old and forget things?).
I would therefore like to ask for enlightenment about where to find any documentation about this syntax.
(A pointer to a relevant section of https://perldoc.perl.org/ would be much admired!).
Thank you for your help!
In reply to Can't find any documentation on < a b c > syntax for lists by muthm
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |