in reply to Re: printing array and string on same line
in thread printing array and string on same line

Whoops, I am using \n rather than /n. Haha. Long day.

What happens is that nothing prints. Odly enough if I don't chomp the array, it prints: was: $list[$number-1] with the correct values, but nothing else in the print statement.

Update: Fixed tags in post.

Replies are listed 'Best First'.
Re: Re: Re: printing array and string on same line
by sauoq (Abbot) on Jun 11, 2003 at 00:56 UTC

    That sounds like you are chopping $number rather than chomping, and getting the carriage return printed after the number without the linefeed.

    In any case, to get it to print, it sounds like you might need to put a newline ("\n") on the end of your final print. (I say that because you are at least getting something if you don't chomp the array...)

    -sauoq
    "My two cents aren't worth a dime.";
    
      Well, thank you very much for the help. I tried it again from home and it works if I don't chomp the array, but it prints nothing if I chomp the array. Now that I've had a break from thinking, it works.

      Thanks very much for the suggestions. A newline would be of better use on the beginning of the final print as it would move everything down a line, but placing one on the end, I don't think, would do much.

      And since I started writing this, it now doesn't print anything. Interesting, it works on a fresh boot, but not after running a few times. Must be something on my computer. This never happens on my linux box. :o) Thanks again for your help.