View Single Post
  #6 (permalink)  
Old 07-07-08, 04:33 AM
curbview.com's Avatar
curbview.com curbview.com is offline
Junior Code Guru
 
Join Date: May 2006
Posts: 555
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by theighost View Post
could someone plz tell me what this function exactly does???
Code:
sub get_file_contents{ 
my ($filename) = @_; # Accepts the data sent to it
my ($filesize, $filesize, $thefile); # declares three variables to be used later
if ((-e "$filename") > 0) # Checks to see if a file exists.
	{
$filesize = (-s "$filename");# checks the size of a file
open (TFILECNTS, "$filename") || die "$filename"; #opens the file for reading
	read(TFILECNTS,$thefile,$filesize); #reads the file
close (TFILECNTS); # closes the file
	}

return ($thefile); returns what it read.

}
Look at the comments for answers (it's inside the quoted code you posted above). To be honest, you should read more about perl as translating it is not the purpose of this forum. Glad to help though.
__________________
Whatever you decide, you should make sure best security methods are used and practiced. Should you really need more help, PM me.
Reply With Quote