hello
i used this
while(my $file=glob("$dir/*")){
but as the directory has whitespace in path-name it cause error ,how i can solve this?
thnx.

Note that glob will split its arguments on whitespace, treating each segment as separate pattern.

from http://perldoc.perl.org/functions/glob.html
Instead you can use the File::Glob module to override the behaviour of Perl's built-in glob function.

#!/usr/bin/perl
use 5.006;
use strict;
use warnings;

use File::Glob ':glob';
my @files = </home/david/Programming/untitled folder/*>;
foreach (@files) {
	print "$_ \n";
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.