in reply to Re: Can't create file
in thread Can't create file

Hello Corion, I really appreciate your views. I am trying this in my home machine. Can you please help me out with pointing out what is wrong with the code ? I just want to create a zone file. I am learning Perl and do not know much about regex. The below is the entire code which I am using,
#!/usr/local/bin/perl use strict; use CGI ':standard'; use Cwd; my $ipaddr = param('ipaddr'); my $domain = param('domain'); my $serial = `/bin/date +"%Y%m%d"00`; print header(), start_html('Zone created Successfully'), "Zone created Successfully", end_html(); open FILE, "+>", "/var/named/$domain.db"; print FILE "@ 86400 IN SOA ns1.eth1.in. ilugbelgaum.g +mail.com. ( $serial ; serial, todays date+todays 86400 ; refresh, seconds 7200 ; retry, seconds 3600000 ; expire, seconds 86400 ) ; minimum, seconds $domain. 86400 IN NS ns1.eth1.in. $domain. 86400 IN NS ns2.eth1.in. $domain. IN A $ipaddr localhost.$domain. IN A 127.0.0.1 $domain. IN MX 0 $domain. mail IN CNAME $domain. www IN CNAME $domain. ftp IN CNAME $domain. "; close FILE;
Thanks !