Please see correction, below: At 13:14:50, on 07.10.03: Cracks in my tinfoil beanie allowed deb to seep these bits into my brain:, > Try this (untested): > #The variable $fh is not a filehandlie - you need to assign that: > > my $fh = "somefile"; > This line isn't quite right: > open (FILE, ">$fh test") || die $!; # Open file for writing
Should probably be, open (FILE, ">$fh") || die $!; # Open file for writing > while (<FILE>) { > print FILE "Hello\n"; > } > close (FILE); > > Some would say you don't need to do the close. Some say you do. I usually do > explicitly, to be consistant. I've seen a couple of other posted answers to your question, which contradict what I thought was true - the variable $fh CAN be a filehandle. I haven't used that particular construct before. Always learning something new!!! d -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]