Thread @INC Problem (17 answers)
Opened by Gast at 2024-04-28 17:00

GwenDragon
 2024-04-28 17:48
#196049 #196049
User since
2005-01-17
14783 Artikel
Admin1
[Homepage]
user image
Klapp bei mir.

a.pl
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/perl

use strict;
use warnings;
use 5.024;
use utf8;

BEGIN {
    $0 =~ m~(.*)/[^/]+~ || $0 =~ m~(.*)\\[^\\]+~;
    $1 ? (unshift @INC, $1) : (@INC = reverse @INC);
}
say "Programm: $0";

say '@INC: ';
say for @INC;


Auf Debian 12:
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
test@debora:~$ perl /media/sf_SHARED/a/a.pl 
Programm: /media/sf_SHARED/a/a.pl
@INC:
/media/sf_SHARED/a
/etc/perl
/usr/local/lib/x86_64-linux-gnu/perl/5.36.0
/usr/local/share/perl/5.36.0
/usr/lib/x86_64-linux-gnu/perl5/5.36
/usr/share/perl5
/usr/lib/x86_64-linux-gnu/perl-base
/usr/lib/x86_64-linux-gnu/perl/5.36
/usr/share/perl/5.36
/usr/local/lib/site_perl

Auf Windows 11:
Code: (dl )
1
2
3
4
5
6
7
T:\>perl X:\media\SHARED\a\a.pl
Programm: X:\media\SHARED\a\a.pl
@INC:
X:\media\SHARED\a
C:/strawberry/perl/site/lib
C:/strawberry/perl/vendor/lib
C:/strawberry/perl/lib

Last edited: 2024-04-28 18:20:39 +0200 (CEST)

View full thread @INC Problem