Help for this page

Select Code to Download


  1. or download this
    if ($use_socket) {
      use Socket;         # oops!  Socket will get loaded at compile-time
                          # before $use_socket is even evaluated
    }
    
  2. or download this
    if ($use_socket) {
      eval "use Socket";  # ok: Socket gets loaded at run-time
                          # if $use_socket is true
    }
    
  3. or download this
    if ($use_socket) {
      require Socket;     # ok: Socket gets loaded at run-time
      Socket->import();   # if $use_socket is true
    }
    
  4. or download this
    if ($use_socket) {
      require Socket;
      Socket->export_to_level(1, @_);
    }