I am a Perl novice, I have writtrn a program to retrieve stock quotes from www.CSE.lk. We are using a proxy sever to browse the web. Every time i run this program the result is retrieved from the proxy cache, not from the web. I need to know how to get around the proxy. Any one who could help me?????
use LWP::Simple; use File::stat; print "CSE Stock Quote v1.1\n"; while ($company == ""){ FLAG: print "ENTER COMPANY CODE:"; chop ($company = <STDIN>); # Get the Company code from the command lin +e if ($company =~ /EXIT/i){ last; #exit the program when typed 'EXIT' } else{ $reponse = get("http://203.115.0.6/servlet/RealIndicesServlet"); # +get the information from this URL open(OUTFILE, ">c:\\CSE.txt") or die "Can't open out File: $!\n"; +# Make and OPen a file print OUTFILE $reponse; # SAve information In a file close OUTFILE; open(WORKFILE, "c:\\CSE.txt") or die "Can't open work File: $!\n"; + #Re open CSE.txt for get information $lineNo = 0; while(($ligne=<WORKFILE>) ne ""){ #Read file line by line $lineNo++; if ($ligne =~ /^$company$/ix){ #Match the Company code $CompanyLNo = $lineNo; #Get the line number of th +e company code print "$CompanyLNo\n"; open(WORKFILE2, "c:\\COMLIST.txt") or die "Can't open work F +ile: $!\n"; while(($comlist=<WORKFILE2>) ne ""){ if ($comlist =~ /$company/ix ){ @comname = split (/\,/, $comlist); } } } elsif($company =~ /\d\s/){ # avoids invalid company names with d +igits goto FLAG; } } close(WORKFILE); open FILE, "c:\\CSE.txt"; # re open CSE.txt @lines = (<FILE>)[$CompanyLNo+1..$CompanyLNo+3]; # get data in 2nd to +4th lines which preceeds the company code line close (FILE); $filepath = "c:\\CSE.txt"; stat($filepath); unlink $filepath or die "Couldn't delete $filepath: $!"; if (@comname[1] =~ /NULL/){ print "STOCK PRICE OF Company Name N/A \n"; } else{ print ("STOCK PRICE OF ", @comname[1]); } print ("Now Price Rs: ", $NowPrice = @lines[0]); if ($NowPrice =~ /\+/){ print ("Price UP By Rs: ", $PriceChange = @lines[1]); } elsif ($NowPrice =~ /\-/){ print ("Price DOWN By Rs: ", $PriceChange = @lines[1]); } elsif ($NowPrice =~ /\~/){ print ("Price UNCHANGED By Rs: ", $PriceChange = @lines[1]); } print ("Quantity Traded ", $Quantity = @lines[2],"\n"); } }

In reply to How to Get around Proxy by Kanishka

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.