Perl LWP: Submitting a Query - Error 400 URL must be absolute
<p>I need to create a script that accesses a website, submits a query, 'clicks' on one of the hits, and sends back the url of the result. What I'm stuck on is submitting the query in the first place. Here is what I have:</p>
<pre><code>use strict;
use warnings;
use LWP::UserAgent;
my $entry = $ARGV[0] or die;
my $url = 'http://genome.ucsc.edu/cgi-bin/hgBlat?hgsid=502819467_w6Oj12MTSqOIIJuSjAKsza4x9yeA&amp;command=start';
my $browser = LWP::UserAgent-&gt;new;
my $response = $browser-&gt;post(
  '$url',
  [
    'sequence'  =&gt; $entry,
    'search' =&gt; 'submit'
  ],
);
die &quot;Error: &quot;, $response-&gt;status_line
 unless $response-&gt;is_success;
</code></pre>
<p>I keep getting this error: Error: 400 URL must be absolute at LWPtest.pl line 14. Can someone explain what this means, and how I should fix the problem? Also how do I approach the &quot;'clicks' on one of the hits, and sends back the url of the result&quot; bit?</p>
<h1>EDIT:</h1>
<p>I found this on the website in question:</p>
<blockquote>
<p>When including a Genome Browser URL, please remove the hgsid parameter. It is an internally-used parameter that expires after about a day.</p>
</blockquote>
<p>Not sure if this is part of the problem; it may become a problem after &quot;about a day&quot;.</p>