Subject: | Regex is too greedy |
Date: | Thu, 19 Jun 2014 13:39:27 +0000 |
To: | "bug-Carp-Always [...] rt.cpan.org" <bug-Carp-Always [...] rt.cpan.org> |
From: | Robert Rothenberg <Robert.Rothenberg [...] foxtons.co.uk> |
The regular expression
$arg =~ s/(.*)( at .*? line .*?\n$)/$1/s;
is too greedy. If you have an error like
Kaboom at foo/bar.pl line 123
Some additional diagnostics added here by
a custom error handler.
then the additional diagnostics added will be lost.
Try changing the regex to
$arg =~ s/(.*)( at .*? line \d+\n$)/$1/s;
Privacy and Confidentiality Notice:
This is strictly confidential and intended solely for the person or organisation to whom it is addressed. It may contain privileged and confidential information and if you are not an intended recipient, you must not copy, distribute or take any action in reliance on it. If you have received this message in error, please notify us as soon as possible and delete it and any attached files from your system.
The views and opinions expressed in this email message are the author's own and may not reflect the views and opinions of the author's employer.
Foxtons Limited is registered in England and Wales (registered number 01680058). Our registered office is at Building One, Chiswick Park, 566 Chiswick High Road, London, W4 5BE.
Show quoted text
________________________________
This e-mail has been scanned for viruses by MessageLabs.