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