From: Mike Small <[email protected]>
   Date: Fri, 16 Jan 2015 14:39:24 -0500

   I have a script where I want to decide at runtime to use one or the
   other of two modules that have similar interfaces. However one of the
   modules defines a constant that the other lacks, a constant I need to
   use in my call to that module's constructor.  Is there a better way to
   handle this than what I've done below? I want to allow the script to run
   even when Net::FTPSSL hasn't been installed if the user doesn't ask for
   tls to be used.

That's pretty much what I would do.  Though I don't understand why you
need the "eval" in:

        eval('&Net::FTPSSL::IMP_CRYPT')

Shouldn't Net::FTPSSL::IMP_CRYPT always be defined when you need it, and
never referenced when you don't?

                                        -- Bob Rogers
                                           http://www.rgrjr.com/

_______________________________________________
Boston-pm mailing list
[email protected]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to