Различие .. и ... в perl
Aug. 31st, 2011 11:56 am
zsh# print -l "AA BB" "test" "BB" | perl -lne 'print if (/AA/ .. /BB/)'
AA BB
zsh# print -l "AA BB" "test" "BB" | perl -lne 'print if (/AA/ ... /BB/)'
AA BB
test
BB
zsh#
разница только во времени вычисления правой части.
perldoc perlop: If you don't want it to test the right operand until the next evaluation, as in sed, just use three dots ("...") instead of two. In all other regards, "..." behaves just like ".." does.