luolimao has asked for the wisdom of the Perl Monks concerning the following question:
Something in my code is inserting invisible newlines into my strings in a terminal, and I would like to have any suggestions as to how to fix my code to get rid of them, or where to find such info.
code causing newline (newline 'appears' directly after $index):
say "Do you want to simplify a radical (option 1), find a prime facto +rization (option 2), or both (option 3)?\n"; $option=<STDIN>; say "Enter a number:\n"; $input = <STDIN>; if ($option==1 || $option==3){ say "Enter index of radical\n"; $index=<STDIN>; } $safe = $input; $current =$safe; #... if($current!=1){ say "$simple rad[$index] $current"; } if ($option>1){ say "The prime factorization of $safe is:\n"; say %powers;} if ($option!=2){ $simple = ($safe/$current); $current=$safe/($simple**$index); say "The simplified radical is:\n"; if($current!=1){ say "$simple rad[$index] $current"; }else{ say "$simple rad[$index]"; }}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: 'Invisible' newlines/line wrapping
by GrandFather (Saint) on Apr 23, 2010 at 01:50 UTC | |
|
Re: 'Invisible' newlines/line wrapping
by GrandFather (Saint) on Apr 23, 2010 at 01:42 UTC | |
|
Re: 'Invisible' newlines/line wrapping
by ikegami (Patriarch) on Apr 23, 2010 at 01:42 UTC | |
by luolimao (Initiate) on Apr 23, 2010 at 01:47 UTC | |
by ikegami (Patriarch) on Apr 23, 2010 at 01:55 UTC | |
|
Re: 'Invisible' newlines/line wrapping
by ww (Archbishop) on Apr 23, 2010 at 01:46 UTC | |
|
Re: 'Invisible' newlines/line wrapping
by gooshie (Initiate) on Apr 23, 2010 at 01:48 UTC | |
|
Re: 'Invisible' newlines/line wrapping
by luolimao (Initiate) on Apr 23, 2010 at 01:51 UTC | |
by GrandFather (Saint) on Apr 23, 2010 at 02:49 UTC | |
by ww (Archbishop) on Apr 23, 2010 at 02:03 UTC | |
by toolic (Bishop) on Apr 23, 2010 at 02:39 UTC |