On Thu, Nov 20, 2008 at 07:15, Amit Saxena <[EMAIL PROTECTED]> wrote:
snip
> Before posting this query here, I indeed did a sample search on CPAN.
>
> However I want to have a solution using Perl inbuilt module instead of some
> external module as the system I am working on does not allows perl external
> modules to be installed.
>
> If you have use such modules, please suggest the one which is inbuilt in
> Perl and best for this scenario ?
snip

There is no module that is part of Core Perl that will help you;
however, you can write it yourself (examine the first few bytes of the
file, that is what file does).  There is also the option of saying

my $type = qx(/usr/bin/file);

but the file command is highly implementation specific, so, if you
move to another OS, your code will most likely break.

Another option when one has balky sysadmins is to use PAR to create a
Perl archive that contains all of the modules (and the script itself)
needed to run the program.  You could also use PAR::Packer to make an
self-contained executable bundle that contains the archive, the
script, and a copy of the perl interpreter.

-- 
Chas. Owens
wonkden.net
The most important skill a programmer can have is the ability to read.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to