in reply to windows file name probs
Just a slight variation as this may come in handy if you are inserting a directory name from a loop. You only need the quotes around the part of the directory that contains spaces.
Stealing from Rex(Wrecks) example:
coreolyn#!/usr/bin/perl use strict ; my $drive = "C:"; my $cmd = "dir"; my $dir = "Program files"; if ($dir =~ /\s/ ) { $dir = "\"$dir\""; } my $test3 = "$cmd $drive\\$dir"; print ("Test: $test3\n") ; system($test3);
|
|---|