Installing perl modules in [Windows Subsystem for Linux]

I would like to use a Perl script in a Linux environment under Windows 10 ( WSL ). I turned on WSL, installed compilers ( gccand make), executed sudo apt-get install build-essential. Perl works, and I can run simple scripts. Problems arise when trying to install the perl module. For example, I tried to add LWPby running perl -MCPAN -e'install "LWP"'. It gives a lot of error / warning messages starting with Warning: the following files are missing in your kit:. The full output is too large to be inserted here, so I have to specify it elsewhere: http://pastebin.com/RRRedwbG . In short, regardless of the package, all .pm and .t files are considered missing.

+4
source share
2 answers

The solution is found at github.com/Microsoft/BashOnWindows/issues/186 :
1. run sudo apt-get install liblocal-lib-perl cpanminus build-essential
2. edit /usr/lib/perl/5.18.2/Config.pm(around line 94) to have dont_use_nlink => 1
3.eval "$(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib)"

+4
source

On unix file systems, a directory .is a hard link to itself, and a directory ..is a hard link to the parent directory. Therefore, when you statcatalog, the reference counter returned statwill be no less 1 (name) + 1 (.) + $num_sub_dirs (..).

$ ls -ld .
drwx------ 5 ikegami ikegami 46 Dec 16 12:03 .    # 5 = Could have up to three subdirs

$ ls -l .
total 0
drwx------ 2 ikegami ikegami 10 Dec 16 12:03 a    # 2 = No subdirs
drwx------ 3 ikegami ikegami 24 Dec 16 12:03 b    # 3 = Could have up to one subdir
drwx------ 2 ikegami ikegami 10 Dec 16 12:03 c    # 2 = No subdirs

File :: Find relies on this information to optimize itself when possible.

Perl File:: Find , FAT NTFS, Windows. VSL Linux , , unix.

- , :

perl -MConfig -e'CORE::say $INC{"Config.pm"}'

dont_use_nlink => undef

dont_use_nlink => 1

,

$ perl -V:dont_use_nlink
dont_use_nlink='1';

.

+5

Source: https://habr.com/ru/post/1663984/


All Articles