in reply to Calling a class constructor as a function on input arguments

I need more info about the context of the code you're going to write.

However, here's a possible solution:

my $os = eval "\\&FTP::Session::${^O}->new"; my %constor = ( $^O => $os );
I'm pretty sure that's what you're looking for.

Yes, the first argument is the package name, that's why constructors could look like this:

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';
Enjoy!
--
Casey