Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Array element deletion

by perlinux (Deacon)
on May 04, 2004 at 13:22 UTC ( [id://350328]=note: print w/replies, xml ) Need Help??


in reply to Array element deletion

Try this:
UPDATE:
@a=('a','b','c','a','b'); @a=reverse(@a); pop(@a); @a=reverse(@a); print @a'
i.e.:
shift(@a);
Hypnotic? :-)

Replies are listed 'Best First'.
Re: Re: Array element deletion
by halley (Prior) on May 04, 2004 at 13:36 UTC
    While you were hypnotized, you completely missed the point of the OP's question. Given a certain value, remove the first occurrence of it in an array.

    --
    [ e d @ h a l l e y . c c ]

      That's a generalization that may or may not be true. The op may want all but the last of a certain character removed, or the first (or all but the last) of every duplicated character.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (2)
As of 2024-04-16 10:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found