programming-examples/perl/Hash/List context and hash context.pl

15 lines
257 B
Perl
Raw Normal View History

2019-11-15 12:59:38 +01:00
#!/usr/bin/perl -w
use strict;
my %person = (
name => 'Joe',
age => 13,
phone => '555-1212',
city => 'Chicago'
);
my @data = %person;
print "list context: ", join("|", @data), "\n";
print "another way: ", %person, "\n";