1) Perl is very flexible, and some people say that the worst thing about reading Perl code is that a judgment condition can be placed behind a statement, for example:
My $value = "value" if $needvalue;
Sometimes, if the preceding statement is long and then the IF statement is placed so short, if you do not look at the following if statement, you may understand the error, which sometimes makes the code a headache.
2) Recently heard a senior said, it is best not to use unless, because for those who have not learned Perl, this may not be easy to understand, try to use Perl has some of the programming language to compare common if, so that anyone looking at the code is more useful, okay, Remember that there are several unless in my code, so let them stay there.
3) Just write Perl, for Perl is only used, not flexible use, remember, once, I used Perl to get the results of shell execution:
My $ret = ' Ls-al | awk ' nr==2 ' | awk ' {print $} ';
See the error, this is not get the desired result, ' is not and ' very similar, but the problem is, I want to get the 2nd row 3rd column results, but I just got 2nd line, which makes me depressed for a while, Clearly in the shell is possible, but how to call in Perl is not? Brother's character is too bad ... So, to test the pipeline there is no problem, no--by, then magic, finally, in the day, read the other predecessors write code,
My $str = "ssh root\@ $ip";
only to find that the original less a "\", Perl directly to the deal as a variable processing, is wayward, do not think ' can also and ' in the same wayward.
Perl Learning Notes