Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
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 examining the Monastery: (13)
As of 2014-12-19 14:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (84 votes), past polls