On 5/22/25 14:39, yp...@pobox.be wrote:
Hello
When I say (‘?’) x 3
I get: (‘?’, ‘?’, ‘?’)
I don’t know what happens.
Is this a new syntax for perl
it is very old syntax (i think even back to perl4). the x operator
duplicates the left side by the count on the right side. if the left is
a scalar, the duplicates are merged into a single scalar. if the left
side is in (), it is assumed to be a list and the duplicates are merged
into a list. so what you see is a list of '?' duplicated into the list
you got. you can read more about x in perldoc perlop.
uri
--
https://uriguttman.blogspot.com/
A Long Strange Trip
A blog about computers, food, my life and silliness.
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/