Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Sep 252010
 

Delete element in a hash in Perl

Answer:

You can use the delete keyword to delete elements in a hash in Perl

my $hash = {
                "one" => 1,
                "two" => 2,
                "three" => 3
        };

delete $hash->{"two"};

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>