in reply to Re: perl robocopy to temp mapped drive.
in thread perl robocopy to temp mapped drive.
above code always produces error:#!/usr/bin/perl -w use strict; use warnings; my $destination = qq(\\\\BLAH\\NESTED\\OBFUSCATED\.WITH SPECIAL_CHARS\ +\SHARE\\NAME\\DOWN\\DEEP); netUse ($destination); sub netUse { my @net_use_output; chomp $_[0]; $_ = $1 if($_[0]=~/(.*)\\$/); print "\nnet use \* \"$_[0]\""; open TASK, "net use \* \"$_[0]\"" or die "cannot map $_[0]"; while (<TASK>) { print; #chomp; #chop; #push (@net_use_output, $_); #return $_; } #print join(", ", @net_use_output); #return @net_use_output; }
Even though copying and pasting the same command on the cmd shell works perfectly?cannot map \\BLAH\NESTED\OBFUSCATED.WITH SPECIAL_CHARS\SHARE\NAME\DOWN +\DEEP at ..\ examples\blah.pl line 12, <TASK> line 1. net use * "\\BLAH\NESTED\OBFUSCATED.WITH SPECIAL_CHARS\SHARE\NAME\DOWN +\DEEP"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: perl robocopy to temp mapped drive.
by poj (Abbot) on Oct 11, 2018 at 17:45 UTC | |
by 3dbc (Monk) on Oct 11, 2018 at 17:53 UTC |