tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 deletions
12
Task/Named-parameters/Perl/named-parameters-1.pl
Normal file
12
Task/Named-parameters/Perl/named-parameters-1.pl
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
sub funkshun
|
||||
{my %h = @_;
|
||||
# Print every argument and its value.
|
||||
print qq(Argument "$_" has value "$h{$_}".\n)
|
||||
foreach sort keys %h;
|
||||
# If a 'verbosity' argument was passed in, print its value,
|
||||
# whatever that value may be.
|
||||
exists $h{verbosity}
|
||||
and print "Verbosity specified as $h{verbosity}.\n";
|
||||
# Say that safe mode is on if 'safe' is set to a true value.
|
||||
# Otherwise, say that it's off.
|
||||
print "Safe mode ", ($h{safe} ? 'on' : 'off'), ".\n";}
|
||||
3
Task/Named-parameters/Perl/named-parameters-2.pl
Normal file
3
Task/Named-parameters/Perl/named-parameters-2.pl
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
funkshun
|
||||
verbosity => 3, password => 'foobie blech',
|
||||
extra_lives => 3, '42' => 'answer', password => 'joshua';
|
||||
Loading…
Add table
Add a link
Reference in a new issue