in reply to Re^2: Using variables, arrays etc from a perl module in main script.
in thread Using variables, arrays etc from a perl module in main script.

Sorry, let me clarify... I say scope operator for "::" because I am used to C++ terminology.

You are correct, I should have stated that when importing variables our allows us to leave out the fully qualified package name and just use the bare $foo. However, if not importing the var we need to use FQPN (e.g., $Package::var).

Correct me if I am wrong, but before Perl 5.6 when we used "use vars", didn't we have to use FQPN even when importing the variable? It's been a long time, but it seems that was the case.
  • Comment on Re^3: Using variables, arrays etc from a perl module in main script.

Replies are listed 'Best First'.
Re^4: Using variables, arrays etc from a perl module in main script.
by kennethk (Abbot) on May 12, 2010 at 19:46 UTC
    vars created true globals that were exported into the default package, and did not require FQPNs. our's mechanism simply makes them visible (public) but does not export them into the default package. Thus, variables declared with our are accessible but won't clobber or be clobbered unless the import mechanism is invoked.
Re^4: Using variables, arrays etc from a perl module in main script.
by Anonymous Monk on Feb 27, 2014 at 05:19 UTC
    hi i have one question in this... is their any way by which we can link/access the varibles value of other modules without defining it as global variables...?? Thanks in advance... :-)