IHYPRESS.NET
PERL
HOME | ASP | C | CSS | HTML | JAVASCRIPT | PERL | PHP | PYTHON | RUBY | SVG
Perl ❯ Hashes
<12>
#!/usr/bin/perl -wT use CGI ':standard'; use CGI::Carp qw(warningsToBrowser fatalsToBrowser); use strict; print header(); print start_html(-title => "Hashes"); my %data; %data = ('state' => 'Arizona', 'city' => 'Kingman', population => '28000', county => 'Mohave'); print "<div style='color:#0000cc;font-size:1.1em;'>"; #printing data from a hash print "The city of $data{'city'}, $data{'state'}, is located in $data{'county'} county.<br>"; #changing data in a hash $data{'city'} = "Lahaina"; $data{'county'} = "Maui"; $data{'state'} = "Hawai'i"; print "The city of $data{'city'}, $data{'state'}, is located in $data{'county'} county.<br>"; print "</div>"; print end_html();
Hashes
The city of Kingman, Arizona, is located in Mohave county.
The city of Lahaina, Hawai'i, is located in Maui county.
COPYRIGHT © 2015-2024 IHYPRESS.NET. A DIVISION OF IHY PRESS. ALL RIGHTS RESERVED.