http://qs1969.pair.com?node_id=652600


in reply to Filehandles vs Uninitialized Values in pattern match

'+<' is a better option. It will read the file as it normally would then leaves the file pointer at the end so you can append.

UpdateSidhekin is right in saying that +>> is clearer to read, however seek can be just as confusing if youve never dealt with it before.

Replies are listed 'Best First'.
Re^2: Filehandles vs Uninitialized Values in pattern match
by Sidhekin (Priest) on Nov 23, 2007 at 16:18 UTC

    '+<' is a better option

    +< is another option, to be sure, but better? +>> states your intentions to read and append. +< leaves it open whether or not you intend to overwrite any of the original contents.

    It would save you a seek, sure, but at a cost of clarity. TIMTOWTDI, indeed, but I think Flubb had the right idea.

    print "Just another Perl ${\(trickster and hacker)},"
    The Sidhekin proves Sidhe did it!