Jumping to error line in Perl output failure

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, MudGuard

Post Reply
deewoo
Posts: 4
Joined: Wed Oct 29, 2003 4:45 am

Jumping to error line in Perl output failure

Post by deewoo »

I have been using TP for years now; I reinstalled last month and now the 'jump to error line' feature (Configure->Preferences->Tools->Perl) does not work. In the 'Regular Expression to match output' field I use the suggested

^.+at \(.+\) line \([0-9]+\)[.,]?

(File=1, Line=2 )

as well as several other RE's of my own making. This and the others should do the trick, but they all result in a 'Cannot jump to item under the cursor' error message. I have TP 4.7.1, and Activestate perl build 635 v 5.6.1.

I have a few thoughts. The Perl error messages have the full path in them; will this cause a problem? Also, we can now use posix regular expresssion (hurray!). Does the posix RE setting affect this regular expression?

Is anyone else having this problem? Any ideas?


Warmly

Dennis
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

Using POSIX does affect this expression:
^.+at \(.+\) line\([0-9]+\)[.,]?
Remove the bold red backslashes (\) and end up with:
^.+at (.+) line ([0-9]+)[.,]?
Hope this was helpful.............good luck,
Bob
deewoo
Posts: 4
Joined: Wed Oct 29, 2003 4:45 am

Post by deewoo »

Thanks for the clarification Bob. I have tried all variations, but it still does not work. Here are all the parameters.

Perl Program (c:\try.pl)
asdf;

Command Results
Unquoted string "asdf" may clash with future reserved word at C:\try.pl line 1.
Useless use of a constant in void context at C:\try.pl line 1.

Tool completed successfully
Error Message (after clicking on a line)
Cannot jump to item under the cursor

Configuration
Posix RE turned on
regular expression = ^.+at (.+) line ([0-9]+)[.,]?

Can anyone replicate this error?
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

Hi deewoo

I am just teaching myself perl, so at this time, I have no experience that I can pass on. But I did review the RegEx

Your expression:
Posix RE turned on
regular expression = ^.+at (.+) line ([0-9]+)[.,]?
seems to be looking for lines that look something like this?
One or more characters, or groups of words at "some particular value to you here on" line 15.
And you are capturing the value of whatever is between "at " and " line" which can be used as \1 (This example = "some particular value to you here on"). Am I reading that correctly:?:

So this must be generating this part of your error message:
Useless use of a constant in void context at C:\try.pl line 1.
=====================================
Re perl:
As noted above, Perl is new to me, just started it this past weekend. But I ran your Perl script from a TextPad tool and got no error message. I also made a Perl debug tool in TextPad, and that also generated no errors.

What I did learn from looking at your problem was beneficial. When I started the tool, TextPad opened up a SaveAs window. I then realized I needed to save it as a pl file. Once I did that, the script ran OK without prompting to save.

With Capture OFF, the perl window prompted me to press any key to continue. When I pressed ENTER, the script showed me it was finished.

With Capture ON, with your Regex, I ran the tool, and the command result showed "Tool completed successfully". So, I guess I was not able to duplicate your problem.

I am using Perl 5.8.1 on WIN98 SE system
Hope this was helpful.............good luck,
Bob
deewoo
Posts: 4
Joined: Wed Oct 29, 2003 4:45 am

Post by deewoo »

Woops, I should have give all the parameters.
Under the parameters window, I have

-w $File

so that some error checking happens. Perl is a bit too slack for my liking sometimes.
Kevin
Posts: 28
Joined: Tue Apr 01, 2003 7:55 pm

Post by Kevin »

Dennis,

try this as the regex:

Code: Select all

^.*line.*\([0-9]+\)
remove the backslashes if using POSIX.

File: <leave blank>
Line: 1
Column: <leave blank>
deewoo
Posts: 4
Joined: Wed Oct 29, 2003 4:45 am

Post by deewoo »

Thanks for all your help. The problem was that I needed to keep recompiling the perl script for the changes to the regular expression, and the posix setting, to take effect. It would look like a change didn't work when it did; all I needed to do was to recompile. So, in the final analysis, all of the above RE's work, as long as I put match the slashes to the posix settings.

thanks

Dennis
Pete Jack
Posts: 1
Joined: Thu Mar 25, 2004 6:09 pm

Jumping to error lines

Post by Pete Jack »

My version of textpad, 4.7.1, gave this message
"C:\Customers\Northwestern Industries\plc\CheckOTL.pl line 61, <L5K> contains an invalid path" when I used this POSIX regex to try to jump to the error line

^.+at (.+) line ([0-9]+)[.,]

I changed it to

^.+at (.+) line ([0-9]+),

and it worked! Whats going on?
The industrial controls guy.
Post Reply