Read parameters from text file in CGI : I have a text file in below `url` :

    www.website1.com/text1.txt
I use basic authentication to access this `text1.txt` 

    text1.txt contain :
    username1
    password1
How can i read this parameters from URL  `www.website1.com/text1.txt` in my `.cgi` script? 

I use this code :

    $f = open('http://user:pass@www.website1.com/text1.txt', "r") 
     $u1 = f.readline() 
     $p1 = f.readline() 
    $MAIN_AUTH = '$u1:$p1' ;

Not work
