summaryrefslogtreecommitdiff
path: root/pp_pack.c
diff options
context:
space:
mode:
authorChip Salzenberg <chip@pobox.com>2003-02-19 03:54:45 +0000
committerchip <chip@pobox.com>2003-02-19 03:54:45 +0000
commit13dcffc60adeca175c32a1ea11ec8756d4853ad2 (patch)
treefe53ada3730ca7574b306ba6c164d7222487f5e4 /pp_pack.c
parent8c63d93843745ff8766bc75490d35dc2b080c5c0 (diff)
downloadperl-13dcffc60adeca175c32a1ea11ec8756d4853ad2.tar.gz
Support one-parameter unpack(), which unpacks $_.
p4raw-id: //depot/perl@18751
Diffstat (limited to 'pp_pack.c')
-rw-r--r--pp_pack.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/pp_pack.c b/pp_pack.c
index 44764541df..6f9abe1dce 100644
--- a/pp_pack.c
+++ b/pp_pack.c
@@ -1606,7 +1606,8 @@ Perl_unpack_str(pTHX_ char *pat, register char *patend, register char *s, char *
PP(pp_unpack)
{
dSP;
- dPOPPOPssrl;
+ SV *right = (MAXARG > 1) ? POPs : GvSV(PL_defgv);
+ SV *left = POPs;
I32 gimme = GIMME_V;
STRLEN llen;
STRLEN rlen;