PERL: Mengetahui isi INC: Difference between revisions

From OnnoCenterWiki
Jump to navigationJump to search
Onnowpurbo (talk | contribs)
New page: The @INC array is a list of directories Perl searches when attempting to load modules. To display the current contents of the @INC array: perl -e "print join(\"\n\", @INC);" The follow...
 
Onnowpurbo (talk | contribs)
No edit summary
Line 1: Line 1:
The @INC array is a list of directories Perl searches when attempting to load modules. To display the current contents of the @INC array:
Daftar  @INC adalah daftar directory yang akan di cari oleh Perl saat berusaha untuk me-load modul. Untuk melihat isi @INC gunakan perintah


  perl -e "print join(\"\n\", @INC);"
  perl -e "print join(\"\n\", @INC);"


Contoh akan keluar sebagai berikut


The following two methods may be used to append to Perl's @INC array:
/etc/perl
/usr/local/lib/perl/5.10.1
/usr/local/share/perl/5.10.1
/usr/lib/perl5
/usr/share/perl5
/usr/lib/perl/5.10
/usr/share/perl/5.10
/usr/local/lib/site_perl
Ada dua (2) cara yang dapat digunakan untuk menambah ke daftar Perl @INC


# Add the directory to the PERL5LIB environment variable.
# Masukan directory ke PERL5LIB environment
# Add use lib 'directory'; in your Perl script.
# Masukan menggunakan lib 'directory'; di script Perl.


For more information, read the perlrun manpage or type perldoc lib
Untuk informasi lebih lanjut, baca manpage perlrun atau tulis
 
perldoc lib





Revision as of 03:28, 12 February 2012

Daftar @INC adalah daftar directory yang akan di cari oleh Perl saat berusaha untuk me-load modul. Untuk melihat isi @INC gunakan perintah

perl -e "print join(\"\n\", @INC);"

Contoh akan keluar sebagai berikut

/etc/perl
/usr/local/lib/perl/5.10.1
/usr/local/share/perl/5.10.1
/usr/lib/perl5
/usr/share/perl5
/usr/lib/perl/5.10
/usr/share/perl/5.10
/usr/local/lib/site_perl

Ada dua (2) cara yang dapat digunakan untuk menambah ke daftar Perl @INC

  1. Masukan directory ke PERL5LIB environment
  2. Masukan menggunakan lib 'directory'; di script Perl.

Untuk informasi lebih lanjut, baca manpage perlrun atau tulis

perldoc lib


Referensi

Pranala Menarik