On 11/08/2014 11:38 AM, Shawn H Corey wrote:
On Sat, 8 Nov 2014 17:48:31 +0200
Shlomi Fish wrote:
The correct syntax is simply (untested):
my $foo = "MyFoo::${pgm}Bar"->new;
FYI: That is called a symbolic reference. For more information, see
`perldoc perlref` and search for /Symbolic
On Sat, 8 Nov 2014 17:48:31 +0200
Shlomi Fish wrote:
> The correct syntax is simply (untested):
>
> my $foo = "MyFoo::${pgm}Bar"->new;
FYI: That is called a symbolic reference. For more information, see
`perldoc perlref` and search for /Symbolic references/
BTW, symbolic references are n
On 9 November 2014 05:27, Ron Bergin wrote:
> In fact, I
> almost never use or suggest using eval.
>
eval itself is not evil. Its just *string* eval becuase that involves
arbitrary code interpolation.
Non-string eval is of course potentially written as "try" in other
languages ( not exactly,
Uri Guttman wrote:
> On 11/08/2014 10:40 AM, Ron Bergin wrote:
>> you could accomplish it with the use of eval.
>>
>> my $foo = eval "MyFoo::${pgm}Bar->new";
>
> ewww. never use string eval for something as simple as that.
>
> my $foo = "MyFoo::${pgm}Bar"->new() ;
>
> that is just fine there. the c
On 11/08/2014 10:40 AM, Ron Bergin wrote:
Patton, Billy N wrote:
I currently have something like this
use MyFoo::ABCBar;
use MyFoo::DEFBar;
use MyFoo::HIJBar;
my $fooABC = MyFoo::ABCBar->new();
…
What I would like to do is
foreach $pgm ( ‘ABC’ , ‘DEF’ , ‘HIJ’) {
my $foo = MyFo
Hi Billy,
please reply to all recipients.
On Fri, 7 Nov 2014 13:17:19 +
"Patton, Billy N" wrote:
> I currently have something like this
> use MyFoo::ABCBar;
> use MyFoo::DEFBar;
> use MyFoo::HIJBar;
> my $fooABC = MyFoo::ABCBar->new();
> …
>
> What I would like to do is
>
> foreach $pgm
Patton, Billy N wrote:
> I currently have something like this
> use MyFoo::ABCBar;
> use MyFoo::DEFBar;
> use MyFoo::HIJBar;
> my $fooABC = MyFoo::ABCBar->new();
> â¦
>
> What I would like to do is
>
> foreach $pgm ( âABCâ , âDEFâ , âHIJâ) {
> my $foo = MyFoo::{$pgm}Bar->new;
> â¦