Hi Monks

I have been trying to read some data from a web using LWP::UserAgent and this is what i have tried so far.

use Data::Dumper; require LWP::UserAgent; require HTTP::Request; my $request = HTTP::Request->new(GET => 'http://pilot/sanju/index.php/ +empdata'); my $ua = LWP::UserAgent->new; my $response = $ua->request($request); unless($response->is_success) { die 'Cannot connect to remote address' +; } my $cmd = $response->content; # print Dumper \$response; open (FILE, "<" , \$cmd ) or die $! ; while (<FILE>){ chomp; print $_; }
when i print using dumper (as per suggestions in CB)i am able to print the content but when itry to open using file handler it gives me an error as nosuch file or directory Can you please advise on how do i process on each line of $request. when i print $request using dumper it prints HTML format as below and i need to extract only the names can i have regex also please.
<td> 1 </td><td>engg </td><td> staff </td><td> ruslion,marry</td></ +tr> <tr> <td> 2 </td><td>accounts </td><td> operational </td><td> tom, +harry </td></tr> <tr><td> 3 </td><td>HR </td><td> support </td><td> john, +wirth

In reply to Help on getting data from LWP::UserAgent by Anonymous Monk

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.