![]() |
|
laziness, impatience, and hubris | |
PerlMonks |
Re: Filehandles vs Uninitialized Values in pattern matchby naikonta (Curate) |
on Nov 23, 2007 at 16:35 UTC ( #652607=note: print w/replies, xml ) | Need Help?? |
The two subroutines in the code below achieve the same thing in different way. As others have pointed out, the mode +< (or O_RDWR with Fcntl module) is the one you need instead of +>> (the latter is still possible, just harder) for the first sub. The second sub uses Tie::File module that makes file operation is as simple as array operation.
The code (file locking is omitted intentionally):
The run:
Open source softwares? Share and enjoy. Make profit from them if you can. Yet, share and enjoy!
In Section
Seekers of Perl Wisdom
|
|