Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: mutliplying each element of a list by the same number

by etj (Deacon)
on Jun 06, 2022 at 02:42 UTC ( [id://11144427]=note: print w/replies, xml ) Need Help??


in reply to Re: mutliplying each element of a list by the same number
in thread mutliplying each element of a list by the same number

perl -MPDL -e '$n=shift; print +(sequence($n)+1)*$n'

Turning the resulting ndarray into a flattened Perl list (with the list method) or structured Perl array (with the unpdl method) is left as an exercise for the reader.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11144427]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (5)
As of 2024-03-29 13:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found