in reply to Newbie Question: Permission Denied

The error is just Permission denied, and you are getting it because you can't write to $fname or $fname doesn't exist and you can't create it.

Just debug the problem a little further by inserting these statements before the call to open():

die "file '$fname' does not exist" unless (-e $fname); die "file '$fname' is not a regular file" unless (-f $fname); die "file '$fname' is not writable" unless (-w $fname);
That should tell you what's wrong.