print NEWFILE $_ . "\n"; Then :P
This isn't a perl list, it's off topic. Just thought it might help if I added this to the pool.... Let's rather not go into a in depth discussion about it... I'm no perl guru either. Kind Regards, Chris Knipe MegaLAN Corporate Networking Services Tel: +27 21 854 7064 Cell: +27 72 434 7582 ----- Original Message ----- From: "Miguel Cruz" <[EMAIL PROTECTED]> To: "Chris Knipe" <[EMAIL PROTECTED]> Cc: "PHP List" <[EMAIL PROTECTED]> Sent: Saturday, June 08, 2002 7:51 PM Subject: Re: [PHP] Removing ^M > 'chomp' removes the end-of-line character(s) from its input, which is > different from doing an EOL conversion (which is what the OP was after). > The result of the below perl would be to concatenate all lines together as > one. > > miguel > > On Sat, 8 Jun 2002, Chris Knipe wrote: > > Perl apparently also works very nice for this > > > > open (FILE, "filename"): > > open (NEWFILE, "filename); > > > > WHILE (<FILE>) { > > chomp; > > print NEWFILE $_ > > } > > > > close (FILE); > > close(NEWFILE); > > > > this should take care of ^M > > Kind Regards, > > > > Chris Knipe > > MegaLAN Corporate Networking Services > > Tel: +27 21 854 7064 > > Cell: +27 72 434 7582 > > > > ----- Original Message ----- > > From: "Michael Hall" <[EMAIL PROTECTED]> > > To: "PHP List" <[EMAIL PROTECTED]> > > Sent: Sunday, June 09, 2002 2:40 AM > > Subject: [PHP] Removing ^M > > > > > > > > > > > > > I am trying remove ^M characters (some kind of newline character) from an > > > HTML file. I've tried all sorts of ereg_replace and sed possibilities > > > but the > > > things just won't go away. Does anyone have a way of removing such > > > characters? > > > > > > TIA > > > > > > Mick > > > > > > > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php