About Microsoft Visualstudio Code Editor¶
How to run perl files¶
Code have task.json, where we can configure how you would like to execute a code.
By default most of the new language are supported, but I found perl is not there and was trying to execute the perl code using this editor.
Note
Make sure you have your perl directory as a top workspace.
- Create a top level directory where all your perl scripts are there. # This is must. (AFAIK for now :) )
- Select
Terminalthen clickRun Build Task...And you will seeNo build task to run found. Configure Build Task... - Select this
No build task to run found. Configure Build Task... - Then it will give you,
Create tasks.json file from template, select the same. - You will get multiple options, Select
Others Example to run an arbitrary external command - It will open
tasks.json, and over there you have to update the details.
For running the perl code, following details I have added in my tasks.json. More details you can check at: https://code.visualstudio.com/docs/editor/tasks https://code.visualstudio.com/docs/editor/variables-reference
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Run with Perl",
"type": "shell",
"command": "perl ${file}",
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
You can also define more then one command. Example:
But I have not tested anything on the same much yet.
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Run bash script",
"type": "shell",
"command": "bash ${file}",
"group": {
"kind": "build",
"isDefault": true
}
}
{
"label": "Run perl script",
"type": "shell",
"command": "perl ${file}",
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
# New line => Space
CRTL + J
192.168.98.20 192.168.98.34 192.168.98.39 192.168.98.45 192.168.98.52 192.168.98.55 192.168.98.61
CRTL + J