Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: RFC: pragma pragmatic

by Athanasius (Archbishop)
on Aug 10, 2017 at 06:48 UTC ( [id://1197134]=note: print w/replies, xml ) Need Help??


in reply to RFC: pragma pragmatic

Hello shmem,

This package looks interesting, but unfortunately it doesn’t seem to work on Windows. I get:

13:50 >perl -I. main.pl main::foo at line 5 main::foo at line 7 main::foo at line 9 main::foo at line 11 main::foo at line 13 16:37 >

Tested using:

  • Strawberry Perl v5.20.2 built for MSWin32-x64-multi-thread
  • Strawberry Perl v5.26.0 built for MSWin32-x64-multi-thread-ld (output shown above)
  • Cygwin Perl v5.22.4 built for cygwin-thread-multi

under Windows 8.1, 64-bit.

:-(

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,

Replies are listed 'Best First'.
Re^2: RFC: pragma pragmatic
by shmem (Chancellor) on Aug 10, 2017 at 08:27 UTC

    Heh... the offending line is

    - my $loadstr = @args ? "use $mod" : "use $mod qw(@args)"; + my $loadstr = @args ? "use $mod qw(@args)" : "use $mod";

    Silly bug, sorry... thanks for the report! Corrected in the OP.

    perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'

      Thanks, but now I’m getting an error instead:

      20:20 >perl -I. main.pl Not a GLOB reference at pragmatic.pm line 26. BEGIN failed--compilation aborted at main.pl line 12. 20:20 >

      (Line 12 in my main.pl file is the first occurrence of use pragmatic Foo;)

      Update: That was under Strawberry Perl 5.26.0, and I get the same error with Cygwin Perl 5.22.4. But Strawberry Perl 5.20.2 seems to be working correctly:

      20:26 >perl main.pl Foo::foo at line 13 main::foo at line 16 Foo::foo at line 19 main::foo at line 22 Foo::foo at line 25 20:26 >

      (Those line numbers are correct in my main.pl file.)

      Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,

        If you insert

        warn ${$stash}{$symbol},"\n";

        before line 26, you see what happens. Version 5.20.2 displays

        *main::foo

        whereas v5.26.0 displays something like

        CODE(0x123abc)

        Sigh. The glob dereferencing to get at the code reference of a glob must have changed somewhere after 5.20.2, so I'll have to rewrite the symbol handling part. I'll update the OP as soon as this is done.

        update: OP updated.

        perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'
        Not a GLOB reference at pragmatic.pm line 26.

        Hmm. I don't do much Windows, but I have some VM machines of that on the shelf. I'll look into that. Thanks again.

        perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1197134]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-04-20 00:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found