dancer2 attempting to use references as an lvalue in a substitution #881

dfhoughton opened this Issue Jan 5, 2013 · 1 comment


None yet
2 participants

I just tried to test out dancer2:

$ dancer2 --app-mode distzilla --app jobgui
Creating app : jobgui
Attempt to use reference as lvalue in substr at /home/houghton/perl5/lib/perl5/App/ line 129.

Here's the relevant bit of code in App::Dancer2:

sub _copy_dist {
    my ( $self, $from, $to ) = @_;
    my $app          = $self->app;
    my $now          = DateTime->now();
    my $current_year = $now->year;
        callback => sub {
            my $child = shift;
            my $dest = dir( $to, substr( $child, length($from) ) ); # where's the lvalue? $dest?
            $dest =~ s/\Q[%APP%]\E/$app/gx;                         # here's the substitution

I tried to recreate the bug simply by messing with substr.

$ perl -E 'package foo; sub new {bless {}}; say "quux" . substr(foo->new, length(foo->new)) . "bar"'

No luck. Is the problem with the next line?

$ perl -MPath::Class -E '$v = dir("ab"); $v =~ s/^./x/; say $v'

So I'm no help. Anyway, the dancer2 app failed to create anything. I hope you can sort this out.

This comment has been minimized.

Show comment Hide comment

yanick Mar 13, 2013


yanick commented Mar 13, 2013

@yanick yanick closed this Mar 13, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment