sub slashHandler
{
   my( $html ) = shift;
   my( @rValue ) = ();

   my @items = split /<TABLE/, $html;
   shift @items;   

   foreach my $item (@items)
   {
      my ($name,$poster,$date,$department,$description,$url,$icon,
      $comments,$category);

      # Put the <TABLE we split off back on.
      $item = "<TABLE$item";

      #print "Item: $item\n";


      ($name) = $item =~ m#<TABLE.*?<B>(.*?)</B>#s;
      ($poster,$date) = $item =~ m#Posted by\s*(.*?)\s+on\s+(.*?)</B>#s;
      ($department) = $item =~ m#<B>from the (.*?) dept#s;
      ($description,$url) =
      $item =~ m#from the.*? dept.*?<BR.*?>\s*(.*?)\s*<P><B>.*?<A href="?(.*?)"?>#si;
      #$item =~ m#from the.*?<BR>\s*(.*?)\s*<P><B>.*?<A href="?(.*?)"?>#si;
      #$item =~ m#from the.*?<BR>\s*(.*?)\s*<BR>.*?<A href="?(.*?)"?>#si;
      ($comments) =
      $item =~ m#\( </B>.*?read more.*?>(\d+)</A> </B#si;
      ($icon) = $item =~ m#</TABLE>(.*?</A>)#s;
      ($category) = $icon =~ m#alt="(.*?)"#si;

      # Strip the formatting
      $name =~ s/\<.+?\>//gs;

      # and fix the whacked out href's that have "//slashdot.org on the front of them!
      $url =~ s/\/\/[a-z]*.?slashdot\.org//si;

      push @rValue,{ 'name' => $name,
      'poster' => $poster,'date' => $date,'department' => $department,
      'description' => $description,'url' => $url,
      'icon' => $icon, 'comments' => $comments, 'category' => $category};
   }    

   return @rValue;
}

1;
# vi: set ts=3 sw=3 nowrap expandtab:
