Bhagya has asked for the wisdom of the Perl Monks concerning the following question:

Hi , Please help me to use the backquote operator to reterive the al the contents in the C drive . print `dir C:` this is not printing the directory list in the terminal

Replies are listed 'Best First'.
Re: back quotes usage in Perl
by Corion (Patriarch) on Oct 30, 2013 at 08:49 UTC

    Does the command work when you type it manually into the console window?

Re: back quotes usage in Perl
by ww (Archbishop) on Oct 30, 2013 at 11:48 UTC

    The code (NB: use code tags around code and data) should not print anything. If you're trying to use Win32's print command from the command line, you need to ask Windows for help:

    C:\>help print Prints a text file. PRINT [/D:device] [[drive:][path]filename[...]] /D:device Specifies a print device.

    If this is intended to be a Perl question about a CLI one-liner, take note that what you've shown indicates that you're not invoking Perl. If this is actually a Perl question, rather than merely a poorly defined one, you'll need to tell the computer to use perl to execute your command:

    perl -E "print `dir C:`"

    That upper-case "E" may be lower-case, depending on your version of Perl.