Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Hello all,

I'm using strict; with a basic email program. I have some html code (in my main perl script) that prints out a form that a user fills out. I have also created a config file that creates an array called @fields. So for each element in @fields I want to print out:

<input type="text" name="$fields[0]" size="24">

and so ...

However when I use strict; I get the following error:

Global symbol "@fields" requires explicit package name at /Library/Web +Server/CGI-Executables/mailto/mailto.cgi line 106.

The error line corresponds to:

print<<HTML;

but it obviously has a problem with the my @fields reference.

How can I use strict; and also use a separate config file? I want the config file so that my scripts can be portable. Is it a bad idea to use config file? If not then how can I make them work under strict;

thanks in advance.

Edited 2001-11-11 by Ovid


In reply to using strict and a config file by lex2001

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

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

    No recent polls found