1 2 3 4 5 6 7 8 9
sub href{ return{('key','val')}; } sub aref{ ['key','val']; } print Dumper href(), aref();
1
2
3
4
5
perl -E "sub foo { { ('key', 'value') } }; say foo(); "
keyvalue
perl -E "sub foo { { 'key', 'value' } }; say foo(); "
HASH(0x4592f8)
1 2 3 4 5 6 7 8 9 10 11 12
# Wochentag numerisch {num}, # abgekürzt{abb}, voll{full} sub wd{ my $self = shift; my $day = shift; my $month = shift; my $year = shift; return {split /\s+/, strftime( 'num %w abb %a full %A', 0, 0, 0, $day, $month-1, $year-1900 )}; }
1 2 3 4 5 6 7 8 9 10
sub wd { my $self = shift; my $day = shift; my $month = shift; my $year = shift; +{split /\s+/, strftime( 'num %w abb %a full %A', 0, 0, 0, $day, $month-1, $year-1900 )}; }