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

Re^3: Replacing values in an array

by muba (Priest)
on Jan 27, 2013 at 05:17 UTC ( #1015561=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    # Define an array:
    my @basket = qw(apple banana cherry);
    ...
    # Change an element:
    $basket[1] = "date";
    print "Now it is $basket[1]\n";
    
  2. or download this
    # Define the hash:
    my %basket = (
    ...
    # Getting rid of an element:
    delete $basket{apple};
    print "Fruits in my basket: ", join(", ", sort keys %basket), "\n";
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2015-07-08 06:55 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 (96 votes), past polls