I wrote a library in Perl that contains a specific function that returns server information as a character string. Is it possible to call this function from the shell directly?
My boss asks, "Can you call it from the shell right now?" Because he said it, I think I can do it, but how can I do it?
perl -MServerlib=server_information -e 'print server_information()'
This is another way to do this, but only if Serverlib exports the server_informationsub. If this is not the case, you will need to do the following:
server_information
perl -MServerlib -e 'print MServerlib::server_information()'
perl , perl script, . , script serverinfo, :
serverinfo
#!/usr/bin/perl require 'library.pl'; say library::getServerInformation();
:
chmod u+x serverinfo
, script , . script, , API, .
Source: https://habr.com/ru/post/1709046/More articles:php - change file permissions - phpHow to save controllers from xib - iphoneтег в ServicesReferences.ClientConfig - silverlightMany jQuery UI options - javascriptTips for managing lots of code? - javascriptCoreData equivalent to sum ... group by - iphoneWhy can't I run the Erlang node name on Windows? - windowsявляются ли файлы cookie обязательными для приложения Ruby on Rails? - ruby-on-railsHow can I implement cookieless flash messages in Rails? - ruby-on-railsAuthlogic works through curl but not browser - ruby-on-railsAll Articles