Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
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?
✍: Guest
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";
}
2013-09-03, 2139👍, 0💬
Popular Posts:
What are some advantages and disadvantages of Java Sockets? Advantages of Java Sockets: Sockets are ...
What's the output of the following program? And why? #include main() { typedef union { int a; char b...
What is XSLT? XSLT is a rule based language used to transform XML documents in to other file formats...
Explain simple Walk through of XmlReader ? In this section we will do a simple walkthrough of how to...
What is cross page posting? By default, button controls in ASP.NET pages post back to the same page ...