stdhandle.t: convert to use Test::More

print "ok 13\n" is *so* 1990's.
stdhandle.t: unlink the right file.

It writes to "afile", but initially deleted "afile.new" if it already
existed.
Tie::StdHandle appends extra copies of $\ to output

[perl #120202]

The following code demonstrates the problem:

    use Tie::Handle;

    my $out = do { no warnings 'once'; \ local *HANDLE };
    tie *$out, 'Tie::StdHandle', '>&', \ *STDOUT or die;

    $\ = "haha\n";
    print $out "hihi\n";

which prints

    hihi
    haha
    haha

The string in $\ has been added twice, once explicitly by
Tie::Handle::PRINT and another time implicitly by the use of
(CORE::) print in Tie::StdHandle::WRITE.

The bug also affects the use of say() with tied handles where a spurious
newline is added by the same effect.

[ test added by davem ]
Tie::StdHandle::WRITE: handle offset

the WRITE method was ignoring its offset argument.
bump Tie::StdHandle version

after recent fixes
Minor bignum POD fix (capitalisation).
Add Marc Simpson to AUTHORS
Increase $bignum::VERSION to 0.37
Add OPpLVALUE flag

This flag will be used by the next commit.
[perl #119797] Fix if/else in lvalue sub

When if/else/unless is the last thing in an lvalue sub, the lvalue
context is not always propagated properly and scope exit tries to
copy things, including arrays, resulting in ‘Bizarre copy of ARRAY’.

This commit fixes the bizarre copy by flagging any leave op that is
part of an lvalue sub’s return sequence, using the OPpLEAVE flag added
for this purpose in the previous commit.  Then pp_leave uses that flag
to avoid copying return values, but protects them via the mortals
stack just like pp_leavesublv (actually pp_ctl.c:S_return_lvalues).

For ‘if’ and ‘unless’ without ‘else’, the lvalue context was not being
propagated, resulting in arrays’ getting flattened despite the lvalue
context.  op_lvalue_flags in op.c needed to handle AND and OR ops,
which ‘if’ and ‘unless’ compile to, to make this work.
Increase $B::Concise::VERSION to 0.991

I don’t know, is it time for version 1 yet?
Make the details array in universal.c static

Otherwise we can have linking problems when a global ‘details’ symbol
is defined elsewhere.  (That happened to me with an XS module.)
Fix bare blocks in lvalue subs

If a bare block is the last thing in an lvalue sub, OP_LEAVELOOP needs
to propagate lvalue context and handle returned arrays properly, just
as OP_LEAVE has done since yesterday.

This is a follow-up to 2ec7f6f24289.  This came up in ticket #119797.
Restore prev. behaviour of @a||... in lv sub

$ perl5.18.1 -lwe 'my @a;  sub i:lvalue {@a||@b} @a=1; (i())=3'
Name "main::b" used only once: possible typo at -e line 1.
Useless assignment to a temporary at -e line 1.

Bleadperl:

$ ./perl -Ilib -lwe 'my @a; sub i:lvalue {@a||@b} @a=1; (i())=3'
Name "main::b" used only once: possible typo at -e line 1.
Can't return array to lvalue scalar context at -e line 1.

I accidentally changed it in commit 2ec7f6f242 by propagating the
lvalue context.  This commit changes it back by only flagging the
rv2av op as being in an lvalue sub if it is not already flagged as
being in scalar context.

The old behaviour was inconsistent, and this commit does restore it
(see the tests), but resolving that discrepancy is for a future commit
(if I ever get to it).

In any case, ‘Can't return array to lvalue scalar context’ is wrong.
Update Archive-Tar to CPAN version 1.96

  [DELTA]

1.96  24/10/2013
- integrate Package::Constants into Constant module
  and remove requirement on it.

1.94  24/10/2013
- install into site if >= 5.012

1.93_02 22/10/2013 (XLAT)
- [rt.cpan.org #78030] symlinks resolution on MSWin32
Schedule Package::Constants for removal from core
Update Package-Constants to CPAN version 0.04

  [DELTA]

0.04    Thu Oct 24 20:34:00 BST 2013
=================================================
* Update Makefile.PL to add repository et al
* Install into site if >= v5.12.0
* Add use deprecate due to core scheduled removal
rv2hv does not use its TARG

rv2hv has had a TARG since perl 5.000, but it has not used it since
hv_scalar was added in perl-5.8.0-3008-ga3bcc51.

This commit removes it, saving a tiny bit of space in the pad.
pp_hot.c:pp_rv2av: Remove superfluous SPAGAIN

Commit perl-5.8.0-9908-g5e17dd7, in March of 2007, added a SPAGAIN
here to account for the stack shifting when hv_scalar calls tied
hashes’ SCALAR method.

It was never necessary, because commit perl-5.8.0-3008-ga3bcc51,
which added hv_scalar and magic_scalarpack in December of 2003, made
magic_scalarpack push a new stack, protecting the old one.
Propagate lvalue context to && and ||

I did this for the last statement in an lvalue sub (and the argument
to ‘return’ in an lvalue sub) in commit 2ec7f6f2428.

It turns out that it needs to apply in other lvaluish contexts, too:

$ ./perl -Ilib -le 'for($a||$b){$_++} print $b'
1
$ ./perl -Ilib -le 'for(pos $a || pos $b){$_++} print pos $b'
Modification of a read-only value attempted at -e line 1.

If I can assign to $b through this construct, then why not pos?