You mention this is a web application. Your code on the server won't have a way to scrape what's in the browser window, because HTTP just doesn't offer that level of integration between client and server. It was never meant to, so that's not a failing of the protocol. Yet it is a limitation of the environment you'll be using. Your best bet is to get the data from the same place on the server that the current page did and convert that. If you want to use JavaScript in the browser and communicate back to the server, scraping what's already there is possible but in this situation is likely to be far more complex than just grabbing the data on the server again.
Allowing the user to save a file rather than viewing it is partly the browser's issue, because some browsers can be configured to do one or the other with a particular file type no matter how it's sent. However, you can usually have an influence on those options by using the Content-Disposition header.
Getting a description of what's needed is the first step. Figuring out what pieces you'll need is the next step. Getting each piece of the puzzle to work is after that, and finally you can fit the pieces together into a usable whole. Don't forget to test early and often, preferably using automated testing tools.
Perl (just like several other languages) is quite capable of taking some data, putting it into a particular file format, and presenting the file to the user. It's done with spreadsheets, graphics files, PDFs, and more all the time.
As for VCF files, there are a few different types of files that typically get that extension. vCard files are a breeze to process and there are lots of tools available such as Text::vCard. For some others I'm not sure what tools there are to convert to or from them.
In reply to Re: Need some advice on project design
by mr_mischief
in thread Need some advice on project design
by jdlev
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |