The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 01-02-2009
jim mcnamara jim mcnamara is online now Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,807
If you have the .pm file for mime type checking (for example like Lite.pm for mime::lite)
you do not necessarily have to "install" the module. Just put it in your directory on the machine you are using, say /home/Rhije/Lite.pm

and add this to the shebang in the top of your own perl code

Code:
#!/bin/perl -I/home/Rhije/Lite.pm

This may not always work, but mime content-type checking is reasonably complex, so it is definitely worth a try. Rather than rolling your own. You can pack the two files in a tarball, extract them and run the perl. I know it violates your "one file" request.