Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^3: Replacing values in an array

by muba (Priest)
on Jan 27, 2013 at 05:17 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1015561]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-04-18 00:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found