It is wrapping because your window is 72 columns wide. Try looking at the file in a longer (wider?) window.
------
We are the carpenters and bricklayers of the Information Age.
Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose
I shouldn't have to say this, but any code, unless otherwise stated, is untested
| [reply] |
Hi dragonchild -
I am experiencing this problem in writing my data to a file - this is not a display issue. When opening the output file with vi I have the last bit of my data - a 6th string - on a line below where everything else (the first 5 strings..) is printed. And yes, this happens with every line. No, there is no "\n" in my "print" command. I can only surmise that there is something in either my perl - or - unix environment that is causing this newline behavior. I first thought it to be a perl phenomenon but now I'm wondering if it is something like $TERM that is causing this....
| [reply] |
| [reply] |
Heya,
Earlier you said..
When opening the output file with vi ...
Are you looking at the output file in vi? vim? You didn't mention cat, or, a pager (like less or more).
Are you on a stock linux machine? If so, your vi may be vim.
If so, check your
/etc/vimrc
/usr/local/etc/vimrc
or, your ~/.vimrc
for a vim text wrapping directive such as:
set textwidth=72
If you're using the stock vi on Solaris or BSD or something else there's textwrap controls too.. I don't know them off the top of my head.. I think it's the "wraplen" directive ..
cat your outputfile in a large xterm at the command line - see if you have the same problem.. that is, without using an editor?
As hinted at by Zaxo and Dragonchild, this probably has not to do with Perl:)
| [reply] [d/l] |
All,
Thanks for replying - I've been sitting here too long.
I was getting newlines because I assigned a variable to the output of a command that, yes, returns a newline after its data.
Deduct points for me.
All I needed was chomp.
Sorry - please move on.
rspence
| [reply] |
Hi, rspence. What makes you think the lines are shortened? How can you tell how long the lines are?
| [reply] |
I am printing out (using "print") 6 strings. Cumulatively they cover somewhere between 71-74 chars including a single char (space or comma,) in between each string. What I end up with are the first 5 strings on a line (usually 60-63 chars) with the 6th string on a line below for each set. This happens with every single print command. Honestly I have no "\n" in the print statement. Also - I am writing this to a file created by sysopen.
I'm beginng to think that this is not a perl problem but a unix (TERM?) environment problem. But I'm still in the dark...
| [reply] |