in reply to Calling a class constructor as a function on input arguments
However, here's a possible solution:
I'm pretty sure that's what you're looking for.my $os = eval "\\&FTP::Session::${^O}->new"; my %constor = ( $^O => $os );
Yes, the first argument is the package name, that's why constructors could look like this:
Enjoy!sub new { bless {}, shift }; # which is equivalent to this sub new { my $class = shift @_; my $self = {}; my $ref = bless $self, $class; return $ref; } # Bless could actually be: bless {}, 'Package::Name';
-- Casey
|
|---|