in reply to Re: filenames with spaces causing problems
in thread filenames with spaces causing problems

sub mv_files{ my ($file,$disc)=@_; print "moving $file to disc$disc/$file\n"; if ($doit == 1) { print "truely moving $file to disc$disc/$file\n"; move($file, "disc$disc/$file") or warn "move $file to +disc$disc/$file failed: $!\n" } }

Replies are listed 'Best First'.
Re: Re: Re: filenames with spaces causing problems
by roju (Friar) on Jul 11, 2003 at 20:01 UTC
    As many of the posts have been mentioned, using `ls`, files with spaces will be split into multiple tokens. If you use any of the suggestions from above to actually read in the lists of files to use (ie, do it from in perl, use * globbing, use find), then $file will contain the correct data.
Re: Re: Re: filenames with spaces causing problems
by tedrek (Pilgrim) on Jul 11, 2003 at 21:48 UTC

    On this line,

    move($file, "disc$disc/$file") or warn "move $file to +disc$disc/$file failed: $!\n"

    What error is it printing out, and where does move() come from, ie. which module. Or if you wrote it your self what does sub move {.... look like?