Shop  •   Avatar  •   FAQ  •   Search  •   Memberlist  •   Usergroups  •   Profile  •   Log in to check private messages  •   Log in  •  Register 

Perl 101
Post new topic   Reply to topic     Forum Index -> Customization & Modding
View previous topic :: View next topic  
Author Message
parksbanyon
Gunner
Posts: 564



13127 Gold -

PostPosted: Wed Dec 17, 2014 8:34 am    Post subject: Perl 101 Reply with quote

Decided to consolidate all the info on using perl scripts and linking those scripts from a single point. Mac users have perl preinstalled and configured but us winblows users have to download and configure. Hope this helps!
Back to top
View user's profile Send private message
parksbanyon
Gunner
Posts: 564



13127 Gold -

PostPosted: Fri Dec 19, 2014 5:45 pm    Post subject: addition to perl script default win location Reply with quote

Most of the PERL scripts don't find the default windows location, I finally got this to work by adding the following:

use Win32; (Place near the top just after comment lines #)

ADD (the "my $f_pc = 0;" gets replaced.):

my $OS = Win32::GetOSDisplayName();my $PF = " ";
if ($OS =~ /64/) {$PF = 'Program Files (x86)'; } else {$PF = 'Program Files';}
my $f_pc = "/$PF/Firaxis Games/Sid Meier's Pirates!/Pirates!.exe";

This only works for default path installs and differeniates between x86 x64 proram file naming conventions.
Back to top
View user's profile Send private message
parksbanyon
Gunner
Posts: 564



13127 Gold -

PostPosted: Fri Dec 19, 2014 5:53 pm    Post subject: winodws file associations Reply with quote

Associate *.pl files with perl
Run the following commands at a shell prompt:
assoc .pl=PerlScript
ftype PerlScript=C:\bin\perl.exe "%1" %*
Replace C:\Perl\bin\perl.exe with the path to your Perl installation. This enables you to run myscript.pl instead of perl myscript.pl.
Default install locations are:
•ActivePerl: C:\Perl
•Strawberry Perl: C:\Strawberry

Add .PL to your PATHEXT environment variable.
This makes Windows consider *.pl files to be executable when searching your PATH. It enables you to run myscript instead of myscript.pl.
You can set it for the current cmd session
set PATHEXT=%PATHEXT%;.PL
To set it permanently (under Windows Vista or Windows 7)
setx PATHEXT=%PATHEXT%;.PL

Add a drop handler
Adding a drop handler for Perl allows you to run a Perl script via drag & drop; e.g. dragging a file over the file icon in Windows Explorer and dropping it there. Run the following script to add the necessary entries to the registry:
Code:
use Win32::TieRegistry;
$Registry->Delimiter("/");
$perlKey = $Registry-> {"HKEY_CLASSES_ROOT/Perl/"};
$perlKey-> {"shellex/"} = {
    "DropHandler/" =>  {
        "/" => "{86C86720-42A0-1069-A2E8-08002B30309D}"
}};


Condensed from the following webpage:
http://stackoverflow.com/questions/4727480/how-do-i-make-my-perl-scripts-act-like-normal-programs-on-windows
Back to top
View user's profile Send private message
parksbanyon
Gunner
Posts: 564



13127 Gold -

PostPosted: Fri Dec 19, 2014 5:57 pm    Post subject: perl- East Indies Mod Reply with quote

A mod worthy of being called an extension pack:

http://hookedonpirates.com/forums/viewtopic.php?t=6600&highlight=
Back to top
View user's profile Send private message
Guardacostas
Rigger
Posts: 1221



10938 Gold -

PostPosted: Fri Dec 19, 2014 9:25 pm    Post subject: Reply with quote

I'd have to agree, love the east indies mod too!

Do you think you could make the mod install with just an .exe? Is that possible?
Back to top
View user's profile Send private message
parksbanyon
Gunner
Posts: 564



13127 Gold -

PostPosted: Thu Jan 08, 2015 5:40 pm    Post subject: lost post Reply with quote

I'm sure I replied to this. I switched to python to remake the previous perl based mods. As a program py2exe can make a python program (script) an exe file. However, I got sidetracked trying to master the nifs.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Customization & Modding All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group