CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
@INC

 



jigneshjsoni
User

Dec 31, 2008, 8:43 AM

Post #1 of 4 (635 views)
@INC Can't Post

@INC specifies the location of PERL libraries.

So what shall I understand from @INC, what location does it specify ? When I use "perl @INC" on command prompt, I get message saying "cant run perl script @INC, no such file or directory". So what does @INC mean ?


KevinR
Veteran


Dec 31, 2008, 8:58 AM

Post #2 of 4 (634 views)
Re: [jigneshjsoni] @INC [In reply to] Can't Post

When you do this:

perl @INC

you are telling perl to run a program named @INC. There is no program named @INC. Are you trying to display the contents of @INC?

perl -e 'print "$_\n" for @INC'

on Windows the quoting is different:

perl -e "print \"$_\n\" for @INC"

-e tells perl to run the code inside the quotes. Look up perls command line options for more details.
-------------------------------------------------


shawnhcorey
Enthusiast


Dec 31, 2008, 11:01 AM

Post #3 of 4 (630 views)
Re: [jigneshjsoni] @INC [In reply to] Can't Post


In Reply To
@INC specifies the location of PERL libraries.

So what shall I understand from @INC, what location does it specify ? When I use "perl @INC" on command prompt, I get message saying "cant run perl script @INC, no such file or directory". So what does @INC mean ?


@INC is a special variable that holds the directories (folders) where the Perl modules are. See `perldoc perlvar` and search for it. If you want to add your directories to it, use lib; see `perldoc lib`. To add the directory where the script is use:

Code
use FindBin '$RealBin'; FindBin::again(); 
use lib $RealBin;

See `perldoc FindBin` for details.

__END__

I love Perl; it's the only language where you can bless your thingy.

Perl documentation is available at perldoc.perl.org. The list of standard modules and pragmatics is available in perlmodlib.

Get Markup Help. Please note the markup tag of "code".


hacksics
Novice

Dec 31, 2008, 8:44 PM

Post #4 of 4 (623 views)
Re: [shawnhcorey] @INC [In reply to] Can't Post

Also you can get some information from below thread>>

http://perlguru.com/gforum.cgi?post=34606;sb=post_latest_reply;so=ASC;forum_view=forum_view_collapsed;;page=unread#unread


HACKsicsPirate

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives