On cygwin 1.5.21-2 with perl 5.8.7 I get a parse error on the second variation...(which seems normal given the lonely doublequote at the end of the eval no??) Devel::Size is 0.59 which seems to be old (latest is 0.63)

UPDATE: with the modification indicated by shmem, I get the same result in both cases. latest version of Devel::Size is 0.64 (not 0.63) so the problem could also come from there

% stephan@armen (/home/stephan) % % perl -MDevel::Size -e 'print $Devel::Size::VERSION' 0.59 % stephan@armen (/home/stephan) % % ./devel_size_test.px Devel::Size: Calculated sizes for CVs are incomplete 108 Devel::Size: Calculated sizes for CVs are incomplete 108 sub2 args('main','./devel_size_test.px','19','main::__ANON__','1','',' +','','2','UUUUUUUUUUUU') Hullo, monkses! sub1 args('main','./devel_size_test.px','20','main::__ANON__','1','',' +','','2','UUUUUUUUUUUU') Howdy, world! % stephan@armen (/home/stephan) % % ./devel_size_test2.px Warning: Use of "require" without parentheses is ambiguous at (eval 1) + line 1. String found where operator expected at (eval 1) line 1, at end of lin +e Can't find string terminator '"' anywhere before EOF at (eval 1) line +1. % stephan@armen (/home/stephan) % % diff devel_size_test@(|2).px 2d1 < 7,10c6,8 < my $file = shift; < my $sub = \eval "package ".caller()."; require \"$file\""; < my $foo = sub { goto $$sub }; < $foo; --- > my $sub = \eval 'package '.caller().'; require '.shift(@_).'"'; > die $@ if $@; > sub { goto $$sub }; 21d18 <
hth --stephan

In reply to Re: Bug in Devel::Size? by sgt
in thread Bug in Devel::Size? by shmem

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.