Use of /c modifier is meaningless without /g at (eval 14) line 1, <__A +NONIO__> line 4.

Would it not be nice to see the offending string in an error code, taint approved? And if it's not a string... Then it's not Perl.

I slay me,
Jambo

Replies are listed 'Best First'.
Re: Error reporting in Perl
by Corion (Patriarch) on Jul 13, 2017 at 08:48 UTC

    To find your error locations easier, you can use Sub::Name to give them a name.

    Note that the "original string" may not be available anymore once Perl comes to the conclusion that your code tries to do something nonsensical.

    Maybe you can show us a more concrete example that reproduces your situation and show us what you would like to see instead.

    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: Error reporting in Perl
by shmem (Chancellor) on Jul 13, 2017 at 22:45 UTC
    Would it not be nice to see the offending string in an error code, taint approved?

    Agreed. Although I hate python for the significant whitespace at line beginning, I hate it far more for uninformative stacktraces, which do show me the formal parameters per default, but not the values they carry. This is similar.

    perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'
Re: Error reporting in Perl
by RonW (Parson) on Jul 17, 2017 at 21:57 UTC

    Maybe turn on regex debugging during development:use re qw(Debug COMPILE);

    re is a core module, so should not need to be installed.)

Re: Error reporting in Perl
by jdporter (Paladin) on Jul 18, 2017 at 17:09 UTC
    Would it not be nice to see the offending string

    What do you mean by "the offending string"? Do you mean the line of code? Because that error message says there's a problem with the code, not with whatever string (data) was being operated upon by the regex.

    in an error code

    What do you mean by "an error code"? Do you mean "the error message"? i.e. the line which is printed by the interpreter.

    I reckon we are the only monastery ever to have a dungeon stuffed with 16,000 zombies.
Re: Error reporting in Perl
by Anonymous Monk on Jul 13, 2017 at 07:59 UTC

    Would it not be nice to see the offending string in an error code, taint approved?

    No it would be clutter

Re: Error reporting in Perl
by Anonymous Monk on Jul 13, 2017 at 15:45 UTC
    The offending string might be very long. But maybe someone has a tool that saves eval-ed strings for debugging purposes?