ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl-win32-web
perl-win32-web
Re: Perl-Win32-Web Digest, Vol 32, Issue 1
by David Landgren other posts by this author
Jan 7 2007 2:17AM messages near this date
view in the new Beta List Site
Re: Perl-Win32-Web Digest, Vol 32, Issue 1 | Perl/Binmode issue
Charles Pelkey wrote:
>  Try the following:
>   
>  open(DLFILE, "<$files_location\test.pdf") or die "Could not open file 

\t is interpreted as a tab character. This is why it fails.

When using \ as path separators they must always be escaped, hence

   open(DLFILE, "<$files_location\\test.pdf") or die "Could not open file

or, a little less ugly and more cross-platform, use forward slashes;
Perl will know what to do.

   open(DLFILE, "<$files_location/test.pdf") or die "Could not open file

Also, the three-arg form is safer:

   open(DLFILE, "<", "$files_location/test.pdf")

David

_______________________________________________
Perl-Win32-Web mailing list
Perl-Win32-Web@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Charles Pelkey
David Landgren

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved