The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Script::isAperlScript - This does a basic check if something is a perl script or not.

VERSION

Version 1.0.0

SYNOPSIS

This module does a basic check to see if something is a perl script.

By default it checks for the paths below.

    /^\#\!\/usr\/bin\/perl/
    /^\#\!\/usr\/bin\/suidperl/
    /^\#\!\/usr\/local\/bin\/perl/
    /^\#\!\/usr\/local\/bin\/suidperl/

This will also match stuff like "#!/usr/local/bin/perl5.8.9".

If {env=>1} is given to the new method, the checks below are done.

    /^\#!\/usr\/bin\/env.*perl/

If {any=>1} is given to the new method, the checks below are done.

    /^\#!\/.*perl/

METHODS

new

This initiates the object.

args hash

env

Allow env based scripts.

By default this is false as it can't be trusted.

any

This does very loose matching.

By default this is false as it can't be trusted.

    my $checker=Script::isAperlScript->new( \%args );

isAperlScript

This checks if a file is a Perl script.

Only one arguement is taken and it is the string in question.

In regards to the returned value, see the section "RETURN" for more information.

    my $returned=isAperlScript($file);
    if(!$returned){
        print "It returned false so there for it is a perl script.\n";
    }

stringIsAperlScript

This checks if a string is a Perl script.

Only one arguement is taken and it is the string in question.

In regards to the returned value, see the section "RETURN" for more information.

    my $returned=stringIsAperlScript($string);
    if(!$returned){
        print "It returned false so there for it is a perl script.\n";
    }

ERROR CODES/FLAGS/HANDLING

The easiest way to check is to verify the returned value is false.

Error handling is provided by Error::Helper.

2, noString

The string is not defined.

3, doesNotExist

The file does not exist.

4, notReadable

The file is not readable.

5, fileNotSpecified

No file specified.

6, noFile

The file could not be opened.

7, notAfile

The specified file is not a file.

AUTHOR

Zane C. Bowers-Hadley, <vvelox at vvelox.net>

BUGS

Please report any bugs or feature requests to bug-script-isaperlscript at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Script-isAperlScript. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc Script::isAperlScript

You can also look for information at:

ACKNOWLEDGEMENTS

COPYRIGHT & LICENSE

Copyright 2012 Zane C. Bowers-Hadley, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.