i confess, i've never used LWP... but i do work around webdev and i can't figure out, what you're trying to do.

lemme explain...
A) many developers (who have a site) capture info from users - like 'user agents' (browsers, spiders/bots, etc), http-referers (to tell'em where the visitor is coming from), etc... if you're trying to get this info from a site you don't own or work on - it begs the question... why?

unless of course, you're trying to hack it (in which case, i won't be answering that Q).

B) regarding default pages - this is done in configuration files on the server. The administrator can put whatever they wish as the default. And if the site is dynamically generated (via a script - like perl), uses frames, redirection, etc... as anonymous monk above me said, it's quite possible the visitor may not know. (And if you're trying to get into someone's config file, ya might wanna have an attorney on retainer.)

you could always glance at the html's source code... that might give an indication - but that isn't guaranteed, since the server can redirect someone at its whim. You can ask for page X and the server might decide to give you page Y. It's the server's choice - it's THEIR files.

C) To try to get this back to perl, however... Assuming you're not nefarious and are running a server yourself - trying to get info from your visitors, there's a very easy way to do this -> Just use environmental variables.

my $item1 = $ENV{PATH_INFO} my $item2 = $ENV{PATH_TRANSLATED} my $item3 = $ENV{HTTP_USER_AGENT} my $item4 = $ENV{HTTP_REFERER} etc...

i'm not gonna list all the possible @ENV out there, but any html/cgi book should have'em listed. (We'll plug the CGI Programming with Perl by O'Reilly) Do note, however, that these variables are dependent upon the visitor's platform (browser, etc) and its configuration. One can't rely on this info completely, but it isn't bad for broad-based statisical info.


In reply to Re: defaultpage of website by wolfi
in thread defaultpage of website by vvrao

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.