Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re^7: capturing STDOUT

by tobyink (Abbot)
on Oct 10, 2012 at 21:34 UTC ( #998324=note: print w/replies, xml ) Need Help??

in reply to Re^6: capturing STDOUT
in thread capturing STDOUT

You could try setting Content-Disposition: inline, but be aware that the Content-Disposition header is just advisory. The browser is free to do what it likes with the file: open it in an external program, save it to disk, or stir some eggs and cream into it and make it into a lovely soufflé. The inline disposition indicates that you'd like it to open within the browser window, but I don't think very many browsers are capable of doing that.

Personally I'd format it as an HTML table and use a little Javascript trickery to allow people to select columns and copy them to the clipboard.

perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

Replies are listed 'Best First'.
Re^8: capturing STDOUT
by Anonymous Monk on Oct 11, 2012 at 08:53 UTC

    Content-Disposition: inline, didn't work

    Can you please provide the code for "format it as an HTML table and use a little Javascript trickery to allow people to select columns and copy them to the clipboard"

    Thanks in advance

      Such code would need to be written in Javascript and not in Perl. This is outside the focus of this site.

      What Javscript code to use would depend on what Javascript framework you use. I think there are numerous methods to display spreadsheets in a browser, for example handsontable.

      You will have to learn about HTML and Javascript if you choose to go down that route.

        thanks for the reply

        My output is still downloading as excel file if I give  Content-Disposition: inline Please help on this to display the Excel output in browser

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://998324]
[Corion]: A good morning to everybody! And it's Friday ;)
[Lady_Aleena]: Good morning, Corion.
[Lady_Aleena]: Can a shebang be conditional?

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2017-04-28 06:16 GMT
Find Nodes?
    Voting Booth?
    I'm a fool:

    Results (519 votes). Check out past polls.