title: Adding an Include Path for a Module in a Simple Perl Tutorial
body: <p>I'm trying to do a simple tutorial but I'm having trouble getting started. My problem seems to be installing and getting the correct path to the modules.</p>
  
  <p>**1. Here is the original code:*****</p>
  
  <pre><code>#!/usr/bin/perl -w
  use strict;
  use LWP 5.64;
  
  my $browser = LWP::UserAgent-&gt;new;
  my $url = 'http://www.cspan.org/RECENT.html';
  my $response = $browser-&gt;get($url);
  
  die "Can't get $url -- ", $response-&gt;status_line
      unless $response-&gt;is_success;
  
  my $html = $response-&gt;content;
  while( $html =~m/&lt;A HREF=\"(.*?)\"/g ) {
      print "$1\n";
  </code></pre>
  
  <p><strong>2. But in Host Gator they say this:</strong></p>
  
  <p>Location of Your Perl Module(s)</p>
  
  <p>Path: /home/d********n/perl</p>
  
  <p>Using Your Perl Module(s)</p>
  
  <p>You will need to add /home/d********n/perl to the include path. You can do this by adding the following code to your script:</p>
  
  <pre><code>BEGIN {
      my $base_module_dir = (-d '/home/d********n/perl' ? '/home/d********n/perl' : ( getpwuid($&gt;) )[7] . '/perl/');
      unshift @INC, map { $base_module_dir . $_ } @INC;
  }
  </code></pre>
  
  <p><strong>3. So I added the code but have no idea if I added it in the correct spot.</strong></p>
  
  <pre><code>#!/usr/bin/perl -w
  use strict;
  use LWP 5.64;
  
  BEGIN {
      my $base_module_dir = (-d '/home/d********n/perl' ?
  
  '/home/d********n/perl' : ( getpwuid($&gt;) )[7] . '/perl/');
      unshift @INC, map { $base_module_dir . $_ } @INC;
  }
  
  
  my $browser = LWP::UserAgent-&gt;new;
  my $url = 'http://www.cspan.org/RECENT.html';
  my $response = $browser-&gt;get($url);
  
  die "Can't get $url -- ", $response-&gt;status_line
      unless $response-&gt;is_success;
  
  my $html = $response-&gt;content;
  while( $html =~m/&lt;A HREF=\"(.*?)\"/g ) {
      print "$1\n";
  </code></pre>
  
  <p>Any help would be greatly appreciated.</p>
  
  <p>FYI, I already made sure the file has the needed permissions 755 </p>
  
  <p>Also the LWP::UserAgent has a number of 5.835 in Host Gator. Does that mean I have to change</p>
  
  <p>use LWP 5.64;</p>
  
  <p>to</p>
  
  <p>use LWP 5.835</p>