FAQ
Hello scripters,

I made a script (submit.plx), which records the visitor's details into a
text file and then another script (table.plx) that puts them into a table.
But I receive the error: File handle FH opened only for output at submit.plx
line 53. Here's my code:

open TXT, ">>contacts.txt" or die $!;
print <TXT>, @details;
close (TXT) or die $!;

It's exactly like on the manual. Any suggestions?

Search Discussions

  • Sudarsan Raghavan at Jun 12, 2002 at 9:20 am

    Yasen Petrov wrote:

    Hello scripters,

    I made a script (submit.plx), which records the visitor's details into a
    text file and then another script (table.plx) that puts them into a table.
    But I receive the error: File handle FH opened only for output at submit.plx
    line 53. Here's my code:

    open TXT, ">>contacts.txt" or die $!;
    print <TXT>, @details;
    This should be print TXT @details; #Remove the comma and '<' , '>' around TXT
    The statement as you have here is trying to read from the filehandle TXT which has
    been opened in append mode, thus the error.
    close (TXT) or die $!;

    It's exactly like on the manual. Any suggestions?

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupscripts @
categoriesperl
postedJun 12, '02 at 1:57a
activeJun 12, '02 at 9:20a
posts2
users2
websiteperl.org

2 users in discussion

Yasen Petrov: 1 post Sudarsan Raghavan: 1 post

People

Translate

site design / logo © 2021 Grokbase