use IO::File; my $logfile = IO::File->new("$0.log", 'a');