I want to print the contents of @INC from the Shell,is it possible?
Yes, easily:

perl -e "print \"@INC\""

This will work on *nix & Windows. On *nix you don't need to juggle with quotes as much.

Do we always need a .pl file?
No. See the above example

If type 'perl' in the shell, the cursor moves to a new line and receives my input, but the commands I enter there are not executing.I use CONTROL+C to return back to shell.
Use Control-D on Unix variants or Control-Z on Windows

Have a look at PerlMonks FAQ and The Perl Monks Guide to the Monastery for more information on how the Monastery works. Voting/Experience System is essential reading if you intend to be here for some time. Finally, don't forget there's hundreds of thousands of posts here, Super Search is your friend.

Finally, welcome to the Monastery. I hope you enjoy your stay.

update: added pointers to FAQs


In reply to Re: printing @INC contents and Command line interpretation by FunkyMonk
in thread printing @INC contents and Command line interpretation by narainhere

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.