One issue that you should be aware of is that when opening a filehandle, you must use or die: $!. Also, if $basepath and $basename are different variables, there is some wierd stuff that goes on. I guess what is happening in that snippet is that Perl is being confused by you using 2 variables in that syntax and instance of using open. I walked over to another machine and threw together a little sumpthin' sumpthin' and the only thing that worked for me is catenating $basepath and $basename. So,
open HTML, ">$basepath/$basename.html";
Should be:
$foo = "$basepath"."$basename.html"; open HTML, ">foo" or die "Can't open $foo: $!";
Also make sure that if $basename is a HTML file, that the *value* of the variable has a suffix of '.html'.
redmistIn reply to Re: open() destroying my vars?
by redmist
in thread open() destroying my vars?
by theorbtwo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |