Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: finding and deleting item from an array

by srawls (Friar)
on Jul 01, 2001 at 05:24 UTC ( #92965=note: print w/ replies, xml ) Need Help??


in reply to finding and deleting item from an array

You're almose there, just add a one after that comma after $p. The splice would then look like this:

splice @picturelist, $p, 1;
The 1 in the above splice is used as a length; it tells how many elements to delete. To learn more about splice, just click one of the multiple links in the above paragraph.

Update: Well, I was concentrating on your syntax, tachyon provides a much more idiomatic answer; I'd go with his if I were you

The 15 year old, freshman programmer,
Stephen Rawls


Comment on Re: finding and deleting item from an array
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (11)
As of 2015-07-01 22:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (24 votes), past polls