in reply to Announcing "p5u"

The p5u script has a compile error for me:
$ perl -c p5u Type of arg 1 to unshift must be array (not scalar dereference) at p5u + line 7, near "@ARGV if" p5u had compilation errors. $ $ perl -v This is perl 5, version 12, subversion 2 (v5.12.2) built for x86_64-li +nux

Is there something I need to do, or should it just run out of the box? P5U seemed to install properly.

Replies are listed 'Best First'.
Re^2: Announcing "p5u"
by chromatic (Archbishop) on Jul 02, 2012 at 21:47 UTC

    The line is:

    unshift $1, @ARGV if basename($0) =~ /^p5u-(\w+)$/;

    ... which is clearly an error. In 5.14, with push et all able to dereference scalar references, this is merely a symbolic reference.

      Hmmm... yes, the arguments to unshift need to be swapped. :-( Autoderef is fast shaping up to be my most unfavourite new Perl feature as it stops recent Perls from detecting this at the compile stage.

      update: 0.003 has now been uploaded; it should address this issue.

      perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'