NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Various one-liners from MNooning (Score:1)
Here are some Windows one-liners. On Linux, use single quotes and forward slashes.
Find the INC path that Perl sees when it starts up.
>perl -e "print qq[INC = @INC\n];"
INC = C:/Perl/site/lib C:/Perl/lib
Another way to find the INC path.
perl -wle "print for @INC"
C:/Perl/site/lib
C:/Perl/lib
Find out if a module is installed. If it is, no error messages will show.
>perl -e "use Tk"
Obtain the version of an installed module.
>perl -MTk -e "print \"$Tk::VERSION\n\"
804.028501
Here is the same command on Cygwin
>$ perl -MTk -e 'print $Tk::VERSION'
804.028
This is what you see if the module is not there:
>perl -e "use TkBad"
Can't locate TkBad.pm in @INC (@INC contains: C:/Perl/site/lib C:/Perl/lib
This is also what you see if the module is not there:
>perl -MTkBad -e "print \"$TkBad::VERSION\n\"
Can't locate TkBad.pm in @INC (@INC contains: C:/Perl/site/lib C:/Perl/lib
Here is an example of getting the version of an installed module in a deep path. Again, the syntax is different on Linux.
C:\oldProjects\proj_bu_2003\routines>perl -MCatalyst::Authentication::Store::LDAP -e "print \"$Catalyst::Authentication:
0.1005
This is a bit of a different one-liner subject, but a quick way to scroll a module's package file is
>perldoc -m Tk
Reply to This