use CGI::Carp 'fatalsToBrowser'; # use only while debugging #### #!/usr/bin/perl use strict; use warnings; use CGI qw/:standard/; use CGI::Carp 'fatalsToBrowser'; # use only while debugging use Cwd; my $cwd = getcwd(); # current working directory my $event = param('event') || 1; my $newCOMMENT = param('newCOMMENT') || 'test comment'; my $commentUID = time(); my $path = '/tmp'; my $fileA = "$path/$event.txt"; my $fileB = "$path/$commentUID.txt"; if ($newCOMMENT ne "") { open AFH, '>>', $fileA or die "Could not open $fileA : $!"; print AFH "$commentUID\n"; close AFH; open BFH, '>>', $fileB or die "Could not open $fileB : $!"; print BFH "$newCOMMENT\n"; close BFH ; } print header,start_html; print pre(" cwd : $cwd event : [$event] newCOMMENT : [$newCOMMENT] commentUID : $commentUID"); print end_html;