It appears that the concept is to call export in the general case, and do an inline symbol assignment if all special conditions are met.if ($Verbose or $Debug or grep {/\W/ or $args and not exists $exports{$_} or @fail and $_ eq $fail[0] or (@{"$pkg\::EXPORT_OK"} and $_ eq ${"$pkg\::EXPORT_OK"}[0])} @_) { return export $pkg, $callpkg, ($args ? @_ : ()); } #local $SIG{__WARN__} = sub {require Carp; goto &Carp::carp}; local $SIG{__WARN__} = sub {require Carp; local $Carp::CarpLevel = 1; &Carp::carp}; foreach $sym (@_) { # shortcut for the common case of no type character *{"$callpkg\::$sym"} = \&{"$pkg\::$sym"}; }
But just what does that condition say? I understand setting $Verbose or $Debug, and see that the rest is inside a grep to test each argument against some conditions.
But, what is the significance of the first element of @EXPORT_OK or the first element of @fail? Basically, if one of the arguments is the first entry in @EXPORT_OK, then the general case is performed.
So what's special about the first OK item?
—John
In reply to What does this code do? by John M. Dlugosz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |