Perl: unable to use "select" with filehandle

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nehaz
    New Member
    • Nov 2007
    • 2

    Perl: unable to use "select" with filehandle

    i wanted to open a file using perl and the output of print cmd to be added in that file. can i do it using perl ?

    what if i use following the following ".pl " file.
    [CODE=perl]open CONFIG, ">HELLO.txt ";
    select CONFIG;
    print "suceeded";[/CODE]
    when i execute the above file, i get compilation error.
    Can anybody tell me wht is the error in this script.
    Last edited by eWish; Nov 17 '07, 06:17 PM. Reason: Added Code Tags
  • KevinADC
    Recognized Expert Specialist
    • Jan 2007
    • 4092

    #2
    Originally posted by nehaz
    i wanted to open a file using perl and the output of print cmd to be added in that file. can i do it using perl ?

    what if i use following the following ".pl " file.
    [CODE=perl]open CONFIG, ">HELLO.txt ";
    select CONFIG;
    print "suceeded";[/CODE]
    when i execute the above file, i get compilation error.
    Can anybody tell me wht is the error in this script.
    is that all of the code? There is no error in the code above. Do you need to include the shebang line?

    Comment

    Working...