kulls has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
I'm unable to detect the correct windows path in the below code.
Can anyone suggest me how many '\' that I need to add it in the path to make it works ?
Is there any better modules to tackle the path issues in windows ?
-Raja
I'm unable to detect the correct windows path in the below code.
Can anyone suggest me how many '\' that I need to add it in the path to make it works ?
Is there any better modules to tackle the path issues in windows ?
#!C:\perl\bin\perl use strict; use warnings; my %typehash = ( 'tomcat' => '\\d\$\\logs\\tomcat', 'tomcatweb' => '\\d\$\\logs\\web', 'apache' => '\\d\$\\logs\\Apache' ); sub getLog { my ($a,$type)=@_; my $server=$a; my $dir = "\\\\$server".$typehash{$type}; print "\n $dir "; chomp(my $meh = `dir /b /O:D $dir`); print $meh; } &getLog("test.control.com",'tomcat');
-Raja
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Accessing Windows Path from Perl script
by BioLion (Curate) on Aug 13, 2010 at 14:17 UTC | |
Re: Accessing Windows Path from Perl script
by VinsWorldcom (Prior) on Aug 13, 2010 at 14:22 UTC | |
Re: Accessing Windows Path from Perl script
by roboticus (Chancellor) on Aug 13, 2010 at 14:58 UTC | |
Re: Accessing Windows Path from Perl script
by jonadab (Parson) on Aug 13, 2010 at 19:26 UTC |
Back to
Seekers of Perl Wisdom