Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: split string and always get last word

by AnomalousMonk (Archbishop)
on Aug 14, 2021 at 16:42 UTC ( [id://11135845]=note: print w/replies, xml ) Need Help??


in reply to Re: split string and always get last word
in thread split string and always get last word

... $#array ... gives the index number of the last element in @array. That is (generally) different than scalar @array which returns the number of elements in @array.

TWIMC: Of historical interest: The single circumstance in which $#array will not be different than scalar @array (i.e., @array evaluated in scalar context) is when the array base $[ is set to 1. This is no longer possible, and wasn't a good idea when it was possible.

See $[ in Deprecated and removed variables in perlvar for gory details.


Give a man a fish:  <%-{-{-{-<

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2026-04-14 12:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.