Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How is the . interpreted in this line? 1

Status
Not open for further replies.

calabama

Programmer
Feb 19, 2001
180
US
Hi, Does anybody know if the . inbetween $title & shtml is legal in this open line.

Thanks

open(FILE, "+> ../reflections/archive/$title.shtml "); In the begining
Let us first assume that there was nothing to begin with.
 
Only 'word' charaters (0-9a-zA-Z_), are valid characters in variable names so non-word characters are assumed to _not_ be part of the variable name. your open statement should work as you expect. If you are paranoid, or the variable is followed by a word character (such as $title_html) then you can surround the variable name with braces to disambiguate it.
Code:
open(FILE, &quot;+< ../reflections/archive/${title}.shtml &quot;);
And when you open a file for read and write, you have to use '+<' rather than '+>', otherwise you overwrite the file before you have a change to read from it (unless that's what you want to do).

jaa
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top