Click here to get back home

trouble with Archive::Tar : Can not read compressed format in tar-mode

 HomeNewsGroups | Search | About
 comp.lang.perl.misc    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
trouble with Archive::Tar : Can not read compressed format in tar-mode benoit Guyon 07-26-2005
Get Chitika Premium
Posted by benoit Guyon on July 26, 2005, 10:54 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 Paul Marquess on July 26, 2005, 11:37 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 benoit Guyon on July 26, 2005, 3:53 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

Similar ThreadsPosted
Archive::Zip - zip file has "invalid" format October 5, 2006, 9:41 am
Photo does not recognize format of Archive::Zip contents June 8, 2005, 6:13 am
read / write Java object stream format? March 9, 2006, 4:32 pm
trouble merging files using nested loop to read files October 14, 2006, 6:56 pm
Reading compressed file and its conversion to numbers. February 17, 2005, 4:32 pm
is there a reliable cross-platform method for testing if a file is compressed? November 10, 2006, 11:48 am
converting exponential format number to decimal format number December 14, 2006, 5:32 pm
Problem with Archive::Tar July 8, 2004, 11:57 am
Problem with Archive::Tar July 19, 2004, 4:09 am
Archive::Zip - writeToFileNamed log? October 16, 2006, 8:27 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap