Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: "Chop" problems

by hossman (Prior)
on Oct 12, 2002 at 06:10 UTC ( [id://204738]=note: print w/replies, xml ) Need Help??


in reply to "Chop" problems

PS, perldoc is your friend...


laptop:~> perldoc -f chop

chop VARIABLE
chop LIST
chop    Chops off the last character of a string and
        returns the character chopped.  It is much more
        efficient than "s/.$//s" because it neither scans
        nor copies the string.  If VARIABLE is omitted,
        chops $_.  If VARIABLE is a hash, it chops the
        hash's values, but not its keys.

        You can actually chop anything that's an lvalue,
        including an assignment.

        If you chop a list, each element is chopped.  Only
        the value of the last "chop" is returned.

        Note that "chop" returns the last character.  To
        return all but the last character, use "sub-
        str($string, 0, -1)".

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://204738]
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: (4)
As of 2024-04-20 00:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found