tags:

views:

830

answers:

2

I have written a library in Perl that has a certain function, that gives back information about a the server as a character string. Can I call this function from a shell directly?

My boss asks "Can you call it from a shell directly for the time being?" Because he said that, I think I should be able to do it, but how do I do it?

+5  A: 

Do you mean something like this?

Create a file called serverinfo which contains:

#!/usr/bin/perl

require 'library.pl';
say library::getServerInformation();

then run:

chmod u+x serverinfo

then run:

./serverinfo
Mark
+2  A: 

  perl -MServerlib=server_information -e 'print server_information()'

Is another.

Axeman
this sounds more like what the OP is being requested to do.
blackkettle