in reply to open() destroying my vars?
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'.
redmist
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Re: open() destroying my vars?
by theorbtwo (Prior) on Jul 29, 2000 at 07:09 UTC | |
by redmist (Deacon) on Jul 29, 2000 at 09:15 UTC | |
|
RE: Re: open() destroying my vars?
by davorg (Chancellor) on Jul 30, 2000 at 15:48 UTC | |
|
RE: Re: open() destroying my vars?
by theorbtwo (Prior) on Jul 30, 2000 at 02:35 UTC |