My apologies...here it is:
if($passwd ne "") { $depass = decode_base64($passwd); print "read this----->$depass\n"; @name = split(/:/,$depass); chomp $name[0]; chomp $name[1]; open(FH, "<userlist.txt"); while (<FH>) { $line = $_; chomp $line; @listuser = split(/:/,$line); chomp $listuser[0]; chomp $listuser[1]; #if user is eligible if (($name[0] eq $listuser[0]) && ($name[1] eq $listuser[1])) { print "this is @name[0] = @listuser[0] : @name[1] = @listuser[1]\n"; print "juz above web sock new\n"; $web = IO::Socket::INET->new(PeerAddr => +$host,PeerPort=>80) or die "$@"; #send request to web server print "I'm juz above the syswrite web\n"; print "WEB SOCK >> $web \n"; print "BUFFER >> $buffer1\n"; syswrite($web,$buffer1); #buffer3 is the web data while($bytes = sysread($web,$buffe +r3,1024)>0) { #output the data to bro +wswer syswrite($browser, $buffer3) +; @nameLine += (split (/\n/, $line)); @byteadd = + (split (/:/, $line)); open(FH, " +>>userlist.txt") or die ("Error, cannot be opened"); + $listuser[2] = $downloadTo +tal; print(FH $ +listuser[2]); close(FH); + last; } }

In reply to Re^2: adding an element in existing file.. by bran4ever
in thread adding an element in existing file.. by bran4ever

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.