in reply to Re^3: how to create a perl program using filehandle and streams ?
in thread how to create a perl program using filehandle and streams ?

the following error occured

C:\strawberry\perl\bin>perl not.txt Precedence problem: open not should be open(not) at not.txt line 1. String found where operator expected at not.txt line 2, near "print FI +LEHANDLE " " (Might be a runaway multi-line "" string starting on line 1) (Missing semicolon on previous line?) Bareword found where operator expected at not.txt line 2, near "print +FILEHANDLE "hello" (Do you need to predeclare print?) syntax error at not.txt line 1, near "not." Can't find string terminator '"' anywhere before EOF at not.txt line 2 +.

Replies are listed 'Best First'.
Re^5: how to create a perl program using filehandle and streams ?
by cdarke (Prior) on Apr 01, 2011 at 10:05 UTC
    Hold on! It looks to me that your perl program is called "not.txt" and then you are opening the same file for write, which will trucate it to zero bytes! That's like sitting on the branch of a tree and sawing it off next to the trunk.

    Call your program something like "not.pl", otherwise you will loose your code.
    A reply falls below the community's threshold of quality. You may see it by logging in.