IHYPRESS PROGRAMMING
Tutorials and Perl programs with code and output for beginners
Perl logo
HOME | ASP | C | CSS | GNUPLOT | HTML | JAVASCRIPT | PERL | PHP | PYTHON | RUBY | SVG
Perl ❯ Hashes
<12>
#!/usr/bin/perl -wT use CGI':standard'; use CGI::Carp qw(warningsToBrowser fatalsToBrowser); 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();
Hergestellt in Deutschland / Made in Germany
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 IHY PRESS Frankfurt am Main 60329 Deutschland