- publishing free software manuals
Perl Language Reference Manual
by Larry Wall and others
Paperback (6"x9"), 724 pages
ISBN 9781906966027
RRP £29.95 ($39.95)

Sales of this book support The Perl Foundation! Get a printed copy>>>

-V:configvar

Prints to STDOUT the value of the named configuration variable(s), with multiples when your configvar argument looks like a regex (has non-letters). For example:

$ perl -V:libc
    libc='/lib/libc-2.2.4.so';
$ perl -V:lib.
    libs='-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc';
    libc='/lib/libc-2.2.4.so';
$ perl -V:lib.*
    libpth='/usr/local/lib /lib /usr/lib';
    libs='-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc';
    lib_ext='.a';
    libc='/lib/libc-2.2.4.so';
    libperl='libperl.a';
    ....

Additionally, extra colons can be used to control formatting. A trailing colon suppresses the linefeed and terminator ';', allowing you to embed queries into shell commands. (mnemonic: PATH separator ':'.)

$ echo "compression-vars: " `perl -V:z.*: ` " are here !"
compression-vars:  zcat=” zip='zip'  are here !

A leading colon removes the 'name=' part of the response, this allows you to map to the name you need. (mnemonic: empty label)

$ echo "goodvfork="`./perl -Ilib -V::usevfork`
goodvfork=false;

Leading and trailing colons can be used together if you need positional parameter values without the names. Note that in the case below, the PERL_API params are returned in alphabetical order.

$ echo building_on `perl -V::osname: -V::PERL_API_.*:` now
building_on 'linux' '5' '1' '9' now
ISBN 9781906966027Perl Language Reference ManualSee the print edition