Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: How to get full path name in windows?

by CountZero (Bishop)
on Dec 09, 2012 at 18:52 UTC ( #1007998=note: print w/replies, xml ) Need Help??

in reply to How to get full path name in windows?

Even on Windows the forward slash in filepaths works. That saves you a lot of escaping.
use Modern::Perl; my $dirname = 'c:/data/eps'; opendir( DIR, $dirname ); my @files = readdir(DIR); foreach my $file (@files) { my $file_path = "$dirname/$file"; say "File path: $file_path"; } closedir DIR;
File path: c:/data/eps/. File path: c:/data/eps/.. File path: c:/data/eps/agrafort.jpg File path: c:/data/eps/alazif File path: c:/data/eps/ARF.jpg File path: c:/data/eps/ARF.png ...
For anything more complicated than a simple list of all files in a directory, File::Find::Rule is something to think about (and it gives you the full file path).


A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

My blog: Imperial Deltronics

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (9)
As of 2016-10-26 09:23 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (338 votes). Check out past polls.