in reply to Perl Output

Well, you read in a line (into $_), don't modify it, interpolate it in a string that contains a newline, print that interpolated line, and then complain you are getting newlines in the output.

First, lose the \n in the print command, or else you get a newline for each line you print. Second, lose the newline you read in, for instance, by using chomp.

Abigail

Replies are listed 'Best First'.
Re: Re: Perl Output
by mikevanhoff (Acolyte) on Apr 24, 2003 at 12:33 UTC
    Thanks for your suggestion, however, in doing so the results are a wrapped line. I did not want to change the original line, I was simply adding some test to the front and back of it to make a complete command.
      Uhm, your posting says you wanted the output to be a single line. Removing all newlines from your output will make it a single line. If it's too long, many (pseudo)terminals will wrap it.

      Abigail