Re: trapping errors in "use"

2003-01-20 Thread Jeff 'japhy' Pinyan
On Jan 21, Victor Tsang said: >$mod = "CGI"; >unless (eval "use $mod") > { >warn "unable to install $mod $@\n"; > } > } Change your eval() to eval "use $mod; 1;" which forces a true value to be returned if 'use' runs successfully. -- Jeff "japhy" Pinyan [EMAI

Re: trapping errors in "use"

2003-01-20 Thread simran
from 'perldoc -f use' use Module (); That is exactly equivalent to BEGIN { require Module } me thinks, what you want is > #!/usr/bin/perl > BEG

trapping errors in "use"

2003-01-20 Thread Victor Tsang
I have a piece of code which will be used in two different environment, One of the difference of the 2 system is a special library that is avaiable to only one of them. Going into the cookbook I found example 12.2 very suitable for my need. So I created the following code to test the idea #!/usr