(Tips & Tricks) PerlVaria

January 30, 2014

Perl Varia

server / client

OO

object = complex datatype (with methods etc...) which knows to which class it belong bless is used to create the object and return the reference to this object class = package, containing methods, etc.., provide a separate namespace method = subroutine, 1st argument is object reference or a package name
Perl does not have private variables
@ISA governs (method) inheritance.
If you define a function called AUTOLOAD() then any calls to undefined subroutines will call the AUTOLOAD() function.

Module stuff:

perl -e '{use List::Util; print "Version: " . $List::Util::VERSION . "\n"}'
alias lookmeth='perl -MModPerl::MethodLookup -e print_method' alias lookmod='perl -MModPerl::MethodLookup -e print_module' alias lookobj='perl -MModPerl::MethodLookup -e print_object'
$ lookmeth remote_ip; To use method 'remote_ip' add: use Apache2::Connection ();
$ lookmod Apache2::Connection; Module 'Apache2::Connection' contains the following XS methods: Method Invoked on object type ----------------------------------------------------------- aborted Apache2::Connection base_server Apache2::Connection bucket_alloc Apache2::Connection client_socket Apache2::Connection conn_config Apache2::Connection get_remote_host Apache2::Connection id Apache2::Connection input_filters Apache2::Connection keepalive Apache2::Connection keepalives Apache2::Connection local_addr Apache2::Connection local_host Apache2::Connection local_ip Apache2::Connection notes Apache2::Connection output_filters Apache2::Connection pool Apache2::Connection remote_addr Apache2::Connection remote_host Apache2::Connection remote_ip Apache2::Connection sbh Apache2::Connection -----------------------------------------------------------
$ lookobj Apache2::Connection Objects of type 'Apache2::Connection' can invoke the following XS methods: Method Module --------------------------------------------- aborted Apache2::Connection add_input_filter Apache2::Filter add_output_filter Apache2::Filter base_server Apache2::Connection bucket_alloc Apache2::Connection client_socket Apache2::Connection conn_config Apache2::Connection get_remote_host Apache2::Connection id Apache2::Connection input_filters Apache2::Connection keepalive Apache2::Connection keepalives Apache2::Connection local_addr Apache2::Connection local_host Apache2::Connection local_ip Apache2::Connection notes Apache2::Connection output_filters Apache2::Connection pnotes Apache2::ConnectionUtil pool Apache2::Connection remote_addr Apache2::Connection remote_host Apache2::Connection remote_ip Apache2::Connection sbh Apache2::Connection ---------------------------------------------

tags: ,

 
"It's hard to make a comeback when you haven't been anywhere."

Powered by Wordpress. Theme by Shlomi Noach, openark.org
© 2017 KwaLinux Trainingen | Algemene voorwaarden | KvK: 10147727 | Disclaimer