Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hello monks,
I'm using perlapp to build an executable and I see the following error:
"my sub" not yet implemented at /PerlApp/WWW/Myspace.pm line 1584
The module code looks like so:
... # Save info if we need to unless ( $self->error ) { $self->$save_friend_info if ( ( ( $source eq '' ) || ( $source eq 'profile' ) ) && ( $page == 1 ) ); } return $res; } #--------------------------------------------------------------------- my sub save_friend_info { ... }
I'm not sure if this is an issue with the module or the perlapp. I'm using perl 5.8 build 817 on Windows. Any insight would be greatly appreciated.

Replies are listed 'Best First'.
Re: "my sub" error
by davorg (Chancellor) on Nov 07, 2006 at 13:42 UTC

    The problem is with the module. It seems to be trying to use lexically scoped subroutines - and Perl doesn't support those (yet).

    The error is listed in perldiag.

    "my sub" not yet implemented
    (F) Lexically scoped subroutines are not yet implemented. Don't try that yet.

    (The 'F' stands for Fatal).

    Any program using this module will fail to compile. I'd suggest that's worth a bug report.

    Update: Oops. tye is absolutely right. My theory is disproved by inconvenient facts :)

    --
    <http://dave.org.uk>

    "The first rule of Perl club is you do not talk about Perl club."
    -- Chip Salzenberg

      Nice theory and fairly reasonable on the surface, but if you check the CPAN Testers reports for this module, you'll see that it passes tests and the failures are not (as far as I saw) due to this syntax.

      It turns out that this syntax is a feature of Spiffy. My first somewhat wild guess is that we've got the classic failure of a badly designed source filter by someone with too much hubris to realize that they aren't good enough at parsing Perl to pull this off.

      Update: Spiffy's source filter doesn't appear to try to parse Perl, as near as I can tell.

      - tye        

Re: "my sub" error
by Zaxo (Archbishop) on Nov 07, 2006 at 13:46 UTC

    That just means that lexically scoped subs can't yet be defined that way. What you probably mean is:

    sub save_friend_info { # . . . }

    You can have a lexical sub, but you need to assign it to an ordinary scalar:

    { my $save_friend_info = sub { # . . . }; $save_friend_info->(@args) or die $!; }

    After Compline,
    Zaxo

      All true. But the way I read it, this isn't the original poster's module. It's a module that's on CPAN - which makes you wonder how it ever got released.

      --
      <http://dave.org.uk>

      "The first rule of Perl club is you do not talk about Perl club."
      -- Chip Salzenberg

        Your correct...this isn't my module and I did find it on CPAN. Thanks for all the input, this makes a little more sense now.