Help for this page

Select Code to Download


  1. or download this
    open(FILE, "data.txt");          #opens data.txt in read-mode
    while(<FILE>){                   #reads line by line from FILE which i
    +s the filehandle for data.txt
    ...
       print "Saw $_ in data.txt\n"; #shows you what we have read
    }
    close FILE;                      #close the file.
    
  2. or download this
    open FILE, ">keylogger.dat";  #opens file to be written to
    while(<>){                    #while we're getting input from the keyb
    +oard
       print FILE $_;             #write it to our file
    }
    close FILE;                   #then close our file.