Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
4
Task/Inverted-syntax/Perl/inverted-syntax-1.pl
Normal file
4
Task/Inverted-syntax/Perl/inverted-syntax-1.pl
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
if ($guess == 6) { print "Wow! Lucky Guess!"; }; # Traditional syntax
|
||||
print 'Wow! Lucky Guess!' if $guess == 6; # Inverted syntax (note missing braces and parens)
|
||||
unless ($guess == 6) { print "Sorry, your guess was wrong!"; } # Traditional syntax
|
||||
print 'Huh! You Guessed Wrong!' unless $guess == 6; # Inverted syntax
|
||||
4
Task/Inverted-syntax/Perl/inverted-syntax-2.pl
Normal file
4
Task/Inverted-syntax/Perl/inverted-syntax-2.pl
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
# Note that the results obtained by the inverted syntax form
|
||||
# may produce differing results from the traditional syntax form
|
||||
$a = $ok ? $b : $c; # Traditional syntax
|
||||
($ok ? $b : $c) = $a; # Inverted syntax
|
||||
3
Task/Inverted-syntax/Perl/inverted-syntax-3.pl
Normal file
3
Task/Inverted-syntax/Perl/inverted-syntax-3.pl
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
sub assign { $_[1] = $_[0] }
|
||||
$a = $b; # Traditional syntax
|
||||
assign $b, $a; # Inverted syntax
|
||||
Loading…
Add table
Add a link
Reference in a new issue