#!/usr/local/bin/perl
#Code is used 

open (LYNX, "lynx -source 'http://www.itn.net/cgi/air?stamp=NEWCOOKY*itn%2Ford%3DNEWREC,itn/air/united&airline=United&persons=1&air_avail=10&air_class=coach+%28lowest+avail.%29&depart=lax&dest.0=nrt&mon_abbr.0=Apr&date.0=16&hour_ampm.0=5+am&mon_abbr.1=Apr&date.1=23&hour_ampm.1=5+am&ecert_num=&rt_ow=Round+Trip&best_itins=2&return_to=best_itins
'
 |") or die "Can't open lynx: $!";

my @lines= <LYNX>;
my $total=0;

my $search="@lines";

	$search =~ m/(USD)/g;
	$pos1=pos($search);

	$price=substr($search, ($pos1-14),6);

foreach (@lines){ 
	if (/USD/){
		print "\n";
		++$total;}
	}; 

print "The total amount of available fares is: $total\n";
print "The price is: $price\n\n";


