Open Ubuntu 22.04 WSL terminal in Windows Console
- Update and upgrade packages:
$ sudo apt-get update
$ sudo apt-get upgrade
- Install build tools
sudo apt-get install make gcc g++ pkg-config libperl-dev
- Install
cpanm
$ sudo apt-get install cpanminus
- Install
Perl::LanguageServer
$ sudo /usr/bin/cpanm Perl::LanguageServer
- Open VSCode from the WSL Ubuntu terminal (Important: do not open it from Powershell or Cmd) by executing
$ code .
- Go to Extensions tab, and search for "perl language", see screenshot:
- Create a test perl script, then click the "Debug" icon in the left panel:
- Set a breakpoint at line 6, and click "Run and Debug":
- You can now step through the program: