|
Posted by zm5 on March 26, 2007, 2:36 pm
Please log in for more thread options
>>
>> [snip]
>>
>> > if I print "$1\n",
>> > the file prints just fine. But, if I do something like print "$1 after
>> > \n", the whole output is messed up. If I print "before $1\n", nothing
>> > prints at all. If I print "before $1 after\n", only after prints.
>>
>> not really sure, but could be a rogue "\r" in $1,
> There
> is a rogue carriage return (0xd) in the string
> Is there something I can do to deal with this
> situation?
Repair the corrupted file:
perl -p -i -e 'tr/\r//d' bad_file
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
|
|
Posted by zm5 on March 27, 2007, 8:11 am
Please log in for more thread options
>>
>> [snip]
>>
>> > if I print "$1\n",
>> > the file prints just fine. But, if I do something like print "$1 after
>> > \n", the whole output is messed up. If I print "before $1\n", nothing
>> > prints at all. If I print "before $1 after\n", only after prints.
>>
>> not really sure, but could be a rogue "\r" in $1,
> There
> is a rogue carriage return (0xd) in the string
> Is there something I can do to deal with this
> situation?
Repair the corrupted file:
perl -p -i -e 'tr/\r//d' bad_file
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
|
|
Posted by Mumia W. on March 27, 2007, 9:22 am
Please log in for more thread options >>
>> [snip]
>>
>> > if I print "$1\n",
>> > the file prints just fine. But, if I do something like print "$1 after
>> > \n", the whole output is messed up. If I print "before $1\n", nothing
>> > prints at all. If I print "before $1 after\n", only after prints.
>>
>> not really sure, but could be a rogue "\r" in $1,
> There
> is a rogue carriage return (0xd) in the string
> Is there something I can do to deal with this
> situation?
Repair the corrupted file:
perl -p -i -e 'tr/\r//d' bad_file
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
|
|
Posted by Tad McClellan on March 27, 2007, 5:54 pm
Please log in for more thread options >> Could someone give me a link to a tutorial on event handling in perl?
>> I have not been able to find anything, it seems what I always find
>> when searching for event handling in perl is signal handling.
When I googled "perl event handling" and followed the 1st 5 links,
I found none of them were related to signal handling.
How are you searching?
>> Are
>> these two things one in the same?
Signal handling is event handling, but event handling is not (only)
signal handling.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
|
|
Posted by Rocco Caputo on March 28, 2007, 3:07 am
Please log in for more thread options >>
>> [snip]
>>
>> > if I print "$1\n",
>> > the file prints just fine. But, if I do something like print "$1 after
>> > \n", the whole output is messed up. If I print "before $1\n", nothing
>> > prints at all. If I print "before $1 after\n", only after prints.
>>
>> not really sure, but could be a rogue "\r" in $1,
> There
> is a rogue carriage return (0xd) in the string
> Is there something I can do to deal with this
> situation?
Repair the corrupted file:
perl -p -i -e 'tr/\r//d' bad_file
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
|
| Similar Threads | Posted | | How do I pick up existing objects in event handling code? | August 16, 2004, 3:32 pm |
| better way of Event.pm usage | December 8, 2004, 5:31 am |
| FAQ 8.38: How do I timeout a slow event? | October 30, 2004, 5:03 am |
| FAQ 8.38: How do I timeout a slow event? | November 30, 2004, 12:03 pm |
| FAQ 8.38 How do I timeout a slow event? | March 19, 2005, 12:03 am |
| FAQ 8.38 How do I timeout a slow event? | June 10, 2005, 11:03 am |
| FAQ 8.38 How do I timeout a slow event? | September 8, 2005, 4:03 am |
| FAQ 8.38 How do I timeout a slow event? | December 29, 2005, 5:03 am |
| 'file changed'-event | December 28, 2005, 4:57 pm |
| FAQ 8.38 How do I timeout a slow event? | July 9, 2006, 9:03 pm |
|