How Do I Do < Fill-in-the-blank > For Each Element In A Hash

How Do I Do < Fill-in-the-blank > For Each Element In A Hash


  • 26 Dec, 2011

    Here's a simple technique to process each element in a hash:#!/usr/bin/perl -w%days = ( 'Sun' =>'Sunday', 'Mon' => 'Monday', 'Tue' => 'Tuesday', 'Wed' => 'Wednesday', 'Thu' => 'Thursday', 'Fri' => 'Friday', 'Sat' => 'Saturday' );foreach $key (sort keys %days) { print "The long name for $key is $days{$key}.n";}

    Comments Received:
    Please give your suggestions and feedback:

2009-2016 downloadmela.com. All rights reserved.