in reply to Perl : Unable to use filehandle to open a file

If you want to add text to an existing file (that is, append new data at the end, rather than replacing all existing content), then the open statement should be like this -- and you should add error checking as well:
open HELLO, ">>file.text" or die "open failed: $!";
(note the two angle brackets instead of one)

As for the compilation error, you'd have to show us the actual text of the error message. If the message mentions a particular line number, you'd have to show us your code in such a way that we can tell what line that is. (Use "<code>" and "</code>" around the text of the script.)

Replies are listed 'Best First'.
Re^2: Perl : Unable to use filehandle to open a file
by koleti (Novice) on Nov 18, 2007 at 00:40 UTC
    hi,
    I am assuming that you want to open a file and print "HI" in that if that is the case
    do this way
    #!/usr/bin/perl
    open HELLO, ">file.txt";
    select HELLO;
    print HELLO "hi !";