Click here to get back home

how do I access ksh environment array variables in perl?

 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
how do I access ksh environment array variables in perl? Andy Haupt 03-24-2005
Get Chitika Premium
Posted by Andy Haupt on March 24, 2005, 11:24 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 Chris Mattern on March 24, 2005, 3:26 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
which file, regestry, environment variables do perl install August 8, 2006, 10:33 am
How can I access variables in my perl script from a sub in a module January 3, 2007, 6:50 pm
Evaluating environment variables June 14, 2006, 5:49 pm
persistent environment variables December 7, 2006, 8:02 pm
Environment variables in Excel started from Win32::OLE February 15, 2007, 2:32 pm
Using System to read mixed cased environment variables on Windows June 27, 2008, 2:00 pm
How can I access the variables in my script ($main::var) March 7, 2007, 4:46 pm
Why can't I access an Array like this? August 26, 2007, 8:16 am
How to access a multi-dimensional array? September 19, 2005, 5:20 pm
how can I access an array defined in another module January 2, 2007, 4:41 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap