in reply to Re: What am I not understanding about $,
in thread What am I not understanding about $,
Because nobody knows what $" is
Anyone who doesn't know what $" is, almost certainly won't understand @array[2,4], so you better make that:
my $output = join '', $array[2], $array[4];
But then, even if they know about the function join(), they probably won't understand the statement join, so you'd better make that:
my $output = join( '', $array[2], $array[4] );
Then, of course, for consistency you should make that last line:
print( "$output\n" );
But WFT!? Variable names inside quoted strings? That can't be right:
print( $output . "\n" );
But what the hell is that dot doing there!?
print( join( '', $output, "\n" ) );
But hang on a minute! Nested function calls!? We can sort that abomination out:
my $output2 = join( '', $output, "\n" ); print( $output2 );
my @array = ( 'abc', 'def', 'ghi', 'jkl', 'mno', 'pqr', 'stu', 'vwx', 'yz ' ); my $output = join( '', $array[2], $array[4] ); my $output2 = join( '', $output, "\n" ); print( $output2 );
But, but, but, where are the classes and objects and methods and, and and ... Sod this! I'm going back to a proper language like JavaPy++ Cscript 3000 where fings are dun proply!
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: What am I not understanding about $,
by Ovid (Cardinal) on May 04, 2016 at 08:48 UTC | |
Re^3: What am I not understanding about $,
by polettix (Vicar) on May 20, 2016 at 06:38 UTC | |
by BrowserUk (Patriarch) on May 20, 2016 at 07:55 UTC | |
by polettix (Vicar) on May 29, 2016 at 12:22 UTC | |
Re^3: What am I not understanding about $,
by FormerMonk (Initiate) on May 11, 2016 at 00:48 UTC | |
by BrowserUk (Patriarch) on May 11, 2016 at 01:31 UTC | |
by Anonymous Monk on May 11, 2016 at 01:01 UTC |