in reply to Displaying an array in a cgi generated textarea
When you read the file into the array, you read the line terminators as well. Those line terminators start a new line in the textarea, too. When you interpolated the array into a string with -default=>"@source", perl used the value of $" (a space by default) to separate the elements. This is where the extra space came from on the second and subsequent lines.
There are a couple of ways I can think of to fix this. Choose one of these to suit your tastes.
--- print map { my ($m)=1<<hex($_)&11?' ':''; $m.=substr('AHJPacehklnorstu',hex($_),1) } split //,'2fde0abe76c36c914586c';
|
|---|