Welcome to WebmasterWorld Guest from 184.108.40.206
open (OUT,">$out") ;
$inline = join ("\¦",$mast,$mast,$mast) ;
print OUT "$inline\n" ;
close (OUT) ;
The final result is a DOS file, but I need a UNIX file. The result must be transfert to another system.
I first experienced this way back in the day when I did my scripts in NotePad, uploaded them ASCII to a server, and they would 500 error. A wise admin recommended I find an editor that saves in Unix format and volia, the problem went away.
Those of you more adept at perl-y stuff may have better recommendations than below. Try this, which is the octal equivalent of line feed:
$CRLF = "\x0d\x0a";
print OUT "$inline$CRLF" ;
It doesn't work if you put \x0d\x0a in the print command for some reason. Yo might also try just \x0d and \x0a independently.
Of course it's possible none of it will work, since you're creating the file in DOS it may try to adhere to the OS in printing out the file, but it's worth a try. If all else fails you could open it in HomeSite or some other program that saves in Unix format and do a save as.
0D0Afor end of line CR + LF. UNIX only uses
0A. Annoys the hell out of me when a friend of mine sends me code!
You'll need to binmode OUT as follows:
Do that immediately. Then instead of doing:
print OUT "$inline\n";
print OUT "$inline\x0a";
I think \x0a is the same as \r, on DOS you're supposed to use \r\n. I vaguely remember in the olden days I used to have to do that, now \r is inserted automatically.
Infact, thinking about it, you shouldn't might not need to binmode OUT either if you can use \r.
Try those things and let us know how that goes.