Whoa, that's creative; I don't know how I managed to communicate that, but I wasn't trying to communicate that
If you're trying to learn new syntax, esp if you're working on something already , start a new file (start 10 new files actually), and type it :) that way a year later, you have code you wrote with your own fingertips showing you whats important about that new syntax -- stuff like that you remember :) well I remember
Hopefully this is clearer (I inglish you not my strong porcupine suit )
#!/usr/bin/perl --
use strict; use warnings; use Data::Dump qw/ dd pp /;
my $str = 'h';
dd $str; ## "h"
$str .= 'i';
dd $str; ## "hi"
## one way to write this mini-if aka ternary
#~ $str .= 1 > 2 ? '; uh oh 1>2' : '; ok 1<2' ;
## same exact thing, just with more whitespace , easier to read
#~ $str .= 1 > 2
#~ ? '; uh oh 1>2'
#~ : '; ok 1<2'
#~ ;;;
## once again the same exact thing (this time for real)
## the parens provide visual disambiguation
## and not important in this example, also disambiguation for operator
+ precedence
##
$str .= ( 1 > 2 ) ? ( '; uh oh 1>2' ) : ('; ok 1<2');
dd $str; ## "hi; ok 1<2"
$str .= do {
my $foo = 0;
for(1..3){
$foo .= $_;
}
$foo; ## last statement is like "return $foo;"
}; # end of do
dd $str; ## "hi; ok 1<20123"
__END__
"h"
"hi"
"hi; ok 1<2"
"hi; ok 1<20123"
porcupine suit aka "armouire" -- ah gess, the pans are mah favreeeet :D