programming-examples/perl/Statement/Using while loop with each.pl

15 lines
216 B
Perl
Raw Normal View History

2019-11-15 12:59:38 +01:00
#!/usr/bin/perl -w
use strict;
my %where = (
G => "A",
L => "B",
I => "C",
S => "D"
);
my($k, $v);
while (($k, $v) = each %where) {
print "$k lives in $v\n";
}