Setting up sublime text 2 with activeperl?
-
06-07-2021 - |
Question
New to using sublime text 2 and I'm wondering how to get it to point to the activeperl.exe (on win7).
I'm testing out the compiler to make sure it works with something simple like:
$x = 1;
$print "$x";
But it gives me guff about how $x isn't a recognized syntax. I did point ST2 to my python executable, but I forgot which file in the labyrinth I was supposed to edit the path to.
Solution
This worked for me, taken from: http://www.perlmonks.org/?node_id=935014
- Click "Preferences -> Browse Packages"
- Navigate to the "Perl" subfolder
- Create a file called "Perl.sublime-build" with the following content:
{
"cmd": ["perl", "-w", "$file"],
"file_regex": ".* at (.*) line ([0-9]*)",
"selector": "source.perl"
}
- Manually set the build system by clicking "Tools -> Build System -> Perl"
- You can now run your Perl script by mashing Ctrl+B
I am running this version of ActiveState Perl:
C:\>perl --version
Binary build 1402 [295342] provided by ActiveState http://www.ActiveState.com
Built Oct 7 2011 15:49:44
OTHER TIPS
I use the version 3 of Sublime Text and to run perl programs in this editor, you should:
- Click "Preferences -> Browse Packages"
- Navigate to the "Sublime Text" subfolder library "Lib"
- Create a file called
Perl.sublime-build
with the following content:
{
"cmd": ["perl", "-w", "$file"],
"file_regex": ".* at (.) line ([0-9])",
"selector": "source.perl"
}
- Manually set the build system by clicking "Tools -> Build System -> Perl"
- You can now run your Perl script by pressing
Ctrl+B
.
Attention: the file Perl.sublime-build
should be created in this root diretory: \Sublime Text 3\Lib
.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow