Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

RE: RE: RE: RE: slash converter

by Shendal (Hermit)
on Oct 13, 2000 at 22:13 UTC ( #36635=note: print w/replies, xml ) Need Help??


in reply to RE: RE: RE: slash converter
in thread slash converter

(posted by request from chatterbox)

Yes, it works the same on Win2k. Of course, it will assume the root on the current drive letter, though (use chdir to change drive letters).

Here's an example to illustrate the point:
#!perl -w use strict; # always open(F,">/temp/foo.txt") or die "Unable to open temp file for write: $!\n"; print F "This is a test. This is only a test.\n"; close(F); open(F,"/temp/foo.txt") or die "Unable to open temp file for read: $!\n"; while (<F>) { print "foo: $_"; } close(F); unlink ("/temp/foo.txt");
...which outputs:
foo: This is a test. This is only a test.


Cheers,
Shendal

Replies are listed 'Best First'.
RE: RE: RE: RE: RE: slash converter
by Fastolfe (Vicar) on Oct 13, 2000 at 22:14 UTC
    In write-mode also? E.g. open(F, ">/somedir/filename.txt") In other words, does it correctly create this new file as c:\somedir\filename.txt?

    (Update: The original node was updated, answering this question.)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://36635]
help
Chatterbox?
LanX is sure Louvre is going to move to Glasgow after brexit
[ambrus]: marto: http://www. irregularwebcomic. net/3498.html and http://www. irregularwebcomic. net/3549.html
[ambrus]: the annotation mentions Brisbane as even worse, and I add Debrecen
[marto]: :)
[ambrus]: robby: dunno, I would like to visit London some time, although there are other places I'd like to visit more
[marto]: "Okay, sure, there are in fact museums and art galleries and other culturally enlightened things to do in Glasgow, but that wouldn't have made a funny comic"

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (9)
As of 2017-12-15 11:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (431 votes). Check out past polls.

    Notices?