in reply to Cross platform compatability Part 1: Shells and Files
except that it breaks DOS machines.
DOS/Windows coders can get their revenge by using
That would be revenge indeed, creating a program which will run nowhere, not even on windows. On seeing this code perl turns it into:
open FH 'C:{TAB}emp';Which is unlikely to be the file you wanted to open. Always, always, always, use '/' as a directory seperator, it works all over the place. In fact, your first versuion:
open (FH, ">/temp/tempfile"); print FH $temporary_data;
will work perfectly well, assuming 'C:\temp\tempfile' exists, but you didn't check the sucess of the open call so you'll never know.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Cross platform compatability Part 1: Shells and Files
by chipmunk (Parson) on Jan 21, 2001 at 21:46 UTC | |
by ok (Beadle) on Jan 25, 2001 at 04:20 UTC | |
by tye (Sage) on Jan 25, 2001 at 04:54 UTC | |
|
Re: Re: Cross platform compatability Part 1: Shells and Files
by jepri (Parson) on Jan 21, 2001 at 19:56 UTC |