sulfericacid has asked for the wisdom of the Perl Monks concerning the following question:
I am using the script below and having a problem. I am trying to open up 2 different files so the user can later use the layout of their website with the script. It doesn't work and AdminPro says you cannot open the file in such a manner when using Strict. I am rather new to perl so I'd prefer you don't throw in some really advanced stuff I couldn't understand. If it isn't too much to ask I'd also like someone to fill me in on why you cannot open a file under these conditions.
Thanks!
#!/usr/local/bin/perl -w use strict; my %form = ( author => undef, distributor => undef, copyright => undef, keywords => undef, description => undef, distribution => undef, robots => undef, language => undef, generator => undef, ); use CGI; my $query = CGI->new; print $query->header; %form = %{$query->Vars}; open(HEADER, "header.html") or die("Cannot open file: $!\n"); print <<EOF < meta name="author" content="$form{'author'}"> < meta name="distributor" content="$form{'distributor'}"> < meta name="copyright" content="$form{'copyright'}"> < meta name="keywords" content="$form{'keywords'}"> < meta name="description" content="$form{'description'}"> < meta name="generator" content="SpyderTag V1.0!"> < meta name="robots" content="$form{'robots'};"> < meta name="language" content=$form{'language'}"> < meta name="distribution" content="$form{'distribution'} EOF open(FOOTER, "footer.html") or die("Cannot open file: $!\n"); # open(FH, "> sample.txt") or die("Cannot write to file: $!\n");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How do you open a file when using strict?
by dws (Chancellor) on Aug 05, 2002 at 00:54 UTC | |
|
Re: How do you open a file when using strict?
by Nightblade (Beadle) on Aug 05, 2002 at 00:54 UTC | |
|
Re: How do you open a file when using strict?
by DamnDirtyApe (Curate) on Aug 05, 2002 at 00:59 UTC | |
|
Re: How do you open a file when using strict?
by smalhotra (Scribe) on Aug 05, 2002 at 01:48 UTC | |
|
Re: How do you open a file when using strict?
by theorbtwo (Prior) on Aug 05, 2002 at 01:19 UTC |