in reply to The maybe it is better written this way tool
@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 )
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: The maybe it is better written this way tool
by szabgab (Priest) on Nov 15, 2009 at 07:13 UTC | |
by ikegami (Patriarch) on Nov 23, 2009 at 19:42 UTC | |
by szabgab (Priest) on Dec 02, 2009 at 20:20 UTC | |
by ikegami (Patriarch) on Dec 02, 2009 at 23:19 UTC |