Basically that code looks ok.
As it uses an if/else the ternary operator came to my mind to write it differently:
my $sixth = 'whatever'; $var = defined($var) ? $sixth : 3;
As I personally avoid to use variables $a and $b in normal code (only in sort), I used $var here.
In reply to Re: Is this code correct
by linuxer
in thread Is this code correct
by suvendra123
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |