Is 'require $var' supported? 
Author Message
 Is 'require $var' supported?

Quote:
>  perl5 -e '$a="AutoLoader";require $a;'


Is this a bug, or just not supported?
--

If you only have a hammer, you tend to see every problem as a nail.
                -- Maslow



Fri, 18 Jul 1997 23:54:29 GMT  
 Is 'require $var' supported?

Quote:
>>  perl5 -e '$a="AutoLoader";require $a;'

>Is this a bug, or just not supported?


if you do

  perl5 -e '$a="AutoLoader.pm";require $a;'

Require adds the ".pm" extension only if the argument is a bare word.

--
Hope this helps,

HansM



Mon, 21 Jul 1997 20:23:58 GMT  
 Is 'require $var' supported?
:
: >  perl5 -e '$a="AutoLoader";require $a;'

:
: Is this a bug, or just not supported?

It's a bug in your program.  You meant to say

    perl5 -e '$a="AutoLoader.pm";require $a;'

The defaulting to .pm only happens with the bareword form.

Larry



Tue, 22 Jul 1997 01:20:58 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. 'do'/'require' + parameters

2. '$var =~ ///g' equals '$var =~ m// divided by g'

3. local var 'feature'/bug ?

4. How to set 'env'-var in perl

5. perl BUG: 'die' dumps core in 'require'd files that require other files

6. Protocol scheme 'http' is not supported

7. 'Protocol not supported'-Error on Solaris

8. Newbie: 'require' problem with hash params

9. re-'require'ing a file

10. Overriding a require'd module's subroutine

11. strict, global vars and 'require'

12. Variables from 'require' not initialized

 

 
Powered by phpBB® Forum Software