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"
In reply to Re^2: perl robocopy to temp mapped drive.
by 3dbc
in thread perl robocopy to temp mapped drive.
by 3dbc
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |