diff options
author | Father Chrysostomos <sprout@cpan.org> | 2014-09-18 20:34:43 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2014-09-18 21:30:48 -0700 |
commit | d8c6310a4f016fa2e6af68b606ee53084fbf4a8a (patch) | |
tree | 87ae75029c6185644f02939acacc1e28f63f3d90 /gv.c | |
parent | 99f74b09f61407826aeb0bf8eabad6e2e628c02b (diff) | |
download | perl-d8c6310a4f016fa2e6af68b606ee53084fbf4a8a.tar.gz |
[perl #121638] Make ‘Global symbol’ message more newbie-friendly
by suggesting the declaration of a lexical variable, but without
removing the ‘Global symbol’ part, since much code no doubt depends
on its presence.
Diffstat (limited to 'gv.c')
-rw-r--r-- | gv.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -1733,7 +1733,12 @@ S_find_default_stash(pTHX_ HV **stash, const char *name, STRLEN len, if (add && !PL_in_clean_all) { SV * const err = Perl_mess(aTHX_ "Global symbol \"%s%"UTF8f - "\" requires explicit package name", + "\" requires explicit package name (did you forget to " + "declare \"my %s%"UTF8f"\"?)", + (sv_type == SVt_PV ? "$" + : sv_type == SVt_PVAV ? "@" + : sv_type == SVt_PVHV ? "%" + : ""), UTF8fARG(is_utf8, len, name), (sv_type == SVt_PV ? "$" : sv_type == SVt_PVAV ? "@" : sv_type == SVt_PVHV ? "%" |