Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Calling a class constructor as a function on input arguments

by tye (Cardinal)
on Jul 21, 2000 at 18:41 UTC ( #23586=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
        my %constructor= {
            MSWin32 => sub { FTP::Session::Win32->new( @_ ) },
    ...
        die "No constructor for $^O"   if  ! $ctor;
        my $session= $ctor->( ... );
        # Old Perl requires:  $session= &$ctor( ... );
    
  2. or download this
        my %class= {
            MSWin32 => "FTP::Session::Win32",
    ...
        die "No constructor for $^O"   if  ! $ctor;
        my $session= $ctor->( $class{$^O}, ... );
        # Old Perl requires:  $session= &$ctor( $class{$^O}, ... );
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://23586]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (8)
As of 2014-12-20 04:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (95 votes), past polls