bronto has asked for the wisdom of the Perl Monks concerning the following question:
Hello monks and... monksesses? :-)
This snippet loads a module at runtime and works correctly:
unless (exists $INC{'Spreadsheet/WriteExcel.pm'}) { eval "use Spreadsheet::WriteExcel" ; croak $@ if $@ ; }
Anyway, is there anything wrong in what I am doing here?
Ciao!
--bronto
The very nature of Perl to be like natural language--inconsistant and full of dwim and special cases--makes it impossible to know it all without simply memorizing the documentation (which is not complete or totally correct anyway).
--John M. Dlugosz
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: %INC and eval use
by broquaint (Abbot) on Mar 10, 2004 at 16:00 UTC | |
|
Re: %INC and eval use
by Juerd (Abbot) on Mar 10, 2004 at 16:07 UTC | |
by bronto (Priest) on Mar 10, 2004 at 16:30 UTC | |
by Juerd (Abbot) on Mar 10, 2004 at 16:45 UTC | |
|
Re: %INC and eval use
by dragonchild (Archbishop) on Mar 10, 2004 at 18:03 UTC | |
|
Re: %INC and eval use
by fraktalisman (Hermit) on Mar 10, 2004 at 22:50 UTC | |
by ysth (Canon) on Mar 11, 2004 at 01:11 UTC | |
|
Re: %INC and eval use
by simonm (Vicar) on Mar 10, 2004 at 21:01 UTC |