- Visual C++源码
- Visual Basic源码
- C++ Builder源码
- Java源码
- Delphi源码
- C/C++源码
- PHP源码
- Perl源码
- Python源码
- Asm源码
- Pascal源码
- Borland C++源码
- Others源码
- SQL源码
- VBScript源码
- JavaScript源码
- ASP/ASPX源码
- C#源码
- Flash/ActionScript源码
- matlab源码
- PowerBuilder源码
- LabView源码
- Flex源码
- MathCAD源码
- VBA源码
- IDL源码
- Lisp/Scheme源码
- VHDL源码
- Objective-C源码
- Fortran源码
- tcl/tk源码
- QT源码
PerlLauncher.pm.svn-base
上传用户:market2
上传日期:2018-11-18
资源大小:18786k
文件大小:2k
源码类别:
外挂编程
开发平台:
Windows_Unix
- #########################################################################
- # OpenKore - Generic utility functions
- #
- # Copyright (c) 2006 OpenKore Development Team
- #
- # This software is open source, licensed under the GNU General Public
- # License, version 2.
- # Basically, this means that you're allowed to modify and distribute
- # this software. However, if you distribute modified versions, you MUST
- # also distribute the source code.
- # See http://www.gnu.org/licenses/gpl.html for the full license.
- #########################################################################
- ##
- # MODULE DESCRIPTION: Abstraction layer for launching Perl scripts
- #
- # <div class="derived">This class is derived from: @CLASS(AppLauncher)</div>
- #
- # This class provides a cross-platform way to launch other Perl
- # scripts. It automatically uses the system's Perl interpreter,
- # or uses (wx)start.exe if that's not available.
- package PerlLauncher;
- use strict;
- use Config;
- use Utils::AppLauncher;
- use base qw(AppLauncher);
- ### CATEGORY: Class PerlLauncher
- ##
- # PerlLauncher PerlLauncher->new(Array<String>* modulePaths, String script, [String arg...])
- # modulePaths: Additional Perl module paths. This may be undef.
- # script: The script you want to run.
- # arg: The arguments to pass to the script.
- # Requires: defined($script)
- # Ensures: !$self->isLaunched()
- #
- # Create a PerlLauncher object. The specified script isn't
- # run until you call $AppLauncher->launch()
- sub new {
- my $class = shift;
- my $modulePaths = shift;
- my ($self, @interp);
- # Find a Perl interpreter
- if ($ENV{INTERPRETER}) {
- # Prefer (wx)start.exe. Because if a user uses wxstart.exe *and*
- # has ActivePerl installed, but not WxPerl, then things will go wrong.
- @interp = ($ENV{INTERPRETER}, '!');
- } else {
- @interp = ($Config{perlpath});
- }
- # Append Perl module search paths
- if ($modulePaths) {
- foreach my $path (@{$modulePaths}) {
- push @interp, "-I$path";
- }
- }
- $self = $class->SUPER::new(@interp, @_);
- return $self;
- }
- 1;