Jump to content

Perl Programming/Keywords/truncate

From Wikibooks, open books for an open world

This is the current revision of this page, as edited by DannyS712 (discuss | contribs) at 06:55, 16 April 2020 (Update syntaxhighlight tags - remove use of deprecated <source> tags). The present address (URL) is a permanent link to this version.

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Previous: tr Keywords Next: uc

The truncate keyword

[edit | edit source]

truncate shortens the contents of the file that is opened on FILEHANDLE, or that is named by EXPRESSION, to the specified LENGTH. Raises an exception if truncate isn't implemented on your system and returns true if successful, undef on error.

Syntax

[edit | edit source]
 truncate FILEHANDLE, LENGTH  truncate EXPRESSION, LENGTH 
Previous: tr Keywords Next: uc