I have a question.. I have perl bot thats uses IRC. One of the functions that I have it do upon a command is it opens a file with random emails and fills the form on a website.

This is how I have it read the file and select a random line.

open FILE, "emails.txt" or die "Error Opening: Cannot open file!"; @emails = <FILE>; close FILE; $email = $emails[int(rand($#emails + 1))];

This is how I have it form fill.

my $agent = WWW::Mechanize->new( autocheck => 1 ); my $formfiller = WWW::Mechanize::FormFiller->new(); $agent->env_proxy(); $agent->get('http://www.somewebsite.com'); $agent->form_number(2); $agent->current_form->value("email", "$email");

My problem is this: When it fills the form, it fills in the email address and the return html coding will look something like this:

name="email" id="email" value="blahblah@email.com

" size="35" maxlength="255" class="formFld" />

The email address is entered within the " " and then for some reason jumps to a next line like above. I need it for when it fills the form that it stays all on the same line within the " ". Example:

name="email" id="email" value="blahblah@email.com" size="35" maxlength="255" class="formFld" />

Does anyone have a solution for me? Any help would be GREATLY appreciated. Thanks


In reply to Open file and formfill by fame

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.