At 4:49 PM +0200 4/26/11, Khabza Mkhize wrote:
I have different Web based scripts when they run update SQL Data Base. Now I
need to audit every update sql in my database and store all logs to data
file.
I dont mind about size of a file since I will create different file foreach
item Audited. I will be writing to a file username, date/time, item changed

Check out the open, print, printf, and close functions.

To create a new file or overwrite an existing file, use the three-argument version of open:

open( my $outh, '>', $filename) or die("Can't open $filename for writing: !$");

where $filename is a string variable containing the name of your file.

If you want to append to an existing file (or create it if it doesn't exist), use '>>' for the second argument:

open( my $outh, '>>', $filename) or die("Can't append to $filename: !$");

See:

  perldoc -f open
  perldoc -f print
  perldoc -f printf
  perldoc -f close




--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to