<?xml version="1.0" encoding="windows-1252"?>
<node id="1007998" title="Re: How to get full path name in windows?" created="2012-12-09 13:52:28" updated="2012-12-09 13:52:28">
<type id="11">
note</type>
<author id="198160">
CountZero</author>
<data>
<field name="doctext">
Even on Windows the forward slash in filepaths works. That saves you a lot of escaping.&lt;c&gt;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;
&lt;/c&gt;Output&lt;c&gt;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
...&lt;/c&gt;For anything more complicated than a simple list of all files in a directory, [module://File::Find::Rule] is something to think about (and it gives you the full file path).&lt;!-- Node text goes above. Div tags should contain sig only --&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-198160"&gt;
&lt;p&gt;CountZero&lt;/p&gt;&lt;p&gt;&lt;i&gt;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."&lt;/i&gt; - [http://www.canonical.org/~kragen/tao-of-programming.html|The Tao of Programming], 4.1 - Geoffrey James&lt;/p&gt;My blog: [http://imperialdeltronics.wordpress.com|Imperial Deltronics]
&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
1007994</field>
<field name="parent_node">
1007994</field>
</data>
</node>
