in reply to Re: PerlCritic, $_ and map
in thread PerlCritic, $_ and map
/^\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
|
|---|