Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: How do you open a file when using strict?

by smalhotra (Scribe)
on Aug 05, 2002 at 01:48 UTC ( [id://187571]=note: print w/replies, xml ) Need Help??


in reply to How do you open a file when using strict?

Not to force my own style on others but ... I would suggest using the FileHandle module:
use FileHandle; my $fh_header = new FileHandle; $fh_header->open("header.html") or die("Cannot open file: $!\n"); print $fh "stuff ..."; my $fh_footer = new FileHandle; $fh_footer->open("footer.html") or die("Cannot open file: $!\n");
I have also started using the q() and qq() quotation methods instead of here docs. I feel they're slightly easier to handle.
print qq( < 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'} );
Hope this helps.
----------------------------
$will->code for @food or $$;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://187571]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-04-25 21:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found