new tasks
This commit is contained in:
parent
2a4d27cea0
commit
80737d5a6a
1194 changed files with 15353 additions and 1 deletions
18
Task/Collections/Perl/collections.pl
Normal file
18
Task/Collections/Perl/collections.pl
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
use strict;
|
||||
my @c = (); # create an empty "array" collection
|
||||
|
||||
# fill it
|
||||
push @c, 10, 11, 12;
|
||||
push @c, 65;
|
||||
# print it
|
||||
print join(" ",@c) . "\n";
|
||||
|
||||
# create an empty hash
|
||||
my %h = ();
|
||||
# add some pair
|
||||
$h{'one'} = 1;
|
||||
$h{'two'} = 2;
|
||||
# print it
|
||||
foreach my $i ( keys %h ) {
|
||||
print $i . " -> " . $h{$i} . "\n";
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue