#!/usr/bin/perl -w # Version 0.1 preliminary version using Cdnfundlibrary.pm v0.4 as an example package Finance::Quote::IndiaMutual; require 5.004; use strict; use vars qw($VERSION $AMFI_URL $AMFI_NAV_LIST $AMFI_MAIN_URL); use LWP::UserAgent; use HTTP::Request::Common; use HTTP::Status; use HTML::TableExtract; $VERSION = '1.18'; # URLs of where to obtain information. #$AMFI_MAIN_URL = ("http://localhost/"); $AMFI_MAIN_URL = ("http://portal.amfiindia.com/"); $AMFI_URL = ("${AMFI_MAIN_URL}NavReport.aspx?type=0"); #$AMFI_URL = ("${AMFI_MAIN_URL}spages/NAV0.txt"); This page seems to do the job also. Keep for reference $AMFI_NAV_LIST = ($^O eq 'MSWin32') ? "$ENV{TEMP}/amfinavlist.txt" : "/tmp/amfinavlist.txt"; sub methods { return (indiamutual => \&amfiindia, amfiindia => \&amfiindia); } { my @labels = qw/method source link name currency date isodate nav rprice sprice/; sub labels { return (indiamutual => \@labels, amfiindia => \@labels); } } # # ======================================================================= sub amfiindia { my $quoter = shift; my @symbols = @_; # Make sure symbols are requested ##CAN exit more gracefully - add later## return unless @symbols; # Local Variables my(%fundquote, %allquotes); my($ua, $url, $reply); $ua = $quoter->user_agent; $url = "$AMFI_URL"; $reply = $ua->mirror($url, $AMFI_NAV_LIST); # Make sure something is returned unless ($reply->is_success or $reply->code == RC_NOT_MODIFIED) { foreach my $symbol (@symbols) { $fundquote{$symbol,"success"} = 0; $fundquote{$symbol,"errormsg"} = "HTTP failure"; } return wantarray ? %fundquote : \%fundquote; } open NAV, $AMFI_NAV_LIST or die "Unexpected error in opening file: $!\n"; # Scheme Code;Scheme Name;Net Asset Value;Repurchase Price;Sale Price;Date while (