http://www.perlmonks.org?node_id=898095


in reply to Version control system for the laziest of the lazy

++

First thing I tried was:

C:\chas_sandbox\PM>bak.pl *.pl Copy failed: No such file or directory at C:\chas_sandbox\PM\bak.pl li +ne 34.

How about glob?

for my $file (@ARGV) { for my $globfile (glob($file)) { copy($globfile, "backup/${globfile}_$date") or die "Copy faile +d: $!"; } }

now I get:

C:\chas_sandbox\PM>bak.pl *.pl C:\chas_sandbox\PM>


#my sig used to say 'I humbly seek wisdom. '. Now it says:
use strict;
use warnings;
I humbly seek wisdom.

Replies are listed 'Best First'.
Re^2: Version control system for the laziest of the lazy
by Corion (Patriarch) on Apr 10, 2011 at 15:52 UTC

    Let me recommend bsd_glob from File::Glob. It understands and properly treats whitespace in path and filenames, something that plain Perl glob does not (unless you start quoting things).

Re^2: Version control system for the laziest of the lazy
by toolic (Bishop) on Apr 10, 2011 at 15:44 UTC
    Excellent. This seems to make up for one of the many shortcomings of the MS-DOS shell.