Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^4: listing all files of a dir

by torres09 (Acolyte)
on Jul 12, 2013 at 06:37 UTC ( #1043885=note: print w/ replies, xml ) Need Help??


in reply to Re^3: listing all files of a dir
in thread listing all files of a dir

no I did getcwd , but I am on windows , so it gives error stating "unidentified subroutine "


Comment on Re^4: listing all files of a dir
Re^5: listing all files of a dir
by hdb (Parson) on Jul 12, 2013 at 06:41 UTC

    For some reason, the name of the current directory is always '.'

Re^5: listing all files of a dir
by davido (Archbishop) on Jul 12, 2013 at 07:04 UTC

    -- vote for not providing enough information for us to avoid giving advice that you already have discovered doesn't work for you.

    ...although... I don't have a handy copy of Windows here, but I have to wonder why the documentation for Cwd contradicts your experience:

    The getdcwd() function is also provided on Win32 to get the current working directory on the specified drive, since Windows maintains a separate current working directory for each drive. If no drive is specified then the current drive is assumed.

    This function simply calls the Microsoft C library _getdcwd() function.


    Dave

Re^5: listing all files of a dir
by ww (Bishop) on Jul 12, 2013 at 10:34 UTC
    use strict; use warnings; use Cwd; my $dir=getcwd; say $dir;

    ...works as documented under 5.16 and W7. It's likely you erred somewhere in your code. Note the first two lines of the snippet above.

    If I've misconstrued your question or the logic needed to answer it, I offer my apologies to all those electrons which were inconvenienced by the creation of this post.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1043885]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (15)
As of 2014-07-10 17:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (214 votes), past polls