Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Perl Netowrk File Path Syntax

Status
Not open for further replies.

networkwoes

Technical User
Aug 17, 2001
13
US
I am running perl on the d drive of an NT machine, and I have a text file that I want to open from a novell network drive that i have mapped as a G drive... could anyone tell me the correct syntax for this????

open( INITIALS , "G:\aa&t\Flat_Files\initials.txt" )

open( INITIALS , "\\jxnclisvr04\vol3\aa&t/Flat_Files/initials.txt" )

neither of these seem to work.
 
try

open( INITIALS , "G:/aa&t/Flat_Files/initials.txt" ) Mike
michael.j.lacey@ntlworld.com
Email welcome if you're in a hurry or something -- but post in tek-tips as well please, and I will post my reply here as well.
 
1. Just use single quotes instead of double:

open( INITIALS , 'G:\aa&t\Flat_Files\initials.txt' )

open( INITIALS , '\\jxnclisvr04\vol\aa&t/Flat_Files/initials.txt' )

2. Always use die (or detect the error in some other way) after the open():

open(FH, $file) or die "Error reading $file - $!";


Jean Spector
QA Engineer @ mSAFE Ltd.
 
Problem solved......... problem turned out to be releated to DOS. DOS could not access the dir name of AA&T due to the &. Renamed the DIR to Automation and it works fine now.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top