Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Need help with range expression ('0 .. -0.5' === '0 .. 0.5')

by 1nickt (Canon)
on Feb 23, 2019 at 18:48 UTC ( [id://1230475]=note: print w/replies, xml ) Need Help??


in reply to [SOLVED]: Need help with range expression ('0 .. -0.5' === '0 .. 0.5')

Try this?:

push @array, reverse @array[ $n > 2 ? 0 .. $n / 2 - 1 : 0 ];

Edit: no, try this:

push @arr, $#arr < 1 ? () : reverse @arr[ 0 .. ($#arr % 2 ? $#arr : $# +arr - 1)];


The way forward always starts with a minimal test.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (2)
As of 2024-04-20 13:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found