Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
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?
[choroba]: Yes, "tynovsky" there is my friend and ex-colleague, I needed to beat him at Fibonacci :-)

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (9)
As of 2017-10-20 09:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (260 votes). Check out past polls.

    Notices?