Hi

Hmm splain has heard of the error (its in perldiag)

$ cat 2 Can't coerce UNKNOWN to string in substitution iterator at ./coerce.pl + line 11, <> line 12. $ splain 2 Can't coerce UNKNOWN to string in substitution iterator at ./coerce.pl + line 11, <> line 12 (#1) (F) Certain types of SVs, in particular real symbol table entries (typeglobs), can't be forced to stop being what they are. So you +can't say things like: *foo += 1; You CAN say $foo = *foo; $foo += 1; but then $foo no longer contains a glob.

I can't replicate the error in v5.16.1 but I can in v5.18.2

The output starts to differ at line 59 , so I modify the input to just the part that makes error

5 1 3 8 14 19 26 33

Adding use re 'debug'; makes it run to completion , but output is not identical

Now looking at the regex, and checking perlre,

I see you're using (??{}) , but the return value (a regex pattern) is either X or nothing ... and there is no X in the input,

so I switch to using (?{}) where return value isn't a regex pattern, and with this change both versions of perl produce the same output

Now its not the same output as before with (??{}) but I dont think thats important


In reply to Re: Can't coerce UNKNOWN to string in substitution iterator (splain, (??{})) by beech
in thread Can't coerce UNKNOWN to string in substitution iterator by rsFalse

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.