in reply to Re: How do I import a global variable form a package with require?
in thread How do I import a global variable form a package with require?

Alternatively, declare the variable for the compiler. The call to import then assigns the value. This prints 7 (with your A.pm):
#! /usr/bin/env perl use strict; use warnings; our $var; use lib '.'; require A; A->import (':all'); print $var . "\n";