Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Re: printing array and string on same line

by BigRare (Pilgrim)
on Jun 11, 2003 at 00:28 UTC ( [id://264920]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://264920]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-04-24 21:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found