Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Pipe delimiter

by pragovnj (Novice)
on Feb 12, 2020 at 20:54 UTC ( #11112882=perlquestion: print w/replies, xml ) Need Help??

pragovnj has asked for the wisdom of the Perl Monks concerning the following question:

I have a CGI which outputs to plain text. How to have this as Pipe delimiter?

 print "Content-type: text/plain\n\n" ; Thanks, Pragov

Replies are listed 'Best First'.
Re: Pipe delimiter
by marto (Archbishop) on Feb 12, 2020 at 21:29 UTC

    It would be easier to help if you gave an example of your actual code, the output you expect and any data. See How do I post a question effectively? for more on that. Even the legacy CGI has a method to save you from manually printing headers. Explain what it is you're trying to do, show us how, and you'll likely receive good advice.

Re: Pipe delimiter
by Anonymous Monk on Feb 12, 2020 at 20:58 UTC
    what is a "pipe delimiter" in this context???

      Currently it is is plain text and separated by tab. Is it possible to have a separator like pipe | instead of tab or comma separated?

        All that you've told us so far is that you have some webpage that will contain plain text, that's what the Content tag means. There is no "pipe character" spec in a content type. Your printing code will contain the explicit pipe characters to be printed.

        I have no idea what kind of text that contains pipe characters that you'd like to put on this plain text page. I guess you currently print with tabs - show us that 1) Perl code, 2) program data, 3) example printout and 4) what you think example printout should look like for 5-10 lines of output. Lot's of possibilities: "CSV" file using |?, perhaps a simple table where the pipe chars delimit the columns?




        You can lead your users to water, but alas, you cannot drown them.
Re: Pipe delimiter
by Anonymous Monk on Feb 12, 2020 at 23:12 UTC
    You are asking a rather nonsensical question ... which is why no one can answer it. Content-type: is an HTTP header, so you cannot simply print it. And, what does this have to do with pipe delimiters? No one has a cucking flue.
      > Content-type: is an HTTP header, so you cannot simply print it.

      Rather uninformed, CGIs print headers and content to STDOUT.

      But yes most of the OP doesn't fit into one recognizable question pattern.

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://11112882]
Approved by marto
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2020-04-09 03:09 GMT
Find Nodes?
    Voting Booth?
    The most amusing oxymoron is:

    Results (46 votes). Check out past polls.