| michal.ostruszka@gmail.com 2005-10-10, 3:55 am |
| Hi,
I'm brand new in Perl, and I'd like to find out a few things about
Perl, but I haven't found answers yet.
So, I've script called let's say index.pl. It contains series of
conditions and under certain conditions it does "do('display.pl')".
And display.pl contains something like that:
display.pl:
-----------
print "<table border=0><tr><td>$category</td></tr>";
print ... # next few lines of html printing
And my first question is: Either this file should have standard perl
lines like #!/usr/bin/perl, use strict, etc, or can be used like it is
written. Next question, what about $category variable?Is it visible in
display.pl if I put "use strict" and "use vars qw($category)" in
index.pl?
Next thing
If i write library with some functions, and I use it in my script using
"require", should it also have #!/usr/bin/perl, use strict, use vars
etc, lines? And the same question about configuration files, for
example:
config.pl:
-----------
#!/usr/bin/perl
#is the line above necessary in such file???
$db="dbname";
$host="hostname";
$user="username";
$pass="password";
Thanks for all replies, I hope you'll help me to understand proper
style of writing perl scripts.
Greetings.
|