πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Uri Guttman Thu, 22 May 2025 18:46
Re: Duplicates list
#1
Author: Uri Guttman
Date: Thu, 22 May 2025 18:46
22 lines
5082 bytes
On 5/22/25 14:39, ypeng@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.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads