Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

perltidy 20101217 not detecting errors

by Dandello (Scribe)
on Feb 07, 2011 at 17:02 UTC ( #886756=perlquestion: print w/ replies, xml ) Need Help??
Dandello has asked for the wisdom of the Perl Monks concerning the following question:

More of a heads up.

Over the past week I've installed/upgraded Activestate Perl 5.012002 onto three different Windows machines (two Win7 and one XP). The same issue occurs on all three so I can be reasonably sure it's not me since it's a standard install on all three.

Perltidy 20101217 (the one shipped with Activestate Perl 5.012002) is not picking up errors.

These are errors I know are there because I put them there for testing.

Even running with the warning flag doesn't throw errors that I know are there.

I generally run perltidy from the command prompt: perltidy C:\filepathhere

The previous versions of perl and perltidy (about a year old) worked fine.

Comment on perltidy 20101217 not detecting errors
Replies are listed 'Best First'.
Re: perltidy 20101217 not detecting errors
by thezip (Vicar) on Feb 07, 2011 at 17:15 UTC


    My advice to you is to step back and figure out what assumptions you are making about your script and/or environment.

    Write a short script to prove that PerlTidy *is* working. Once you do that, then you can run PerlTidy against your scripts to find out why they are failing.

    General stuff, yeah, but IME problems like these are always because of a bad assumption. Just step back and take a deep breath...

    What can be asserted without proof can be dismissed without proof. - Christopher Hitchens

      Well, my assumption is that the current version of Perltidy should detect the same issues as the old version - missing brackets, especially - and give me an .ERR file.

      Since I know the file I'm sending to Tidy has errors because I put them there for testing, I assume I should get an error file.

      AND, when I process the file I know has errors through Perl::Critic online, it tells me "perltidy had errors!! at line 1, column 1. See page 33 of PBP. Severity: 1"

      Now, I don't know if this is a genuine bug, since when I checked the Perltidy bug report I didn't see anything related to this issue, but when but when four out of the four machines that have had the newest version of Activestate Perl installed on them all have the same issue...

      This is the log file for a script I was testing that I know for a fact has a bracket commented out so it would throw an error:

      perltidy version 20101217 log file on a MSWin32 system, OLD_PERL_VERSI +ON=5.012002 Windows type is XP/.Net Configuration and command line parameters for this run: -g To find error messages search for 'WARNING' with your editor

      Just for you, Anonymous


      #!/usr/bin/perl use strict; use warnings; my $format = 0; if ( $format == 1 ) { print $format; } else { print 'Oops'; exit;
      - including an obvious and intentional error.

      Run through Perltidy from run/cmd: perltidy -g C:\testing\

      The -g is the flag for a full log including warnings

      What I expect: an ERR file from Perltidy telling me I have a missing right curly bracket at or before line 13 and the previous unmatched bracket is at line 10. This file should be in the same directory as the script being checked.

      No ERR file and the log is this:

      perltidy version 20101217 log file on a MSWin32 system, OLD_PERL_VERSI +ON=5.012002 Windows type is XP/.Net Configuration and command line parameters for this run: -g To find error messages search for 'WARNING' with your editor

      The previous version of Perltidy gave me the ERR file on exactly this type of problem. Now there isn't one. But it still does a nice job prettying up my code.

        Aha, now I see. Consulting I see
        - added new flag -it=n or --iterations=n This flag causes perltidy to do n complete iterations. For most purposes the default of n=1 should be satisfactory. H +owever n=2
        a quick test with -it=2 generates a .ERR file like the previous version used to

        You're welcome :)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://886756]
Approved by Old_Gray_Bear
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2015-11-28 13:37 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (742 votes), past polls