Perl Export Suggestions -


i working new program needs interface perl.

the example code suggests of methods exported global namespace below:

use bgpmon::fetch; $ret = init_bgpdata(); $ret = connect_bgpdata(); $xml_msg = read_xml_message(); ... 

however using of methods causes "undefined subroutine &fetch::init_bgpdata." know module works doesn't seem exporting correctly because can still use long names: bgpmon::fetch::init_bgpdata();.

any reason why module isn't exporting correctly?

note: love share method code know not problem module. part of codeset can't share , know works because tests manage pass.

exporter section

require exporter; our $autoload; our @isa = qw(exporter); our %export_tags = ( 'all' => [ qw(connect_bgpdata read_xml_message   close_connection is_connected messages_read uptime connection_endtime   get_error_code get_error_message get_error_msg) ] ); our @export_ok = ( @{ $export_tags{'all'} } ); 

public source code (mine dev)

in code have given, defining tag :all

so calling code can

use  bgpmon::fetch ':all' ; 

alternatively can import them individually

use bgpmon::fetch qw(init_bgpdata connect_bgpdata); # , on 

it worth having @ exporter - apologies if done so


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -