/^\s*(\S.*?)\s*$/ && $1 || ""
is an odd way of writing
/^\s*(\S.*?)\s*$/ ? $1 : ""
If you remove the unnecessary \S, you get a pattern that always matches so
/^\s*(.*?)\s*$/ ? $1 : ""
can be simplified to
/^\s*(.*?)\s*$/; $1
In reply to Re^2: PerlCritic, $_ and map
by ikegami
in thread PerlCritic, $_ and map
by chexmix
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |