@files = `ls *.xml|more`;
This example is pretty far fetched. You're asking for a tool to assist *Perl* programmers that understands (correctly or otherwise) that the *shell* command
is a bad way of writingls *.xml | more
echo *.xml
A tool that converts
to the betterchomp( my @files = `echo *.xml` );
is already pretty far fetched.my @files = glob('*.xml');
Yet another example would be the extensive processing of values from @ARGV that could be replaced by the use of Getopt::Long.
Seems to me that "processing @ARGV" is hard to quantify into a test.
That said, there does exist a framework for notifying users of bad code. It's Perl::Critic. It doesn't modify the code since the idea is to identify as many possible problems as possible. You'd expect false positives here. Presumably a user willing to use Perl::Critic will look at the documentation to figure out what the warning he gets means. The recommended change can be placed there.
Now I notice you mentioned Perl::Critic. You seem to dismiss it. Why is that? Because no one coded all your suggestions yet? ( Apparently, it already checks for your first example )
In reply to Re: The maybe it is better written this way tool
by ikegami
in thread The maybe it is better written this way tool
by szabgab
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |