Re: Training Using Windows

[email protected] (Peter Prymmer)
Newsgroups perl.trainers
Message-ID <[email protected]>
On Tue, 10 Apr 2001, Peter Scott wrote:

>   Wordpad is better than Notepad if any of your files come from Unix; the 
> former handles the line terminators, the latter displays them as 
> boxes.  There are of course much better unbundled editors; gvim works nicely.
> 
>   Double clicking on a program will cause the output to flash in a DOS 
> window and promptly go away.  I use something like
> 
> END { print "Done, hit <RETURN>: " and <STDIN> if $^O =~ /Win32/ }
> 
>   You will spend most of your excess time going, "Ok, just grep the files 
> for the line containing -- oh, wait a minute --"

While the use of wordpad can be helpful in this regard I would have
thought that encountering a Unix LINE FEED file in a "Perl on Windows"  
class would have been an opportune time to introduce how to deal with them
on Windows using perl.  Recall that most Unices already have a working tr
and/or sed program whereas most Windows machines do not (unless they're
developers working with MKS, U/Win, Cygwin, etc.).  You can use perl on
either/both unix or Windows to deal with the end of line problem.

For example, ftp a file over from unix to Windows specifying bin for 
binary transfer then run:

    C:\>perl -pe "s/\n/\n/g" myunix_file.dat > mywin_file.dat

problem solved - using perl.

Peter Prymmer
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.