Arun Tv has asked for the wisdom of the Perl Monks concerning the following question:
I am getting errors========================== 1 #!/usr/bin/perl 2 3 $day = "sunday"; # This input is expected from the user while +running. 4 $userId= "mary"; # This input is expected from the user while +running. 5 6 BEGIN { 7 push (@INC, "./dir_$day"); 8 } 9 10 $tmp = "module_".$userId; 11 12 use $tmp qw(%diary); # %diary is a hash in the perl module + ./dir_sunday/module_mary.pm 13 *diary = \ %diary::diary; 14 15 <Program body> ===================================
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to use variables in @INC and "use" commands
by Corion (Patriarch) on Oct 21, 2008 at 14:18 UTC | |
|
Re: How to use variables in @INC and "use" commands
by holli (Abbot) on Oct 21, 2008 at 14:32 UTC | |
|
Re: How to use variables in @INC and "use" commands
by ikegami (Patriarch) on Oct 21, 2008 at 18:04 UTC | |
|
Re: How to use variables in @INC and "use" commands
by pjotrik (Friar) on Oct 21, 2008 at 15:52 UTC | |
|
Re: How to use variables in @INC and "use" commands
by dragonchild (Archbishop) on Oct 21, 2008 at 16:33 UTC | |
by Arun Tv (Initiate) on Oct 21, 2008 at 17:25 UTC | |
|
Re: How to use variables in @INC and "use" commands
by cdarke (Prior) on Oct 21, 2008 at 16:47 UTC |