in reply to problems with truncate function

What Anonymonk is saying is the || has a higher precedence than or so either write:-

truncate( $fh, 0 ) || die ...

or

truncate $fh, 0 or die ...

Your code is doing:-

truncate $fh, ( 0 || die ... )

which is not what you want!

Cheers,

JohnGG

Replies are listed 'Best First'.
Re^2: problems with truncate function
by david2008 (Scribe) on Jun 26, 2013 at 09:35 UTC
    This post made me perl wiser :-).
    The forum "Seekers of perl wisdom" is really appropriate.
    Thank you all,
    David