Nalina has asked for the wisdom of the Perl Monks concerning the following question:

Hi monks
In one of the scripts of my application, I see one statement
$main'ora_errstr = $ora_errstr;
I am confused with the scope of ora_errstr variable here. Does this mean that the value of ora_errstr variable in current package is being assigned to ora_errstr var in main package?
If so which is the main package here?
Generally we declare package var as $main::ora_errstr. Is $main'ora_errstr same as $main::ora_errstr?
Thanks in advance

Replies are listed 'Best First'.
Re: Scope of variables
by wfsp (Abbot) on Apr 21, 2006 at 06:33 UTC
    Is $main'ora_errstr same as $main::ora_errstr?
    Yes. The comma used to be used a loong time ago!
      Ok Thanks. Could you please tell me the scope of ora_errstr variable here.
        Have a look at package for more info.

        main:: is the default. If there are no other packages that's the one your in and there is no need to include the prefix. If there is a package (e.g. a module) that has a variable of the same name then you would need the package prefix to distinguish between the two.