[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl-AnyPerl] Multi Platform Scripts



On Sat, Aug 14, 1999 at 10:03:11AM +0000, Bart Lateur wrote:
> 
>  - why replacing "use" with "require", even when accompanied with
> "import", may not be good enough.
> 
> You usually need the (implied) "BEGIN", like it or not. The test inside
> the BEGIN block looks like the cleanest approach. I think I would opt
> for an external library file, only require()d on MacOS, and which
> contains the "use" line, I guess, and a different library file for Unix.
> 

Replacing "use" with "require" and possibly "import" is _always_ good
enough.  The BEGIN {} is implicit in that.  As I've already said:

  use Module;

is equivalent to:

  BEGIN { require Module; import Module; }


Perhaps I should have been more explicit about BEGIN {} :

There is nothing that can be done with "use", that cannot be done with
"require", "import", and "BEGIN {}".



Ronald

==== Want to unsubscribe from this list?
==== Send mail with body "unsubscribe" to macperl-anyperl-request@macperl.org