muizelaar has asked for the wisdom of the Perl Monks concerning the following question:
#Updates web_setup sub vpenv { open(MYFILE, "$location/$dir/$site/$vpfile") || die "Unable to open fi +le: $!"; my @stuff=<MYFILE>; $stuff[0]="setenv DSCUSTOMER $db\n"; $stuff[1]="setenv DSSITENO $sno\n"; $stuff[2]="setenv DSCUSTID $sid\n"; open STDOUT, ">$location/$dir/$site/$vpfile" || die "Unable to Write t +o file: $! "; print @stuff; close(STDOUT); close(MYFILE); } #Updates database.form sub vpdb { open(MYFILE, "$location/$dir/$site/$vpdir/$vpdata") || die "Unable to +Open File: $ !"; my @thing=<MYFILE>; $thing[0]=".ARG DATABASE $db\n"; open STDOUT, ">$location/$dir/$site/$vpdir/$vpdata" || die "Unable to +Write to Fil e: $!"; print @thing; close(STDOUT); close(MYFILE); } &vpenv; &vpdb;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Filehandle Error
by Anno (Deacon) on Jul 06, 2007 at 09:30 UTC | |
|
Re: Filehandle Error
by tirwhan (Abbot) on Jul 06, 2007 at 09:40 UTC | |
by muizelaar (Sexton) on Jul 09, 2007 at 14:46 UTC |