PL_sv_root = 0;
}
+/* ---------------------------------------------------------------------
+ *
+ * support functions for report_uninit()
+ */
+
+/* the maxiumum size of array or hash where we will scan looking
+ * for the undefined element that triggered the warning */
+
+#define FUV_MAX_SEARCH_SIZE 1000
+
+/* Look for an entry in the hash whose value has the same SV as val;
+ * If so, return a mortal copy of the key. */
+
+STATIC SV*
+S_find_hash_subscript(pTHX_ HV *hv, SV* val)
+{
+ register HE **array;
+ register HE *entry;
+ I32 i;
+
+ if (!hv || SvMAGICAL(hv) || !HvARRAY(hv) ||
+ (HvTOTALKEYS(hv) > FUV_MAX_SEARCH_SIZE))
+ return Nullsv;
+
+ array = HvARRAY(hv);
+
+ for (i=HvMAX(hv); i>0; i--) {
+ for (entry = array[i]; entry; entry = HeNEXT(entry)) {
+ if (HeVAL(entry) != val)
+ continue;
+ if ( HeVAL(entry) == &PL_sv_undef ||
+ HeVAL(entry) == &PL_sv_placeholder)
+ continue;
+ if (!HeKEY(entry))
+ return Nullsv;
+ if (HeKLEN(entry) == HEf_SVKEY)
+ return sv_mortalcopy(HeKEY_sv(entry));
+ return sv_2mortal(newSVpvn(HeKEY(entry), HeKLEN(entry)));
+ }
+ }
+ return Nullsv;
+}
+
+/* Look for an entry in the array whose value has the same SV as val;
+ * If so, return the index, otherwise return -1. */
+
+STATIC I32
+S_find_array_subscript(pTHX_ AV *av, SV* val)
+{
+ SV** svp;
+ I32 i;
+ if (!av || SvMAGICAL(av) || !AvARRAY(av) ||
+ (AvFILLp(av) > FUV_MAX_SEARCH_SIZE))
+ return -1;
+
+ svp = AvARRAY(av);
+ for (i=AvFILLp(av); i>=0; i--) {
+ if (svp[i] == val && svp[i] != &PL_sv_undef)
+ return i;
+ }
+ return -1;
+}
+
+/* S_varname(): return the name of a variable, optionally with a subscript.
+ * If gv is non-zero, use the name of that global, along with gvtype (one
+ * of "$", "@", "%"); otherwise use the name of the lexical at pad offset
+ * targ. Depending on the value of the subscript_type flag, return:
+ */
+
+#define FUV_SUBSCRIPT_NONE 1 /* "@foo" */
+#define FUV_SUBSCRIPT_ARRAY 2 /* "$foo[aindex]" */
+#define FUV_SUBSCRIPT_HASH 3 /* "$foo{keyname}" */
+#define FUV_SUBSCRIPT_WITHIN 4 /* "within @foo" */
+
+STATIC SV*
+S_varname(pTHX_ GV *gv, char *gvtype, PADOFFSET targ,
+ SV* keyname, I32 aindex, int subscript_type)
+{
+ AV *av;
+
+ SV *sv, *name;
+
+ name = sv_newmortal();
+ if (gv) {
+
+ /* simulate gv_fullname4(), but add literal '^' for $^FOO names
+ * XXX get rid of all this if gv_fullnameX() ever supports this
+ * directly */
+
+ char *p;
+ HV *hv = GvSTASH(gv);
+ sv_setpv(name, gvtype);
+ if (!hv)
+ p = "???";
+ else if (!HvNAME(hv))
+ p = "__ANON__";
+ else
+ p = HvNAME(hv);
+ if (strNE(p, "main")) {
+ sv_catpv(name,p);
+ sv_catpvn(name,"::", 2);
+ }
+ if (GvNAMELEN(gv)>= 1 &&
+ ((unsigned int)*GvNAME(gv)) <= 26)
+ { /* handle $^FOO */
+ Perl_sv_catpvf(aTHX_ name,"^%c", *GvNAME(gv) + 'A' - 1);
+ sv_catpvn(name,GvNAME(gv)+1,GvNAMELEN(gv)-1);
+ }
+ else
+ sv_catpvn(name,GvNAME(gv),GvNAMELEN(gv));
+ }
+ else {
+ U32 u;
+ CV *cv = find_runcv(&u);
+ if (!cv || !CvPADLIST(cv))
+ return Nullsv;;
+ av = (AV*)(*av_fetch(CvPADLIST(cv), 0, FALSE));
+ sv = *av_fetch(av, targ, FALSE);
+ /* SvLEN in a pad name is not to be trusted */
+ sv_setpv(name, SvPV_nolen(sv));
+ }
+
+ if (subscript_type == FUV_SUBSCRIPT_HASH) {
+ *SvPVX(name) = '$';
+ sv = NEWSV(0,0);
+ Perl_sv_catpvf(aTHX_ name, "{%s}",
+ pv_display(sv,SvPVX(keyname), SvCUR(keyname), 0, 32));
+ SvREFCNT_dec(sv);
+ }
+ else if (subscript_type == FUV_SUBSCRIPT_ARRAY) {
+ *SvPVX(name) = '$';
+ Perl_sv_catpvf(aTHX_ name, "[%"IVdf"]", aindex);
+ }
+ else if (subscript_type == FUV_SUBSCRIPT_WITHIN)
+ sv_insert(name, 0, 0, "within ", 7);
+
+ return name;
+}
+
+
+/*
+=for apidoc find_uninit_var
+
+Find the name of the undefined variable (if any) that caused the operator o
+to issue a "Use of uninitialized value" warning.
+If match is true, only return a name if it's value matches uninit_sv.
+So roughly speaking, if a unary operator (such as OP_COS) generates a
+warning, then following the direct child of the op may yield an
+OP_PADSV or OP_GV that gives the name of the undefined variable. On the
+other hand, with OP_ADD there are two branches to follow, so we only print
+the variable name if we get an exact match.
+
+The name is returned as a mortal SV.
+
+Assumes that PL_op is the op that originally triggered the error, and that
+PL_comppad/PL_curpad points to the currently executing pad.
+
+=cut
+*/
+
+STATIC SV *
+S_find_uninit_var(pTHX_ OP* obase, SV* uninit_sv, bool match)
+{
+ SV *sv;
+ AV *av;
+ SV **svp;
+ GV *gv;
+ OP *o, *o2, *kid;
+
+ if (!obase || (match && (!uninit_sv || uninit_sv == &PL_sv_undef ||
+ uninit_sv == &PL_sv_placeholder)))
+ return Nullsv;
+
+ switch (obase->op_type) {
+
+ case OP_RV2AV:
+ case OP_RV2HV:
+ case OP_PADAV:
+ case OP_PADHV:
+ {
+ bool pad = (obase->op_type == OP_PADAV || obase->op_type == OP_PADHV);
+ bool hash = (obase->op_type == OP_PADHV || obase->op_type == OP_RV2HV);
+ I32 index;
+ SV *keysv;
+ int subscript_type = FUV_SUBSCRIPT_WITHIN;
+
+ if (pad) { /* @lex, %lex */
+ sv = PAD_SVl(obase->op_targ);
+ gv = Nullgv;
+ }
+ else {
+ if (cUNOPx(obase)->op_first->op_type == OP_GV) {
+ /* @global, %global */
+ gv = cGVOPx_gv(cUNOPx(obase)->op_first);
+ if (!gv)
+ break;
+ sv = hash ? (SV*)GvHV(gv): (SV*)GvAV(gv);
+ }
+ else /* @{expr}, %{expr} */
+ return find_uninit_var(cUNOPx(obase)->op_first,
+ uninit_sv, match);
+ }
+
+ /* attempt to find a match within the aggregate */
+ if (hash) {
+ keysv = S_find_hash_subscript(aTHX_ (HV*)sv, uninit_sv);
+ if (keysv)
+ subscript_type = FUV_SUBSCRIPT_HASH;
+ }
+ else {
+ index = S_find_array_subscript(aTHX_ (AV*)sv, uninit_sv);
+ if (index >= 0)
+ subscript_type = FUV_SUBSCRIPT_ARRAY;
+ }
+
+ if (match && subscript_type == FUV_SUBSCRIPT_WITHIN)
+ break;
+
+ return S_varname(aTHX_ gv, hash ? "%" : "@", obase->op_targ,
+ keysv, index, subscript_type);
+ }
+
+ case OP_PADSV:
+ if (match && PAD_SVl(obase->op_targ) != uninit_sv)
+ break;
+ return S_varname(aTHX_ Nullgv, "$", obase->op_targ,
+ Nullsv, 0, FUV_SUBSCRIPT_NONE);
+
+ case OP_GVSV:
+ gv = cGVOPx_gv(obase);
+ if (!gv || (match && GvSV(gv) != uninit_sv))
+ break;
+ return S_varname(aTHX_ gv, "$", 0, Nullsv, 0, FUV_SUBSCRIPT_NONE);
+
+ case OP_AELEMFAST:
+ if (obase->op_flags & OPf_SPECIAL) { /* lexical array */
+ if (match) {
+ av = (AV*)PAD_SV(obase->op_targ);
+ if (!av || SvRMAGICAL(av))
+ break;
+ svp = av_fetch(av, (I32)obase->op_private, FALSE);
+ if (!svp || *svp != uninit_sv)
+ break;
+ }
+ return S_varname(aTHX_ Nullgv, "$", obase->op_targ,
+ Nullsv, (I32)obase->op_private, FUV_SUBSCRIPT_ARRAY);
+ }
+ else {
+ gv = cGVOPx_gv(obase);
+ if (!gv)
+ break;
+ if (match) {
+ av = GvAV(gv);
+ if (!av || SvRMAGICAL(av))
+ break;
+ svp = av_fetch(av, (I32)obase->op_private, FALSE);
+ if (!svp || *svp != uninit_sv)
+ break;
+ }
+ return S_varname(aTHX_ gv, "$", 0,
+ Nullsv, (I32)obase->op_private, FUV_SUBSCRIPT_ARRAY);
+ }
+ break;
+
+ case OP_EXISTS:
+ o = cUNOPx(obase)->op_first;
+ if (!o || o->op_type != OP_NULL ||
+ ! (o->op_targ == OP_AELEM || o->op_targ == OP_HELEM))
+ break;
+ return find_uninit_var(cBINOPo->op_last, uninit_sv, match);
+
+ case OP_AELEM:
+ case OP_HELEM:
+ if (PL_op == obase)
+ /* $a[uninit_expr] or $h{uninit_expr} */
+ return find_uninit_var(cBINOPx(obase)->op_last, uninit_sv, match);
+
+ gv = Nullgv;
+ o = cBINOPx(obase)->op_first;
+ kid = cBINOPx(obase)->op_last;
+
+ /* get the av or hv, and optionally the gv */
+ sv = Nullsv;
+ if (o->op_type == OP_PADAV || o->op_type == OP_PADHV) {
+ sv = PAD_SV(o->op_targ);
+ }
+ else if ((o->op_type == OP_RV2AV || o->op_type == OP_RV2HV)
+ && cUNOPo->op_first->op_type == OP_GV)
+ {
+ gv = cGVOPx_gv(cUNOPo->op_first);
+ if (!gv)
+ break;
+ sv = o->op_type == OP_RV2HV ? (SV*)GvHV(gv) : (SV*)GvAV(gv);
+ }
+ if (!sv)
+ break;
+
+ if (kid && kid->op_type == OP_CONST && SvOK(cSVOPx_sv(kid))) {
+ /* index is constant */
+ if (match) {
+ if (SvMAGICAL(sv))
+ break;
+ if (obase->op_type == OP_HELEM) {
+ HE* he = hv_fetch_ent((HV*)sv, cSVOPx_sv(kid), 0, 0);
+ if (!he || HeVAL(he) != uninit_sv)
+ break;
+ }
+ else {
+ svp = av_fetch((AV*)sv, SvIV(cSVOPx_sv(kid)), FALSE);
+ if (!svp || *svp != uninit_sv)
+ break;
+ }
+ }
+ if (obase->op_type == OP_HELEM)
+ return S_varname(aTHX_ gv, "%", o->op_targ,
+ cSVOPx_sv(kid), 0, FUV_SUBSCRIPT_HASH);
+ else
+ return S_varname(aTHX_ gv, "@", o->op_targ, Nullsv,
+ SvIV(cSVOPx_sv(kid)), FUV_SUBSCRIPT_ARRAY);
+ ;
+ }
+ else {
+ /* index is an expression;
+ * attempt to find a match within the aggregate */
+ if (obase->op_type == OP_HELEM) {
+ SV *keysv = S_find_hash_subscript(aTHX_ (HV*)sv, uninit_sv);
+ if (keysv)
+ return S_varname(aTHX_ gv, "%", o->op_targ,
+ keysv, 0, FUV_SUBSCRIPT_HASH);
+ }
+ else {
+ I32 index = S_find_array_subscript(aTHX_ (AV*)sv, uninit_sv);
+ if (index >= 0)
+ return S_varname(aTHX_ gv, "@", o->op_targ,
+ Nullsv, index, FUV_SUBSCRIPT_ARRAY);
+ }
+ if (match)
+ break;
+ return S_varname(aTHX_ gv,
+ (o->op_type == OP_PADAV || o->op_type == OP_RV2AV)
+ ? "@" : "%",
+ o->op_targ, Nullsv, 0, FUV_SUBSCRIPT_WITHIN);
+ }
+
+ break;
+
+ case OP_AASSIGN:
+ /* only examine RHS */
+ return find_uninit_var(cBINOPx(obase)->op_first, uninit_sv, match);
+
+ case OP_OPEN:
+ o = cUNOPx(obase)->op_first;
+ if (o->op_type == OP_PUSHMARK)
+ o = o->op_sibling;
+
+ if (!o->op_sibling) {
+ /* one-arg version of open is highly magical */
+
+ if (o->op_type == OP_GV) { /* open FOO; */
+ gv = cGVOPx_gv(o);
+ if (match && GvSV(gv) != uninit_sv)
+ break;
+ return S_varname(aTHX_ gv, "$", 0,
+ Nullsv, 0, FUV_SUBSCRIPT_NONE);
+ }
+ /* other possibilities not handled are:
+ * open $x; or open my $x; should return '${*$x}'
+ * open expr; should return '$'.expr ideally
+ */
+ break;
+ }
+ goto do_op;
+
+ /* ops where $_ may be an implicit arg */
+ case OP_TRANS:
+ case OP_SUBST:
+ case OP_MATCH:
+ if ( !(obase->op_flags & OPf_STACKED)) {
+ if (uninit_sv == ((obase->op_private & OPpTARGET_MY)
+ ? PAD_SVl(obase->op_targ)
+ : DEFSV))
+ {
+ sv = sv_newmortal();
+ sv_setpv(sv, "$_");
+ return sv;
+ }
+ }
+ goto do_op;
+
+ case OP_PRTF:
+ case OP_PRINT:
+ /* skip filehandle as it can't produce 'undef' warning */
+ o = cUNOPx(obase)->op_first;
+ if ((obase->op_flags & OPf_STACKED) && o->op_type == OP_PUSHMARK)
+ o = o->op_sibling->op_sibling;
+ goto do_op2;
+
+
+ case OP_CUSTOM:
+ case OP_ENTERSUB:
+ match = 1; /* XS or custom code could trigger random warnings */
+ goto do_op;
+
+ case OP_SCHOMP:
+ case OP_CHOMP:
+ if (SvROK(PL_rs) && uninit_sv == SvRV(PL_rs))
+ return sv_2mortal(newSVpv("${$/}", 0));
+ /* FALL THROUGH */
+
+ default:
+ do_op:
+ if (!(obase->op_flags & OPf_KIDS))
+ break;
+ o = cUNOPx(obase)->op_first;
+
+ do_op2:
+ if (!o)
+ break;
+
+ /* if all except one arg are constant, or have no side-effects,
+ * or are optimized away, then it's unambiguous */
+ o2 = Nullop;
+ for (kid=o; kid; kid = kid->op_sibling) {
+ if (kid &&
+ ( (kid->op_type == OP_CONST && SvOK(cSVOPx_sv(kid)))
+ || (kid->op_type == OP_NULL && ! (kid->op_flags & OPf_KIDS))
+ || (kid->op_type == OP_PUSHMARK)
+ )
+ )
+ continue;
+ if (o2) { /* more than one found */
+ o2 = Nullop;
+ break;
+ }
+ o2 = kid;
+ }
+ if (o2)
+ return find_uninit_var(o2, uninit_sv, match);
+
+ /* scan all args */
+ while (o) {
+ sv = find_uninit_var(o, uninit_sv, 1);
+ if (sv)
+ return sv;
+ o = o->op_sibling;
+ }
+ break;
+ }
+ return Nullsv;
+}
+
+
/*
=for apidoc report_uninit
*/
void
-Perl_report_uninit(pTHX)
+Perl_report_uninit(pTHX_ SV* uninit_sv)
{
- if (PL_op)
+ if (PL_op) {
+ SV* varname;
+ if (uninit_sv) {
+ varname = find_uninit_var(PL_op, uninit_sv,0);
+ if (varname)
+ sv_insert(varname, 0, 0, " ", 1);
+ }
Perl_warner(aTHX_ packWARN(WARN_UNINITIALIZED), PL_warn_uninit,
- " in ", OP_DESC(PL_op));
+ varname ? SvPV_nolen(varname) : "",
+ " in ", OP_DESC(PL_op));
+ }
else
- Perl_warner(aTHX_ packWARN(WARN_UNINITIALIZED), PL_warn_uninit, "", "");
+ Perl_warner(aTHX_ packWARN(WARN_UNINITIALIZED), PL_warn_uninit,
+ "", "", "");
}
/* grab a new IV body from the free list, allocating more if necessary */
if (!SvROK(sv)) {
if (!(SvFLAGS(sv) & SVs_PADTMP)) {
if (ckWARN(WARN_UNINITIALIZED) && !PL_localizing)
- report_uninit();
+ report_uninit(sv);
}
return 0;
}
}
if (SvREADONLY(sv) && !SvOK(sv)) {
if (ckWARN(WARN_UNINITIALIZED))
- report_uninit();
+ report_uninit(sv);
return 0;
}
}
}
} else {
if (ckWARN(WARN_UNINITIALIZED) && !PL_localizing && !(SvFLAGS(sv) & SVs_PADTMP))
- report_uninit();
+ report_uninit(sv);
if (SvTYPE(sv) < SVt_IV)
/* Typically the caller expects that sv_any is not NULL now. */
sv_upgrade(sv, SVt_IV);
if (!SvROK(sv)) {
if (!(SvFLAGS(sv) & SVs_PADTMP)) {
if (ckWARN(WARN_UNINITIALIZED) && !PL_localizing)
- report_uninit();
+ report_uninit(sv);
}
return 0;
}
}
if (SvREADONLY(sv) && !SvOK(sv)) {
if (ckWARN(WARN_UNINITIALIZED))
- report_uninit();
+ report_uninit(sv);
return 0;
}
}
else {
if (!(SvFLAGS(sv) & SVs_PADTMP)) {
if (ckWARN(WARN_UNINITIALIZED) && !PL_localizing)
- report_uninit();
+ report_uninit(sv);
}
if (SvTYPE(sv) < SVt_IV)
/* Typically the caller expects that sv_any is not NULL now. */
if (!SvROK(sv)) {
if (!(SvFLAGS(sv) & SVs_PADTMP)) {
if (ckWARN(WARN_UNINITIALIZED) && !PL_localizing)
- report_uninit();
+ report_uninit(sv);
}
return 0;
}
}
if (SvREADONLY(sv) && !SvOK(sv)) {
if (ckWARN(WARN_UNINITIALIZED))
- report_uninit();
+ report_uninit(sv);
return 0.0;
}
}
}
else {
if (ckWARN(WARN_UNINITIALIZED) && !PL_localizing && !(SvFLAGS(sv) & SVs_PADTMP))
- report_uninit();
+ report_uninit(sv);
if (SvTYPE(sv) < SVt_NV)
/* Typically the caller expects that sv_any is not NULL now. */
/* XXX Ilya implies that this is a bug in callers that assume this
if (!SvROK(sv)) {
if (!(SvFLAGS(sv) & SVs_PADTMP)) {
if (ckWARN(WARN_UNINITIALIZED) && !PL_localizing)
- report_uninit();
+ report_uninit(sv);
}
*lp = 0;
return "";
}
if (SvREADONLY(sv) && !SvOK(sv)) {
if (ckWARN(WARN_UNINITIALIZED))
- report_uninit();
+ report_uninit(sv);
*lp = 0;
return "";
}
else {
if (ckWARN(WARN_UNINITIALIZED)
&& !PL_localizing && !(SvFLAGS(sv) & SVs_PADTMP))
- report_uninit();
+ report_uninit(sv);
*lp = 0;
if (SvTYPE(sv) < SVt_PV)
/* Typically the caller expects that sv_any is not NULL now. */
--- /dev/null
+DAPM 4/2004.
+
+Test the appearance of variable names in "Use of uninitialized value"
+warnings.
+
+The following ops aren't tested, mainly because they do IO or non-portable
+stuff:
+
+ send recv bind conect listen accept shutdown chdir chown chroot unlink
+ chmod utime rename link symlink readlink mkdir rmdir opendir seekdir
+ system exec kill getpgrp alarm sleep dofile require gethostbyname
+ gethostbyaddr getnetbyname getnetbyaddr getprotobyname getprotobynumber
+ getservbyname getservbyport sethostent setnetent setprotoent setservent
+ getpwnam getpwuid getgrnam getgrgid waitpid setpgrp setpriority
+ getpriority syscall dbmopen ioctl fcntl truncate getsockopt setsockopt
+ semctl semop semget msgget msgctl msgsnd msgrcv shmget shmctl shmread
+ shmwrite
+
+ ---------------------------------------------------
+
+
+__END__
+use warnings 'uninitialized';
+my ($m1, $m2, $v);
+
+$v = $m1 + 10;
+$v = 22 + $m2;
+$v = $m1 + $m2;
+EXPECT
+Use of uninitialized value $m1 in addition (+) at - line 4.
+Use of uninitialized value $m2 in addition (+) at - line 5.
+Use of uninitialized value $m2 in addition (+) at - line 6.
+Use of uninitialized value $m1 in addition (+) at - line 6.
+########
+use warnings 'uninitialized';
+my ($m1, $v);
+our ($g1, $g2);
+
+$v = $g1 + 21;
+$v = 31 + $g2;
+$v = $g1 + $g2;
+$v = $m1 + $g2;
+EXPECT
+Use of uninitialized value $g1 in addition (+) at - line 5.
+Use of uninitialized value $g2 in addition (+) at - line 6.
+Use of uninitialized value $g2 in addition (+) at - line 7.
+Use of uninitialized value $g1 in addition (+) at - line 7.
+Use of uninitialized value $g2 in addition (+) at - line 8.
+Use of uninitialized value $m1 in addition (+) at - line 8.
+########
+use warnings 'uninitialized';
+my ($m1, @ma, $v);
+
+$v = $ma[5] + 45;
+$v = 56 + $ma[6];
+$v = $ma[7] + $m1;
+$v = $ma[8] + $ma[9];
+$v = $ma[-1] + $ma[-2];
+EXPECT
+Use of uninitialized value $ma[5] in addition (+) at - line 4.
+Use of uninitialized value $ma[6] in addition (+) at - line 5.
+Use of uninitialized value $m1 in addition (+) at - line 6.
+Use of uninitialized value in addition (+) at - line 6.
+Use of uninitialized value in addition (+) at - line 7.
+Use of uninitialized value in addition (+) at - line 7.
+Use of uninitialized value in addition (+) at - line 8.
+Use of uninitialized value in addition (+) at - line 8.
+########
+use warnings 'uninitialized';
+my ($v);
+my @mau = (undef) x 258;
+my %mhu = ('foo', undef, 'bar', undef);
+
+$v = $mau[5] + 23;
+$v = $mau[-5] + 45;
+$v = 56 + $mau[6];
+$v = 78 + $mau[-6];
+$v = $mau[7] + $mau[8];
+$v = $mau[256] + $mau[257];
+$v = $mau[-1] + $mau[-2];
+$v = $mhu{foo} + $mhu{bar};
+EXPECT
+Use of uninitialized value $mau[5] in addition (+) at - line 6.
+Use of uninitialized value $mau[-5] in addition (+) at - line 7.
+Use of uninitialized value $mau[6] in addition (+) at - line 8.
+Use of uninitialized value $mau[-6] in addition (+) at - line 9.
+Use of uninitialized value $mau[8] in addition (+) at - line 10.
+Use of uninitialized value $mau[7] in addition (+) at - line 10.
+Use of uninitialized value $mau[257] in addition (+) at - line 11.
+Use of uninitialized value $mau[256] in addition (+) at - line 11.
+Use of uninitialized value $mau[-2] in addition (+) at - line 12.
+Use of uninitialized value $mau[-1] in addition (+) at - line 12.
+Use of uninitialized value $mhu{"bar"} in addition (+) at - line 13.
+Use of uninitialized value $mhu{"foo"} in addition (+) at - line 13.
+########
+use warnings 'uninitialized';
+my ($v);
+our (@ga);
+
+$v = $ga[8] + 21;
+$v = $ga[-8] + 46;
+$v = 57 + $ga[9];
+$v = 58 + $ga[-9];
+$v = $ga[10] + $ga[11];
+$v = $ga[-10] + $ga[-11];
+EXPECT
+Use of uninitialized value $ga[8] in addition (+) at - line 5.
+Use of uninitialized value $ga[-8] in addition (+) at - line 6.
+Use of uninitialized value $ga[9] in addition (+) at - line 7.
+Use of uninitialized value $ga[-9] in addition (+) at - line 8.
+Use of uninitialized value in addition (+) at - line 9.
+Use of uninitialized value in addition (+) at - line 9.
+Use of uninitialized value in addition (+) at - line 10.
+Use of uninitialized value in addition (+) at - line 10.
+########
+use warnings 'uninitialized';
+my ($v);
+our @gau = (undef) x 258;
+our %ghu = ('foo', undef, 'bar', undef);
+
+$v = $gau[8] + 46;
+$v = $gau[-8] + 47;
+$v = 57 + $gau[9];
+$v = 57 + $gau[-9];
+$v = $gau[10] + $gau[11];
+$v = $gau[256] + $gau[257];
+$v = $gau[-1] + $gau[-2];
+$v = $ghu{foo} + $ghu{bar};
+EXPECT
+Use of uninitialized value $gau[8] in addition (+) at - line 6.
+Use of uninitialized value $gau[-8] in addition (+) at - line 7.
+Use of uninitialized value $gau[9] in addition (+) at - line 8.
+Use of uninitialized value $gau[-9] in addition (+) at - line 9.
+Use of uninitialized value $gau[11] in addition (+) at - line 10.
+Use of uninitialized value $gau[10] in addition (+) at - line 10.
+Use of uninitialized value $gau[257] in addition (+) at - line 11.
+Use of uninitialized value $gau[256] in addition (+) at - line 11.
+Use of uninitialized value $gau[-2] in addition (+) at - line 12.
+Use of uninitialized value $gau[-1] in addition (+) at - line 12.
+Use of uninitialized value $ghu{"bar"} in addition (+) at - line 13.
+Use of uninitialized value $ghu{"foo"} in addition (+) at - line 13.
+########
+use warnings 'uninitialized';
+my ($v);
+our @gau = (undef) x 258;
+our %ghu = ('foo', undef, 'bar', undef);
+my @mau = (undef) x 258;
+my %mhu = ('foo', undef, 'bar', undef);
+
+my $i1 = 10;
+my $i2 = 20;
+my $i3 = 2000;
+my $k1 = 'foo';
+my $k2 = 'bar';
+my $k3 = 'baz';
+$v = $mau[$i1] + $mau[$i2];
+$v = $gau[$i1] + $gau[$i2];
+$v = $gau[$i1] + $gau[$i3];
+$v = $mhu{$k1} + $mhu{$k2};
+$v = $ghu{$k1} + $ghu{$k2};
+$v = $ghu{$k1} + $ghu{$k3};
+EXPECT
+Use of uninitialized value $mau[20] in addition (+) at - line 14.
+Use of uninitialized value $mau[10] in addition (+) at - line 14.
+Use of uninitialized value $gau[20] in addition (+) at - line 15.
+Use of uninitialized value $gau[10] in addition (+) at - line 15.
+Use of uninitialized value in addition (+) at - line 16.
+Use of uninitialized value $gau[10] in addition (+) at - line 16.
+Use of uninitialized value $mhu{"bar"} in addition (+) at - line 17.
+Use of uninitialized value $mhu{"foo"} in addition (+) at - line 17.
+Use of uninitialized value $ghu{"bar"} in addition (+) at - line 18.
+Use of uninitialized value $ghu{"foo"} in addition (+) at - line 18.
+Use of uninitialized value in addition (+) at - line 19.
+Use of uninitialized value $ghu{"foo"} in addition (+) at - line 19.
+########
+use warnings 'uninitialized';
+my ($m1, $m2, @ma, %mh, $v);
+our ($g1, $g2, @ga, %gh);
+
+$v = $ma[$m1];
+$v = $ma[$g1];
+$v = $ga[$m2];
+$v = $ga[$g2];
+
+$v = $mh{$m1};
+$v = $mh{$g1};
+$v = $gh{$m2};
+$v = $gh{$g2};
+
+$v = $m1+($m2-$g1);
+$v = $ma[$ga[3]];
+$v = $ga[$ma[4]];
+EXPECT
+Use of uninitialized value $m1 in array element at - line 5.
+Use of uninitialized value $g1 in array element at - line 6.
+Use of uninitialized value $m2 in array element at - line 7.
+Use of uninitialized value $g2 in array element at - line 8.
+Use of uninitialized value $m1 in hash element at - line 10.
+Use of uninitialized value $g1 in hash element at - line 11.
+Use of uninitialized value $m2 in hash element at - line 12.
+Use of uninitialized value $g2 in hash element at - line 13.
+Use of uninitialized value $g1 in subtraction (-) at - line 15.
+Use of uninitialized value $m2 in subtraction (-) at - line 15.
+Use of uninitialized value $m1 in addition (+) at - line 15.
+Use of uninitialized value $ga[3] in array element at - line 16.
+Use of uninitialized value $ma[4] in array element at - line 17.
+########
+use warnings 'uninitialized';
+my (@ma, %mh, $v);
+our (@ga, %gh);
+
+$v = sin $ga[1000];
+$v = sin $ma[1000];
+$v = sin $gh{foo};
+$v = sin $mh{bar};
+
+$v = sin $ga[$$];
+$v = sin $ma[$$];
+$v = sin $gh{$$};
+$v = sin $mh{$$};
+EXPECT
+Use of uninitialized value $ga[1000] in sin at - line 5.
+Use of uninitialized value $ma[1000] in sin at - line 6.
+Use of uninitialized value $gh{"foo"} in sin at - line 7.
+Use of uninitialized value $mh{"bar"} in sin at - line 8.
+Use of uninitialized value within @ga in sin at - line 10.
+Use of uninitialized value within @ma in sin at - line 11.
+Use of uninitialized value within %gh in sin at - line 12.
+Use of uninitialized value within %mh in sin at - line 13.
+########
+use warnings 'uninitialized';
+my (@mat, %mht, $v);
+sub X::TIEARRAY { bless [], 'X' }
+sub X::TIEHASH { bless [], 'X' }
+sub X::FETCH { undef }
+tie @mat, 'X';
+tie %mht, 'X';
+my $key1 = 'akey';
+my $key2 = 'bkey';
+my $index1 = 33;
+my $index2 = 55;
+
+$v = sin $mat[0];
+$v = $mat[0] + $mat[1];
+$v = sin $mat[1000];
+$v = $mat[1000] + $mat[1001];
+
+$v = sin $mat[$index1];
+$v = $mat[$index1] + $mat[$index2];
+
+$v = sin $mht{foo};
+$v = $mht{foo} + $mht{bar};
+
+$v = sin $mht{$key1};
+$v = $mht{$key1} + $mht{$key2};
+
+$v = $1+1;
+EXPECT
+Use of uninitialized value $mat[0] in sin at - line 13.
+Use of uninitialized value in addition (+) at - line 14.
+Use of uninitialized value in addition (+) at - line 14.
+Use of uninitialized value $mat[1000] in sin at - line 15.
+Use of uninitialized value in addition (+) at - line 16.
+Use of uninitialized value in addition (+) at - line 16.
+Use of uninitialized value within @mat in sin at - line 18.
+Use of uninitialized value in addition (+) at - line 19.
+Use of uninitialized value in addition (+) at - line 19.
+Use of uninitialized value $mht{"foo"} in sin at - line 21.
+Use of uninitialized value in addition (+) at - line 22.
+Use of uninitialized value in addition (+) at - line 22.
+Use of uninitialized value within %mht in sin at - line 24.
+Use of uninitialized value in addition (+) at - line 25.
+Use of uninitialized value in addition (+) at - line 25.
+Use of uninitialized value $1 in addition (+) at - line 27.
+########
+use warnings 'uninitialized';
+my ($m1);
+our ($g1, @ga);
+
+print $ga[1000];
+print STDERR $ga[1000];
+print STDERR $m1, $g1, $ga[1],$m2;
+print STDERR "", $ga[1],"";
+EXPECT
+Use of uninitialized value $ga[1000] in print at - line 5.
+Use of uninitialized value $ga[1000] in print at - line 6.
+Use of uninitialized value $m1 in print at - line 7.
+Use of uninitialized value $g1 in print at - line 7.
+Use of uninitialized value in print at - line 7.
+Use of uninitialized value $m2 in print at - line 7.
+Use of uninitialized value $ga[1] in print at - line 8.
+########
+use warnings 'uninitialized';
+my ($m1);
+our ($g1);
+
+close $m1; # exercises rv2gv
+close $g1; # exercises rv2gv
+EXPECT
+Use of uninitialized value $m1 in ref-to-glob cast at - line 5.
+Use of uninitialized value $g1 in ref-to-glob cast at - line 6.
+########
+use warnings 'uninitialized';
+my ($m1, $m2, $v);
+our ($g1, $g2);
+
+$v = $$m1;
+$v = $$g1;
+
+$v = @$m1;
+$v = @$g1;
+$v = %$m2;
+$v = %$g2;
+EXPECT
+Use of uninitialized value $m1 in scalar dereference at - line 5.
+Use of uninitialized value $g1 in scalar dereference at - line 6.
+Use of uninitialized value $m1 in array dereference at - line 8.
+Use of uninitialized value $g1 in array dereference at - line 9.
+Use of uninitialized value $m2 in hash dereference at - line 10.
+Use of uninitialized value $g2 in hash dereference at - line 11.
+########
+use warnings 'uninitialized';
+my ($m1, $v);
+our ($g1);
+
+$v = $m1 | $m2;
+$v = $m1 & $m2;
+$v = $m1 ^ $m2;
+$v = ~$m1;
+
+$v = $g1 | $g2;
+$v = $g1 & $g2;
+$v = $g1 ^ $g2;
+$v = ~$g1;
+EXPECT
+Use of uninitialized value $m1 in bitwise or (|) at - line 5.
+Use of uninitialized value $m2 in bitwise or (|) at - line 5.
+Use of uninitialized value $m1 in bitwise and (&) at - line 6.
+Use of uninitialized value $m2 in bitwise and (&) at - line 6.
+Use of uninitialized value $m1 in bitwise xor (^) at - line 7.
+Use of uninitialized value $m2 in bitwise xor (^) at - line 7.
+Use of uninitialized value $m1 in 1's complement (~) at - line 8.
+Use of uninitialized value $g1 in bitwise or (|) at - line 10.
+Use of uninitialized value $g2 in bitwise or (|) at - line 10.
+Use of uninitialized value $g1 in bitwise and (&) at - line 11.
+Use of uninitialized value $g2 in bitwise and (&) at - line 11.
+Use of uninitialized value $g1 in bitwise xor (^) at - line 12.
+Use of uninitialized value $g2 in bitwise xor (^) at - line 12.
+Use of uninitialized value $g1 in 1's complement (~) at - line 13.
+########
+use warnings 'uninitialized';
+my ($v);
+
+my $tmp1; $v = $tmp1++; # (doesn't warn)
+our $tmp2; $v = $tmp2++; # (doesn't warn)
+my $tmp3; $v = ++$tmp1; # (doesn't warn)
+our $tmp4; $v = ++$tmp2; # (doesn't warn)
+
+my $tmp5; $v = $tmp5--; # (doesn't warn)
+our $tmp6; $v = $tmp6--; # (doesn't warn)
+my $tmp7; $v = --$tmp7; # (doesn't warn)
+our $tmp8; $v = --$tmp8; # (doesn't warn)
+EXPECT
+########
+use warnings 'uninitialized';
+
+my $s1; chomp $s1;
+my $s2; chop $s2;
+my ($s3,$s4); chomp ($s3,$s4);
+my ($s5,$s6); chop ($s5,$s6);
+EXPECT
+Use of uninitialized value $s1 in scalar chomp at - line 3.
+Use of uninitialized value $s2 in scalar chop at - line 4.
+Use of uninitialized value $s4 in chomp at - line 5.
+Use of uninitialized value $s3 in chomp at - line 5.
+Use of uninitialized value $s5 in chop at - line 6.
+Use of uninitialized value $s6 in chop at - line 6.
+########
+use warnings 'uninitialized';
+my ($m1);
+
+local $/ =\$m1;
+my $x = "abc";
+chomp $x; chop $x;
+my $y;
+chomp ($x, $y); chop ($x, $y);
+EXPECT
+Use of uninitialized value ${$/} in scalar chomp at - line 6.
+Use of uninitialized value ${$/} in chomp at - line 8.
+Use of uninitialized value $y in chomp at - line 8.
+Use of uninitialized value ${$/} in chomp at - line 8.
+Use of uninitialized value $y in chop at - line 8.
+########
+use warnings 'uninitialized';
+my ($m1, @ma, %mh);
+our ($g1);
+
+delete $ma[$m1];
+delete @ma[$m1, $g1];
+delete $mh{$m1};
+delete @mh{$m1, $g1};
+EXPECT
+Use of uninitialized value $m1 in delete at - line 5.
+Use of uninitialized value $m1 in delete at - line 6.
+Use of uninitialized value $g1 in delete at - line 6.
+Use of uninitialized value $m1 in delete at - line 7.
+Use of uninitialized value $m1 in delete at - line 8.
+Use of uninitialized value $g1 in delete at - line 8.
+########
+use warnings 'uninitialized';
+my ($m1, @ma, %mh);
+our ($g1);
+
+my @a = @ma[$m1, $g1];
+@a = (4,5)[$m1, $g1];
+@a = @mh{$m1, $g1};
+EXPECT
+Use of uninitialized value $m1 in array slice at - line 5.
+Use of uninitialized value $g1 in array slice at - line 5.
+Use of uninitialized value $m1 in list slice at - line 6.
+Use of uninitialized value $g1 in list slice at - line 6.
+Use of uninitialized value $m1 in hash slice at - line 7.
+Use of uninitialized value $g1 in hash slice at - line 7.
+########
+use warnings 'uninitialized';
+my ($m1, @ma, %mh, $v);
+our ($g1, @ga, %gh);
+
+$v = exists $ma[$m1];
+$v = exists $ga[$g1];
+$v = exists $mh{$m1};
+$v = exists $gh{$g1};
+EXPECT
+Use of uninitialized value $m1 in exists at - line 5.
+Use of uninitialized value $g1 in exists at - line 6.
+Use of uninitialized value $m1 in exists at - line 7.
+Use of uninitialized value $g1 in exists at - line 8.
+########
+use warnings 'uninitialized';
+my ($m1, $v);
+our ($g1);
+
+my ($x1,$x2);
+$v = $x1 << $m1;
+$v = $x2 << $g1;
+EXPECT
+Use of uninitialized value $m1 in left bitshift (<<) at - line 6.
+Use of uninitialized value $x1 in left bitshift (<<) at - line 6.
+Use of uninitialized value $g1 in left bitshift (<<) at - line 7.
+Use of uninitialized value $x2 in left bitshift (<<) at - line 7.
+########
+use warnings 'uninitialized';
+my ($m1, $m2, $v);
+our ($g1, $g2);
+
+use integer;
+$v = $m1 + $g1;
+$v = $m1 - $g1;
+$v = $m1 * $g1;
+eval {$v = $m1 / $g1};
+$v = $m2 / 2;
+eval {$v = $m1 % $g1};
+$v = $m2 % 2;
+$v = $m1 < $g1;
+$v = $m1 > $g1;
+$v = $m1 <= $g1;
+$v = $m1 >= $g1;
+$v = $m1 == $g1;
+$v = $m1 != $g1;
+$v = $m1 <=> $g1;
+$v = -$m1;
+EXPECT
+Use of uninitialized value $g1 in integer addition (+) at - line 6.
+Use of uninitialized value $m1 in integer addition (+) at - line 6.
+Use of uninitialized value $g1 in integer subtraction (-) at - line 7.
+Use of uninitialized value $m1 in integer subtraction (-) at - line 7.
+Use of uninitialized value $g1 in integer multiplication (*) at - line 8.
+Use of uninitialized value $m1 in integer multiplication (*) at - line 8.
+Use of uninitialized value $g1 in integer division (/) at - line 9.
+Use of uninitialized value $m2 in integer division (/) at - line 10.
+Use of uninitialized value $g1 in integer modulus (%) at - line 11.
+Use of uninitialized value $m1 in integer modulus (%) at - line 11.
+Use of uninitialized value $m2 in integer modulus (%) at - line 12.
+Use of uninitialized value $g1 in integer lt (<) at - line 13.
+Use of uninitialized value $m1 in integer lt (<) at - line 13.
+Use of uninitialized value $g1 in integer gt (>) at - line 14.
+Use of uninitialized value $m1 in integer gt (>) at - line 14.
+Use of uninitialized value $g1 in integer le (<=) at - line 15.
+Use of uninitialized value $m1 in integer le (<=) at - line 15.
+Use of uninitialized value $g1 in integer ge (>=) at - line 16.
+Use of uninitialized value $m1 in integer ge (>=) at - line 16.
+Use of uninitialized value $g1 in integer eq (==) at - line 17.
+Use of uninitialized value $m1 in integer eq (==) at - line 17.
+Use of uninitialized value $g1 in integer ne (!=) at - line 18.
+Use of uninitialized value $m1 in integer ne (!=) at - line 18.
+Use of uninitialized value $g1 in integer comparison (<=>) at - line 19.
+Use of uninitialized value $m1 in integer comparison (<=>) at - line 19.
+Use of uninitialized value $m1 in integer negation (-) at - line 20.
+########
+use warnings 'uninitialized';
+my ($m1, $m2, $v);
+our ($g1, $g2);
+
+$v = int($g1);
+$v = abs($g2);
+EXPECT
+Use of uninitialized value $g1 in int at - line 5.
+Use of uninitialized value $g1 in int at - line 5.
+Use of uninitialized value $g2 in abs at - line 6.
+Use of uninitialized value $g2 in abs at - line 6.
+########
+use warnings 'uninitialized';
+my ($m1, $m2, $v);
+our ($g1);
+
+$v = pack $m1;
+$v = pack "i*", $m2, $g1, $g2;
+my @unpack = unpack $m1, $m2;
+EXPECT
+Use of uninitialized value $m1 in pack at - line 5.
+Use of uninitialized value $m2 in pack at - line 6.
+Use of uninitialized value $g1 in pack at - line 6.
+Use of uninitialized value $g2 in pack at - line 6.
+Use of uninitialized value $m1 in unpack at - line 7.
+Use of uninitialized value $m2 in unpack at - line 7.
+########
+use warnings 'uninitialized';
+my ($m1);
+our ($g1);
+
+my @sort;
+@sort = sort $m1, $g1;
+@sort = sort {$a <=> $b} $m1, $g1;
+sub sortf {$a-1 <=> $b-1};
+@sort = sort &sortf, $m1, $g1;
+EXPECT
+Use of uninitialized value $m1 in sort at - line 6.
+Use of uninitialized value $g1 in sort at - line 6.
+Use of uninitialized value $m1 in sort at - line 6.
+Use of uninitialized value $g1 in sort at - line 6.
+Use of uninitialized value $m1 in sort at - line 7.
+Use of uninitialized value $g1 in sort at - line 7.
+Use of uninitialized value $m1 in sort at - line 7.
+Use of uninitialized value $g1 in sort at - line 7.
+Use of uninitialized value $a in subtraction (-) at - line 8.
+Use of uninitialized value $b in subtraction (-) at - line 8.
+Use of uninitialized value $m1 in sort at - line 9.
+Use of uninitialized value $g1 in sort at - line 9.
+Use of uninitialized value $m1 in sort at - line 9.
+Use of uninitialized value $m1 in sort at - line 9.
+Use of uninitialized value $g1 in sort at - line 9.
+Use of uninitialized value $g1 in sort at - line 9.
+########
+use warnings 'uninitialized';
+my ($m1, $m2, $v);
+our ($g1);
+
+eval { $v = $m1 / $g1 };
+$v = $m2 / 2;
+eval { $v = $m1 % $g1 };
+$v = $m2 % 2;
+$v = $m1 == $g1;
+$v = $m1 >= $g1;
+$v = $m1 > $g1;
+$v = $m1 <= $g1;
+$v = $m1 < $g1;
+$v = $m1 * $g1;
+$v = $m1 <=>$g1;
+$v = $m1 != $g1;
+$v = $m1 -$g1;
+$v = $m1 ** $g1;
+$v = $m1 + $g1;
+$v = $m1 - $g1;
+EXPECT
+Use of uninitialized value $g1 in division (/) at - line 5.
+Use of uninitialized value $m1 in division (/) at - line 5.
+Use of uninitialized value $m2 in division (/) at - line 6.
+Use of uninitialized value $g1 in modulus (%) at - line 7.
+Use of uninitialized value $m1 in modulus (%) at - line 7.
+Use of uninitialized value $m2 in modulus (%) at - line 8.
+Use of uninitialized value $g1 in numeric eq (==) at - line 9.
+Use of uninitialized value $m1 in numeric eq (==) at - line 9.
+Use of uninitialized value $g1 in numeric ge (>=) at - line 10.
+Use of uninitialized value $m1 in numeric ge (>=) at - line 10.
+Use of uninitialized value $g1 in numeric gt (>) at - line 11.
+Use of uninitialized value $m1 in numeric gt (>) at - line 11.
+Use of uninitialized value $g1 in numeric le (<=) at - line 12.
+Use of uninitialized value $m1 in numeric le (<=) at - line 12.
+Use of uninitialized value $g1 in numeric lt (<) at - line 13.
+Use of uninitialized value $m1 in numeric lt (<) at - line 13.
+Use of uninitialized value $g1 in multiplication (*) at - line 14.
+Use of uninitialized value $m1 in multiplication (*) at - line 14.
+Use of uninitialized value $g1 in numeric comparison (<=>) at - line 15.
+Use of uninitialized value $m1 in numeric comparison (<=>) at - line 15.
+Use of uninitialized value $g1 in numeric ne (!=) at - line 16.
+Use of uninitialized value $m1 in numeric ne (!=) at - line 16.
+Use of uninitialized value $g1 in subtraction (-) at - line 17.
+Use of uninitialized value $m1 in subtraction (-) at - line 17.
+Use of uninitialized value $g1 in exponentiation (**) at - line 18.
+Use of uninitialized value $m1 in exponentiation (**) at - line 18.
+Use of uninitialized value $g1 in addition (+) at - line 19.
+Use of uninitialized value $m1 in addition (+) at - line 19.
+Use of uninitialized value $g1 in subtraction (-) at - line 20.
+Use of uninitialized value $m1 in subtraction (-) at - line 20.
+########
+use warnings 'uninitialized';
+my ($m1, $v);
+our ($g1);
+
+$v = *global1{$m1};
+$v = prototype $g1;
+$v = bless [], $g1;
+$v = `$m1`;
+
+$v = $m1 . $g1;
+EXPECT
+Use of uninitialized value $m1 in glob elem at - line 5.
+Use of uninitialized value $g1 in subroutine prototype at - line 6.
+Use of uninitialized value $g1 in bless at - line 7.
+Use of uninitialized value $m1 in quoted execution (``, qx) at - line 8.
+Use of uninitialized value $g1 in concatenation (.) or string at - line 10.
+Use of uninitialized value $m1 in concatenation (.) or string at - line 10.
+########
+use warnings 'uninitialized';
+my ($m1);
+our ($g1, $g2);
+
+/y/;
+/$m1/;
+/$g1/;
+
+s/y/z/; undef $_;
+s/$m1/z/; undef $_;
+s//$g1/; undef $_;
+s/$m1/$g1/; undef $_;
+tr/x/y/; undef $_;
+
+my $_;
+/y/;
+/$m1/;
+/$g1/;
+s/y/z/; undef $_;
+s/$m1/z/; undef $_;
+s//$g1/; undef $_;
+s/$m1/$g1/; undef $_;
+tr/x/y/; undef $_;
+
+$g2 =~ /y/;
+$g2 =~ /$m1/;
+$g2 =~ /$g1/;
+$g2 =~ s/y/z/; undef $g2;
+$g2 =~ s/$m1/z/; undef $g2;
+$g2 =~ s//$g1/; undef $g2;
+$g2 =~ s/$m1/$g1/; undef $g2;
+$g2 =~ tr/x/y/; undef $g2; # XXX can't extract var name yet
+
+my $foo = "abc";
+$foo =~ /$m1/;
+$foo =~ /$g1/;
+$foo =~ s/y/z/;
+$foo =~ s/$m1/z/;
+$foo =~ s//$g1/;
+$foo =~ s/$m1/$g1/;
+$foo =~ s/./$m1/e;
+EXPECT
+Use of uninitialized value $_ in pattern match (m//) at - line 5.
+Use of uninitialized value $m1 in regexp compilation at - line 6.
+Use of uninitialized value $_ in pattern match (m//) at - line 6.
+Use of uninitialized value $g1 in regexp compilation at - line 7.
+Use of uninitialized value $_ in pattern match (m//) at - line 7.
+Use of uninitialized value $_ in substitution (s///) at - line 9.
+Use of uninitialized value $m1 in regexp compilation at - line 10.
+Use of uninitialized value $_ in substitution (s///) at - line 10.
+Use of uninitialized value $_ in substitution (s///) at - line 10.
+Use of uninitialized value $_ in substitution (s///) at - line 11.
+Use of uninitialized value $g1 in substitution (s///) at - line 11.
+Use of uninitialized value $_ in substitution (s///) at - line 11.
+Use of uninitialized value $g1 in substitution (s///) at - line 11.
+Use of uninitialized value $m1 in regexp compilation at - line 12.
+Use of uninitialized value $_ in substitution (s///) at - line 12.
+Use of uninitialized value $_ in substitution (s///) at - line 12.
+Use of uninitialized value $g1 in substitution iterator at - line 12.
+Use of uninitialized value $_ in transliteration (tr///) at - line 13.
+Use of uninitialized value $_ in pattern match (m//) at - line 16.
+Use of uninitialized value $m1 in regexp compilation at - line 17.
+Use of uninitialized value $_ in pattern match (m//) at - line 17.
+Use of uninitialized value $g1 in regexp compilation at - line 18.
+Use of uninitialized value $_ in pattern match (m//) at - line 18.
+Use of uninitialized value $_ in substitution (s///) at - line 19.
+Use of uninitialized value $m1 in regexp compilation at - line 20.
+Use of uninitialized value $_ in substitution (s///) at - line 20.
+Use of uninitialized value $_ in substitution (s///) at - line 20.
+Use of uninitialized value $_ in substitution (s///) at - line 21.
+Use of uninitialized value $g1 in substitution (s///) at - line 21.
+Use of uninitialized value $_ in substitution (s///) at - line 21.
+Use of uninitialized value $g1 in substitution (s///) at - line 21.
+Use of uninitialized value $m1 in regexp compilation at - line 22.
+Use of uninitialized value $_ in substitution (s///) at - line 22.
+Use of uninitialized value $_ in substitution (s///) at - line 22.
+Use of uninitialized value $g1 in substitution iterator at - line 22.
+Use of uninitialized value $_ in transliteration (tr///) at - line 23.
+Use of uninitialized value $g2 in pattern match (m//) at - line 25.
+Use of uninitialized value $m1 in regexp compilation at - line 26.
+Use of uninitialized value $g2 in pattern match (m//) at - line 26.
+Use of uninitialized value $g1 in regexp compilation at - line 27.
+Use of uninitialized value $g2 in pattern match (m//) at - line 27.
+Use of uninitialized value $g2 in substitution (s///) at - line 28.
+Use of uninitialized value $m1 in regexp compilation at - line 29.
+Use of uninitialized value $g2 in substitution (s///) at - line 29.
+Use of uninitialized value $g2 in substitution (s///) at - line 29.
+Use of uninitialized value $g2 in substitution (s///) at - line 30.
+Use of uninitialized value $g1 in substitution (s///) at - line 30.
+Use of uninitialized value $g2 in substitution (s///) at - line 30.
+Use of uninitialized value $g1 in substitution (s///) at - line 30.
+Use of uninitialized value $m1 in regexp compilation at - line 31.
+Use of uninitialized value $g2 in substitution (s///) at - line 31.
+Use of uninitialized value $g2 in substitution (s///) at - line 31.
+Use of uninitialized value $g1 in substitution iterator at - line 31.
+Use of uninitialized value in transliteration (tr///) at - line 32.
+Use of uninitialized value $m1 in regexp compilation at - line 35.
+Use of uninitialized value $g1 in regexp compilation at - line 36.
+Use of uninitialized value $m1 in regexp compilation at - line 38.
+Use of uninitialized value $g1 in substitution (s///) at - line 39.
+Use of uninitialized value $m1 in regexp compilation at - line 40.
+Use of uninitialized value $g1 in substitution iterator at - line 40.
+Use of uninitialized value $m1 in substitution iterator at - line 41.
+########
+use warnings 'uninitialized';
+my ($m1);
+
+{ my $foo = "abc"; (substr($foo,0,0)) = ($m1) }
+EXPECT
+Use of uninitialized value $m1 in list assignment at - line 4.
+########
+use warnings 'uninitialized';
+our ($g1);
+
+study;
+study $g1;
+EXPECT
+Use of uninitialized value $_ in study at - line 4.
+Use of uninitialized value $g1 in study at - line 5.
+########
+use warnings 'uninitialized';
+my ($m1);
+
+pos()=0;
+pos($m1)=0;
+EXPECT
+Use of uninitialized value $_ in scalar assignment at - line 4.
+Use of uninitialized value $m1 in scalar assignment at - line 5.
+########
+use warnings 'uninitialized';
+my ($m1);
+
+{ my $x = "a" x $m1 } # NB LHS of repeat does not warn
+{ my @x = ("a") x $m1 }
+EXPECT
+Use of uninitialized value $m1 in repeat (x) at - line 4.
+Use of uninitialized value $m1 in repeat (x) at - line 5.
+########
+use warnings 'uninitialized';
+my ($m1, $v);
+our ($g1);
+
+$v = "$m1";
+
+$v = $m1 lt $g1;
+$v = $m1 le $g1;
+$v = $m1 gt $g1;
+$v = $m1 ge $g1;
+$v = $m1 eq $g1;
+$v = $m1 ne $g1;
+$v = $m1 cmp $g1;
+EXPECT
+Use of uninitialized value $m1 in string at - line 5.
+Use of uninitialized value $m1 in string lt at - line 7.
+Use of uninitialized value $g1 in string lt at - line 7.
+Use of uninitialized value $m1 in string le at - line 8.
+Use of uninitialized value $g1 in string le at - line 8.
+Use of uninitialized value $m1 in string gt at - line 9.
+Use of uninitialized value $g1 in string gt at - line 9.
+Use of uninitialized value $m1 in string ge at - line 10.
+Use of uninitialized value $g1 in string ge at - line 10.
+Use of uninitialized value $m1 in string eq at - line 11.
+Use of uninitialized value $g1 in string eq at - line 11.
+Use of uninitialized value $m1 in string ne at - line 12.
+Use of uninitialized value $g1 in string ne at - line 12.
+Use of uninitialized value $m1 in string comparison (cmp) at - line 13.
+Use of uninitialized value $g1 in string comparison (cmp) at - line 13.
+########
+use warnings 'uninitialized';
+my ($m1, $v);
+our ($g1);
+
+$v = atan2($m1,$g1);
+$v = sin $m1;
+$v = cos $m1;
+$v = rand $m1;
+$v = srand $m1;
+$v = exp $m1;
+$v = eval {log $m1};
+$v = sqrt $m1;
+$v = hex $m1;
+$v = oct $m1;
+$v = length $m1;
+$v = length;
+EXPECT
+Use of uninitialized value $g1 in atan2 at - line 5.
+Use of uninitialized value $m1 in atan2 at - line 5.
+Use of uninitialized value $m1 in sin at - line 6.
+Use of uninitialized value $m1 in cos at - line 7.
+Use of uninitialized value $m1 in rand at - line 8.
+Use of uninitialized value $m1 in srand at - line 9.
+Use of uninitialized value $m1 in exp at - line 10.
+Use of uninitialized value $m1 in log at - line 11.
+Use of uninitialized value $m1 in sqrt at - line 12.
+Use of uninitialized value $m1 in hex at - line 13.
+Use of uninitialized value $m1 in oct at - line 14.
+Use of uninitialized value $m1 in length at - line 15.
+Use of uninitialized value $_ in length at - line 16.
+########
+use warnings 'uninitialized';
+my ($m1, $v);
+our ($g1);
+
+$v = substr $m1, $g1;
+$v = substr $m1, $g1, $m2;
+$v = substr $m1, $g1, $m2, $g2; undef $m1;
+substr($m1, $g1) = $g2; undef $m1; # NB global2
+substr($m1, $g1, $m2) = $g2; undef $m1; # isn't identified
+
+$v = eval {vec ($m1, $g1, $m2)};
+eval {vec ($m1, $g1, $m2) = $g2}; undef $m1; # ditto
+
+$v = index $m1, $m2;
+$v = index $m1, $m2, $g1;
+$v = rindex $m1, $m2;
+$v = rindex $m1, $m2, $g1;
+EXPECT
+Use of uninitialized value $g1 in substr at - line 5.
+Use of uninitialized value $m1 in substr at - line 5.
+Use of uninitialized value $m2 in substr at - line 6.
+Use of uninitialized value $g1 in substr at - line 6.
+Use of uninitialized value $m1 in substr at - line 6.
+Use of uninitialized value $g2 in substr at - line 7.
+Use of uninitialized value $m2 in substr at - line 7.
+Use of uninitialized value $g1 in substr at - line 7.
+Use of uninitialized value $m1 in substr at - line 7.
+Use of uninitialized value $m1 in substr at - line 7.
+Use of uninitialized value $g1 in substr at - line 8.
+Use of uninitialized value $m1 in substr at - line 8.
+Use of uninitialized value in scalar assignment at - line 8.
+Use of uninitialized value $m2 in substr at - line 9.
+Use of uninitialized value $g1 in substr at - line 9.
+Use of uninitialized value $m1 in substr at - line 9.
+Use of uninitialized value in scalar assignment at - line 9.
+Use of uninitialized value $m2 in vec at - line 11.
+Use of uninitialized value $g1 in vec at - line 11.
+Use of uninitialized value $m1 in vec at - line 11.
+Use of uninitialized value $m2 in vec at - line 12.
+Use of uninitialized value $g1 in vec at - line 12.
+Use of uninitialized value $m1 in vec at - line 12.
+Use of uninitialized value $m1 in index at - line 14.
+Use of uninitialized value $m2 in index at - line 14.
+Use of uninitialized value $g1 in index at - line 15.
+Use of uninitialized value $m1 in index at - line 15.
+Use of uninitialized value $m2 in index at - line 15.
+Use of uninitialized value $m2 in rindex at - line 16.
+Use of uninitialized value $m1 in rindex at - line 16.
+Use of uninitialized value $g1 in rindex at - line 17.
+Use of uninitialized value $m2 in rindex at - line 17.
+Use of uninitialized value $m1 in rindex at - line 17.
+########
+use warnings 'uninitialized';
+my ($m1, $v);
+our ($g1);
+
+$v = sprintf $m1;
+$v = sprintf '%d%d%d%d', $m1, $m2, $g1, $g2;
+eval {formline $m1 }; undef $m1;
+formline '@<<@<<@<<@<<', $m1, $m2, $g1, $g2;
+EXPECT
+Use of uninitialized value $m1 in sprintf at - line 5.
+Use of uninitialized value $m1 in sprintf at - line 6.
+Use of uninitialized value $m2 in sprintf at - line 6.
+Use of uninitialized value $g1 in sprintf at - line 6.
+Use of uninitialized value $g2 in sprintf at - line 6.
+Use of uninitialized value $m1 in formline at - line 7.
+Use of uninitialized value $m1 in formline at - line 8.
+Use of uninitialized value $m2 in formline at - line 8.
+Use of uninitialized value $g1 in formline at - line 8.
+Use of uninitialized value $g2 in formline at - line 8.
+########
+use warnings 'uninitialized';
+my ($m1, $v);
+our ($g1);
+
+$v = crypt $m1, $g1;
+
+$v = ord;
+$v = ord $m1;
+$v = chr;
+$v = chr $m1;
+
+# XXX these functions don't warn!
+$v = ucfirst;
+$v = ucfirst $m1;
+$v = lcfirst;
+$v = lcfirst $m1;
+$v = uc;
+$v = uc $m1;
+$v = lc;
+$v = lc $m1;
+
+$v = quotemeta;
+$v = quotemeta $m1;
+EXPECT
+Use of uninitialized value $m1 in crypt at - line 5.
+Use of uninitialized value $g1 in crypt at - line 5.
+Use of uninitialized value $_ in ord at - line 7.
+Use of uninitialized value $m1 in ord at - line 8.
+Use of uninitialized value $_ in chr at - line 9.
+Use of uninitialized value $m1 in chr at - line 10.
+Use of uninitialized value $_ in quotemeta at - line 22.
+Use of uninitialized value $m1 in quotemeta at - line 23.
+########
+use warnings 'uninitialized';
+my ($m1, $v1, $v2, $v3, $v4);
+our ($g1);
+
+($v1,$v2,$v3,$v4) = split;
+($v1,$v2,$v3,$v4) = split $m1;
+($v1,$v2,$v3,$v4) = split $m1, $m2;
+($v1,$v2,$v3,$v4) = split $m1, $m2, $g1;
+
+$v1 = join $m1;
+$v2 = join $m1, $m2;
+$v3 = join $m1, $m2, $m3;
+EXPECT
+Use of uninitialized value $_ in split at - line 5.
+Use of uninitialized value $m1 in regexp compilation at - line 6.
+Use of uninitialized value $_ in split at - line 6.
+Use of uninitialized value $m1 in regexp compilation at - line 7.
+Use of uninitialized value $m2 in split at - line 7.
+Use of uninitialized value $m1 in regexp compilation at - line 8.
+Use of uninitialized value $g1 in split at - line 8.
+Use of uninitialized value $m2 in split at - line 8.
+Use of uninitialized value $m1 in join or string at - line 10.
+Use of uninitialized value $m1 in join or string at - line 11.
+Use of uninitialized value $m2 in join or string at - line 11.
+Use of uninitialized value $m1 in join or string at - line 12.
+Use of uninitialized value $m2 in join or string at - line 12.
+Use of uninitialized value $m3 in join or string at - line 12.
+########
+use warnings 'uninitialized';
+my ($m1, $m2, @ma, $v);
+
+our @foo1=(1,undef); chomp @foo1;
+my @foo2=(1,undef); chomp @foo2;
+our @foo3=(1,undef); chop @foo3;
+my @foo4=(1,undef); chop @foo4;
+our @foo5=(1,undef); $v = sprintf "%s%s",@foo5;
+my @foo6=(1,undef); $v = sprintf "%s%s",@foo6;
+our %foo7=('foo'=>'bar','baz'=>undef); $v = sprintf "%s%s",%foo7;
+my %foo8=('foo'=>'bar','baz'=>undef); $v = sprintf "%s%s",%foo8;
+our @foo9 =(1,undef); $v = sprintf "%s%s%s%s",$m1,@foo9, $ma[2];
+my @foo10=(1,undef); $v = sprintf "%s%s%s%s",$m2,@foo10,$ma[2];
+our %foo11=('foo'=>'bar','baz'=>undef); $v = join '', %foo11;
+my %foo12=('foo'=>'bar','baz'=>undef); $v = join '', %foo12;
+our %foo13=(1..2000,'foo'=>'bar','baz'=>undef); $v = join '', %foo13;
+my %foo14=(1..2000,'foo'=>'bar','baz'=>undef); $v = join '', %foo14;
+EXPECT
+Use of uninitialized value $foo1[1] in chomp at - line 4.
+Use of uninitialized value $foo2[1] in chomp at - line 5.
+Use of uninitialized value $foo3[1] in chop at - line 6.
+Use of uninitialized value $foo4[1] in chop at - line 7.
+Use of uninitialized value $foo5[1] in sprintf at - line 8.
+Use of uninitialized value $foo6[1] in sprintf at - line 9.
+Use of uninitialized value $foo7{"baz"} in sprintf at - line 10.
+Use of uninitialized value $foo8{"baz"} in sprintf at - line 11.
+Use of uninitialized value $m1 in sprintf at - line 12.
+Use of uninitialized value $foo9[1] in sprintf at - line 12.
+Use of uninitialized value in sprintf at - line 12.
+Use of uninitialized value $m2 in sprintf at - line 13.
+Use of uninitialized value $foo10[1] in sprintf at - line 13.
+Use of uninitialized value in sprintf at - line 13.
+Use of uninitialized value $foo11{"baz"} in join or string at - line 14.
+Use of uninitialized value $foo12{"baz"} in join or string at - line 15.
+Use of uninitialized value within %foo13 in join or string at - line 16.
+Use of uninitialized value within %foo14 in join or string at - line 17.
+########
+use warnings 'uninitialized';
+my ($v);
+
+undef $^A; $v = $^A + ${^FOO}; # should output '^A' not chr(1)
+*GLOB1 = *GLOB2;
+$v = $GLOB1 + 1;
+$v = $GLOB2 + 1;
+EXPECT
+Use of uninitialized value $^FOO in addition (+) at - line 4.
+Use of uninitialized value $^A in addition (+) at - line 4.
+Use of uninitialized value $GLOB1 in addition (+) at - line 6.
+Use of uninitialized value $GLOB2 in addition (+) at - line 7.
+########
+use warnings 'uninitialized';
+my ($v);
+
+# check hash key is sanitised
+my %h = ("\0011\002\r\n\t\f\"\\abcdefghijklmnopqrstuvwxyz", undef);
+$v = join '', %h;
+EXPECT
+Use of uninitialized value $h{"\0011\2\r\n\t\f\"\\abcdefghijkl"...} in join or string at - line 6.
+########
+use warnings 'uninitialized';
+my ($m1, $v);
+our ($g1);
+
+$v = eval { \&$m1 };
+$v = eval { \&$g1 };
+
+my @a;
+@a = splice @a, $m1, $g1;
+$v = 1 + splice @a, $m1, $g1;
+
+my $x = bless [], 'Z';
+eval { $x->$m1() };
+
+eval { &$m1() };
+eval { &$g1() };
+
+warn $m1,$g1,"foo";
+
+eval { die $m1, $g1 };
+
+reset $m1;
+reset $g1;
+EXPECT
+Use of uninitialized value $m1 in subroutine dereference at - line 5.
+Use of uninitialized value $m1 in subroutine dereference at - line 5.
+Use of uninitialized value $g1 in subroutine dereference at - line 6.
+Use of uninitialized value $g1 in subroutine dereference at - line 6.
+Use of uninitialized value $m1 in splice at - line 9.
+Use of uninitialized value $g1 in splice at - line 9.
+Use of uninitialized value $m1 in splice at - line 10.
+Use of uninitialized value $g1 in splice at - line 10.
+Use of uninitialized value in addition (+) at - line 10.
+Use of uninitialized value $m1 in method lookup at - line 13.
+Use of uninitialized value $m1 in subroutine entry at - line 15.
+Use of uninitialized value $g1 in subroutine entry at - line 16.
+Use of uninitialized value $m1 in warn at - line 18.
+Use of uninitialized value $g1 in warn at - line 18.
+foo at - line 18.
+Use of uninitialized value $m1 in die at - line 20.
+Use of uninitialized value $g1 in die at - line 20.
+Use of uninitialized value $m1 in symbol reset at - line 22.
+Use of uninitialized value $g1 in symbol reset at - line 23.
+########
+use warnings 'uninitialized';
+my ($m1);
+our ($g1);
+
+open FOO; # accesses $FOO
+my $foo = 'FO';
+open($foo."O"); # accesses $FOO
+open my $x; # accesses ${*$x}
+open $foobar; # accesses ${*$foobar}
+my $y;
+open $y, $m1;
+eval { open $y, $m1, $g1 };
+open $y, '<', $g1;
+
+sysopen $y, $m1, $m2;
+sysopen $y, $m1, $g1, $m2;
+
+my $old = umask;
+umask $m1;
+umask $g1;
+umask $old;
+
+binmode STDIN, $m1;
+EXPECT
+Use of uninitialized value $FOO in open at - line 5.
+Use of uninitialized value in open at - line 7.
+Use of uninitialized value in open at - line 8.
+Use of uninitialized value in open at - line 9.
+Use of uninitialized value $m1 in open at - line 11.
+Use of uninitialized value $m1 in open at - line 12.
+Use of uninitialized value $g1 in open at - line 13.
+Use of uninitialized value $m2 in sysopen at - line 15.
+Use of uninitialized value $m1 in sysopen at - line 15.
+Use of uninitialized value $m2 in sysopen at - line 16.
+Use of uninitialized value $g1 in sysopen at - line 16.
+Use of uninitialized value $m1 in sysopen at - line 16.
+Use of uninitialized value $m1 in umask at - line 19.
+Use of uninitialized value $g1 in umask at - line 20.
+Use of uninitialized value $m1 in binmode at - line 23.
+Use of uninitialized value $m1 in binmode at - line 23.
+########
+use warnings 'uninitialized';
+my ($m1);
+our ($g1);
+
+eval { my $x; tie $x, $m1 };
+
+eval { my $x; read $m1, $x, $g1 };
+eval { my $x; read $m1, $x, $g1, $g2 };
+eval { my $x; sysread $m1, $x, $g1 };
+eval { my $x; sysread $m1, $x, $g1, $g2 };
+EXPECT
+Use of uninitialized value $m1 in tie at - line 5.
+Use of uninitialized value $m1 in tie at - line 5.
+Use of uninitialized value $m1 in ref-to-glob cast at - line 7.
+Use of uninitialized value $g1 in read at - line 7.
+Use of uninitialized value $m1 in ref-to-glob cast at - line 8.
+Use of uninitialized value $g1 in read at - line 8.
+Use of uninitialized value $g2 in read at - line 8.
+Use of uninitialized value $m1 in ref-to-glob cast at - line 9.
+Use of uninitialized value $g1 in sysread at - line 9.
+Use of uninitialized value $m1 in ref-to-glob cast at - line 10.
+Use of uninitialized value $g1 in sysread at - line 10.
+Use of uninitialized value $g2 in sysread at - line 10.
+########
+use warnings 'uninitialized';
+my ($m1);
+our ($g1, @ga);
+
+printf $m1;
+printf STDERR "%d%d%d%d\n", $m1, $m2, $g1, $g2;
+printf $ga[1000];
+printf STDERR "FOO1:%s\n", $ga[1000];
+printf STDERR "FOO2:%s%s%s%s\n", $m1, $g1, $ga[1],$m2;
+printf STDERR "FOO3:%s%s%s\n", "X", $ga[1],"Y";
+EXPECT
+Use of uninitialized value $m1 in printf at - line 5.
+Use of uninitialized value $m1 in printf at - line 6.
+Use of uninitialized value $m2 in printf at - line 6.
+Use of uninitialized value $g1 in printf at - line 6.
+Use of uninitialized value $g2 in printf at - line 6.
+0000
+Use of uninitialized value $ga[1000] in printf at - line 7.
+Use of uninitialized value $ga[1000] in printf at - line 8.
+FOO1:
+Use of uninitialized value $m1 in printf at - line 9.
+Use of uninitialized value $g1 in printf at - line 9.
+Use of uninitialized value in printf at - line 9.
+Use of uninitialized value $m2 in printf at - line 9.
+FOO2:
+Use of uninitialized value $ga[1] in printf at - line 10.
+FOO3:XY
+########
+use warnings 'uninitialized';
+my ($m1);
+our ($g1);
+
+eval { my $x; seek $x,$m1, $g1 };
+eval { my $x; sysseek $x,$m1, $g1 };
+eval { syswrite $m1, $g1 };
+eval { syswrite STDERR, $m1 };
+eval { syswrite STDERR, $m1, $g1 };
+eval { syswrite STDERR, $m1, $g1, $m2 };
+eval { my $x; flock $x, $g1 };
+eval { my $x; socket $x, $m1, $g1, $m2 };
+eval { my ($x,$y); socketpair $x, $y, $m1, $g1, $m2 };
+EXPECT
+Use of uninitialized value $x in ref-to-glob cast at - line 5.
+Use of uninitialized value $g1 in seek at - line 5.
+Use of uninitialized value $m1 in seek at - line 5.
+Use of uninitialized value $x in ref-to-glob cast at - line 6.
+Use of uninitialized value $g1 in sysseek at - line 6.
+Use of uninitialized value $m1 in sysseek at - line 6.
+Use of uninitialized value $m1 in ref-to-glob cast at - line 7.
+Use of uninitialized value $g1 in syswrite at - line 7.
+Use of uninitialized value $m1 in syswrite at - line 8.
+Use of uninitialized value $m1 in syswrite at - line 8.
+Use of uninitialized value $g1 in syswrite at - line 9.
+Use of uninitialized value $m1 in syswrite at - line 9.
+Use of uninitialized value $g1 in syswrite at - line 10.
+Use of uninitialized value $m1 in syswrite at - line 10.
+Use of uninitialized value $m2 in syswrite at - line 10.
+Use of uninitialized value $x in ref-to-glob cast at - line 11.
+Use of uninitialized value $g1 in flock at - line 11.
+Use of uninitialized value $m2 in socket at - line 12.
+Use of uninitialized value $g1 in socket at - line 12.
+Use of uninitialized value $m1 in socket at - line 12.
+Use of uninitialized value $m2 in socketpair at - line 13.
+Use of uninitialized value $g1 in socketpair at - line 13.
+Use of uninitialized value $m1 in socketpair at - line 13.
+########
+use warnings 'uninitialized';
+my ($m1, $v);
+our ($g1);
+
+stat;
+lstat;
+stat $m1;
+lstat $g1;
+
+$v = -R $m1;
+$v = -W $m1;
+$v = -X $m1;
+$v = -r $m1;
+$v = -w $m1;
+$v = -x $m1;
+$v = -e $m1;
+$v = -O $m1;
+$v = -o $m1;
+$v = -z $m1;
+$v = -s $m1;
+$v = -M $m1;
+$v = -A $m1;
+$v = -C $m1;
+$v = -S $m1;
+$v = -c $m1;
+$v = -b $m1;
+$v = -f $m1;
+$v = -d $m1;
+$v = -p $m1;
+$v = -l $m1;
+$v = -u $m1;
+$v = -g $m1;
+$v = -k $m1;
+$v = -t $m1;
+$v = -T $m1;
+$v = -B $m1;
+EXPECT
+Use of uninitialized value $_ in stat at - line 5.
+Use of uninitialized value $_ in lstat at - line 6.
+Use of uninitialized value $m1 in stat at - line 7.
+Use of uninitialized value $g1 in lstat at - line 8.
+Use of uninitialized value $m1 in -R at - line 10.
+Use of uninitialized value $m1 in -W at - line 11.
+Use of uninitialized value $m1 in -X at - line 12.
+Use of uninitialized value $m1 in -r at - line 13.
+Use of uninitialized value $m1 in -w at - line 14.
+Use of uninitialized value $m1 in -x at - line 15.
+Use of uninitialized value $m1 in -e at - line 16.
+Use of uninitialized value $m1 in -o at - line 17.
+Use of uninitialized value $m1 in -O at - line 18.
+Use of uninitialized value $m1 in -z at - line 19.
+Use of uninitialized value $m1 in -s at - line 20.
+Use of uninitialized value $m1 in -M at - line 21.
+Use of uninitialized value $m1 in -A at - line 22.
+Use of uninitialized value $m1 in -C at - line 23.
+Use of uninitialized value $m1 in -S at - line 24.
+Use of uninitialized value $m1 in -c at - line 25.
+Use of uninitialized value $m1 in -b at - line 26.
+Use of uninitialized value $m1 in -f at - line 27.
+Use of uninitialized value $m1 in -d at - line 28.
+Use of uninitialized value $m1 in -p at - line 29.
+Use of uninitialized value $m1 in -l at - line 30.
+Use of uninitialized value $m1 in -l at - line 30.
+Use of uninitialized value $m1 in -u at - line 31.
+Use of uninitialized value $m1 in -g at - line 32.
+Use of uninitialized value $m1 in -k at - line 33.
+Use of uninitialized value $m1 in -t at - line 34.
+Use of uninitialized value $m1 in -T at - line 35.
+Use of uninitialized value $m1 in -B at - line 36.
+########
+use warnings 'uninitialized';
+my ($m1, $v);
+our ($g1);
+
+$v = localtime $m1;
+$v = gmtime $g1;
+EXPECT
+Use of uninitialized value $m1 in localtime at - line 5.
+Use of uninitialized value $g1 in gmtime at - line 6.
+########
+use warnings 'uninitialized';
+my ($m1, $v);
+
+$v = eval;
+$v = eval $m1;
+EXPECT
+Use of uninitialized value $_ in eval "string" at - line 4.
+Use of uninitialized value $_ in eval "string" at - line 4.
+Use of uninitialized value $_ in eval "string" at - line 4.
+Use of uninitialized value $m1 in eval "string" at - line 5.
+Use of uninitialized value $m1 in eval "string" at - line 5.
+Use of uninitialized value $m1 in eval "string" at - line 5.
+########
+use warnings 'uninitialized';
+my ($m1);
+
+exit $m1;
+EXPECT
+Use of uninitialized value $m1 in exit at - line 4.