Global symbol requires explicit package name

It may also happen when the statement before is not complete.

use strict;

sub test;

test()

# some comment
my $x;

perl now complains with following error message:

my "
Global symbol "$x" requires explicit package name

The error is not in the declaration of “my”, but at the missing semicolon (;) at test().

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)