what do you get when you print out the result of 'getcwd'?  does that
give you what you expect?

________________________________

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Mothi
Mehta
Sent: Thursday, May 31, 2007 1:37 AM
To: [email protected]
Subject: Absoulte path in Perl


Hello everyone, 

I am getting problems in Perl to get Absolute path, 

My Directory structure is :   

c:\Inetpub\wwwroot\mytestscripts\perl\path.pl 

scripts details: 

#!/usr/bin/perl -w 
use strict; 
use CGI; 
use Cwd 'abs_path'; 
use Cwd; 
my $cgi           = CGI->new; 
$cgi->header; 
print $cgi->header; 
my $file = getcwd; 
my $abs_path = abs_path($file); 
my $output=''; 
use CGI::Carp qw(warningsToBrowser fatalsToBrowser); # uncommenting this
during debugging phase may be helpful 

  
print <<"END_HTML"; 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 
<HTML> 
<HEAD> 
<TITLE>Absolute Path Sample Script Showing How To Get Absolute Path In
PERL </TITLE> 
</HEAD> 
<BODY> 
<strong>Sample Script Showing Absolute Path </strong> 
<h3>The Absolute Path is:  $abs_path </h3> 

</BODY> 
</HTML> 
END_HTML 




But when I run this its shows : 

Sample Script Showing Absolute Path 
The Absolute Path is: c:/inetpub/wwwroot 

why its showing "c:/inetpub/wwwroot" instead of
"c:/inetpub/wwwroot/mytestscripts/perl" 

is anything wrong ? 

Please suggest me asap.. 

Thanks in advance.. 
Mohit Mehta 
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to