Greetings all!
It is me again doing things that just aren't meant for the GUI world.
I have created what I call a 'site index file' creation tool...basically it follows all the links at a site (or sites) and logs the URL, Title, and the content. This info gets written to a file which can then be searched on...sort of a hacked Content Index.
Anyways...doing traversals thru a small site (less than 100 pages; dynamic & static) works fine...however, when dealing with a larger site ( 100+ pages; dynamic & static), browsers tend to time out so I can never tell if the script finished or not since the response from the script never makes it back in time. Since I don't know how long the traversal will take, it's not a simple matter of just increasing the browser wait time (if that's possible).
Thinking back to the days when I started using Perl, I figured I would just try running this script from the DOS command line (yes, Virginia, I'm running XP). It works and the debugging information that I inserted displays on each pass. This is much better than outputting to the browser, which seems to wait until the script is completed before it shows me anything...
Only problem is all my debugging text is wrapped in HTML tags...great for browser display, but one big line of crap when output to the command line.
My question: Is there an easy check to tell if a script is being invoked from within a DOS shell vs from a browser. And if so, what is a good (one-liner) way to handle outputting text to each based on that? Something like: print ( if ( dos ) { "$debugtext\n\n"; } else { "<P>$debugtext</P>"; } )
As always - TIA
======================
Sean Shrum
http://www.shrum.net
In reply to Outputting to browser vs DOS...how can you tell? by S_Shrum
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |