windows and open() 
Author Message
 windows and open()

hello,
i'm using activeperl v5.0 on win98, and am having a couple problems

the first is specifying the location of a file when i try to open it
for reading, or whatever.  if the file is in the same directory as the
perl script, then there's no problem, but specifying the path doens't
work.  the following code doesn't work

open(FILE,"c:\test.txt");

i get: "No such file or directory" even though the file does exist.

the second problem is, how can i invoke an external program like
"command.com" to run?

thx
lucas



Thu, 27 Jan 2005 13:43:03 GMT  
 windows and open()

Quote:

> open(FILE,"c:\test.txt");

> i get: "No such file or directory" even though the file does exist.

$ perldoc -q "dos path"
Found in /usr/local/lib/perl5/5.8.0/pod/perlfaq5.pod
       Why can't I use "C:\temp\foo" in DOS paths?  Why doesn't
       `C:\temp\foo.exe` work?

       Whoops!  You just put a tab and a formfeed into that
       filename! [...]

--
Steve

perldoc -qa.j | perl -lpe '($_)=m("(.*)")'



Thu, 27 Jan 2005 14:29:04 GMT  
 windows and open()
On Sun, 11 Aug 2002 06:29:04 GMT, Steve Grazzini

Quote:

>$ perldoc -q "dos path"
>Found in /usr/local/lib/perl5/5.8.0/pod/perlfaq5.pod
>       Why can't I use "C:\temp\foo" in DOS paths?  Why doesn't
>       `C:\temp\foo.exe` work?

>       Whoops!  You just put a tab and a formfeed into that
>       filename! [...]

>--
>Steve

>perldoc -qa.j | perl -lpe '($_)=m("(.*)")'

thanks very much steve


Thu, 27 Jan 2005 14:44:48 GMT  
 windows and open()
try:
open(FILE,"c:\\test.txt");

or:
open(FILE,'c:\test.txt');

The \ indicates an escape in ""

Quote:

> hello,
> i'm using activeperl v5.0 on win98, and am having a couple problems

> the first is specifying the location of a file when i try to open it
> for reading, or whatever.  if the file is in the same directory as the
> perl script, then there's no problem, but specifying the path doens't
> work.  the following code doesn't work

> open(FILE,"c:\test.txt");

> i get: "No such file or directory" even though the file does exist.

> the second problem is, how can i invoke an external program like
> "command.com" to run?

> thx
> lucas



Wed, 09 Feb 2005 03:08:56 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Windows NT Open file dialog boxes - How?

2. How to get Windows Nt Open File Dialog Box

3. Test if a window is open?

4. Can a window be opened borderless?

5. Windows NT Open File Dialog Box - How?

6. Is there a Perl module for determining what windows are open and associated information?

7. how to open new window

8. ----- How to open new window

9. on windows: launching .pl script from menu opening upon right-click

10. opening a new browser window

11. ActivePerl: DOS window opening during scheduled execution

12. Opening new windows via CGI

 

 
Powered by phpBB® Forum Software