Hi.

Can anyone provide some insight into this weirdness please?

This was a complete pig (actually, more like a female dog) to find the cause of.

I've created a simple example script that shows the bastard issue.
Questions:
  1. In #2, why does prepending './' to the filename make 'die' produce the weird error message?
  2. In #3-#6 why does a 'die' with parameters suppress the weird error message?
  3. In #1-#6 what does '<GEN0>' in the 'die' messages mean?
Thanks!
---------------------------------------------------------------------- +---------------------------------------- example #1 >>>>> type weird.pl use strict; use warnings; use RTF::Tokenizer; my $tokenizer = RTF::Tokenizer->new( file => 'test.rtf' ); foreach ( 1 .. 5 ) { my ( $token_type, $argument, $parameter ) = $tokenizer->get_token( +); print " $token_type, $argument, $parameter\n"; } die; >>>>> weird.pl group, 1, control, rtf, 1 control, ansi, control, ansicpg, 1252 control, deff, 0 Died at D:\test\weird.pl line 13, <GEN0> line 1. ---------------------------------------------------------------------- +---------------------------------------- example #2 >>>>> type weird.pl use strict; use warnings; use RTF::Tokenizer; my $tokenizer = RTF::Tokenizer->new( file => './test.rtf' ); foreach ( 1 .. 5 ) { my ( $token_type, $argument, $parameter ) = $tokenizer->get_token( +); print " $token_type, $argument, $parameter\n"; } die; >>>>> weird.pl group, 1, control, rtf, 1 control, ansi, control, ansicpg, 1252 control, deff, 0 Can't call method "isa" without a package or object reference at C:/Pe +rl/site/lib/RTF/Tokenizer.pm line 170. ...propagated at D:\test\weird.pl line 13, <GEN0> line 1. ---------------------------------------------------------------------- +---------------------------------------- example #3 >>>>> type weird.pl use strict; use warnings; use RTF::Tokenizer; my $tokenizer = RTF::Tokenizer->new( file => './test.rtf' ); foreach ( 1 .. 5 ) { my ( $token_type, $argument, $parameter ) = $tokenizer->get_token( +); print " $token_type, $argument, $parameter\n"; } die ""; >>>>> weird.pl group, 1, control, rtf, 1 control, ansi, control, ansicpg, 1252 control, deff, 0 Can't call method "isa" without a package or object reference at C:/Pe +rl/site/lib/RTF/Tokenizer.pm line 170. ...propagated at D:\test\weird.pl line 13, <GEN0> line 1. ---------------------------------------------------------------------- +---------------------------------------- example #4 >>>>> type weird.pl use strict; use warnings; use RTF::Tokenizer; my $tokenizer = RTF::Tokenizer->new( file => './test.rtf' ); foreach ( 1 .. 5 ) { my ( $token_type, $argument, $parameter ) = $tokenizer->get_token( +); print " $token_type, $argument, $parameter\n"; } die 1; >>>>> weird.pl group, 1, control, rtf, 1 control, ansi, control, ansicpg, 1252 control, deff, 0 1 at D:\test\weird.pl line 13, <GEN0> line 1. ---------------------------------------------------------------------- +---------------------------------------- example #5 >>>>> type weird.pl use strict; use warnings; use RTF::Tokenizer; my $tokenizer = RTF::Tokenizer->new( file => './test.rtf' ); foreach ( 1 .. 5 ) { my ( $token_type, $argument, $parameter ) = $tokenizer->get_token( +); print " $token_type, $argument, $parameter\n"; } die "1"; >>>>> weird.pl group, 1, control, rtf, 1 control, ansi, control, ansicpg, 1252 control, deff, 0 1 at D:\test\weird.pl line 13, <GEN0> line 1. ---------------------------------------------------------------------- +---------------------------------------- example #6 >>>>> type weird.pl use strict; use warnings; use RTF::Tokenizer; my $tokenizer = RTF::Tokenizer->new( file => './test.rtf' ); foreach ( 1 .. 5 ) { my ( $token_type, $argument, $parameter ) = $tokenizer->get_token( +); print " $token_type, $argument, $parameter\n"; } die "one"; >>>>> weird.pl group, 1, control, rtf, 1 control, ansi, control, ansicpg, 1252 control, deff, 0 one at D:\test\weird.pl line 13, <GEN0> line 1. ---------------------------------------------------------------------- +----------------------------------------

In reply to Very weird bug - insight would be helpful by zork42

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.