Could you please send the exact error which you are getting as I
Copy/Pasted the exact code which you had given and it is working properly
for me. I have only given the directory which is present in my system.
use strict;
use warnings;
my $dir = "C:/Python_Exercise/*";
my @files = glob( $dir );
foreach (@files ){
print $_ . "\n";
}
o/p
===
C:\Users\makshay\Documents>perl test.pl
C:/Python_Exercise/__pycache__
C:/Python_Exercise/emp.db
C:/Python_Exercise/emp1.db
C:/Python_Exercise/exception_handling.py
C:/Python_Exercise/Exercise1.py
C:/Python_Exercise/test.db
C:/Python_Exercise/Test.py
C:/Python_Exercise/test.txt
C:/Python_Exercise/test_copy.txt
C:\Users\makshay\Documents>
-Akshay
On Tue, Mar 1, 2016 at 3:53 PM, Arghya Das <[email protected]> wrote:
> use warnings;
>
> $dir = "c:/folder/*";my @files = glob( $dir );
> foreach (@files ){
> print $_ . "\n";}
>
>
> i am trying to read windows directory using above code but it gives errors in
> recognising tthe directory path. please help.
>
>
>