- Perl Basics
- Perl - Home
- Perl - Introduction
- Perl - Environment
- Perl - Syntax Overview
- Perl - Data Types
- Perl - Variables
- Perl - Scalars
- Perl - Arrays
- Perl - Hashes
- Perl - IF...ELSE
- Perl - Loops
- Perl - Operators
- Perl - Date & Time
- Perl - Subroutines
- Perl - References
- Perl - Formats
- Perl - File I/O
- Perl - Directories
- Perl - Error Handling
- Perl - Special Variables
- Perl - Coding Standard
- Perl - Regular Expressions
- Perl - Sending Email
- Perl Advanced
- Perl - Socket Programming
- Perl - Object Oriented
- Perl - Database Access
- Perl - CGI Programming
- Perl - Packages & Modules
- Perl - Process Management
- Perl - Embedded Documentation
- Perl - Functions References
- Perl Useful Resources
- Perl - Questions and Answers
- Perl - Quick Guide
- Perl - Useful Resources
- Perl - Discussion
Perl sysseek Function
Description
This function sets the position within FILEHANDLE according to the values of POSITION and WHENCE.
This is equivalent of the C function lseek( ), so you should avoid using it with buffered forms of FILEHANDLE. This includes the "FILEHANDLE" notation and print, write, seek, and tell. Using it with sysread or syswrite is OK, since they too ignore buffering.
The position within the file is specified by POSITION, using the value of WHENCE as a reference point, as shown below in Table.
EEK_SET -> 0 Sets the new position absolutely to POSITION bytes within the file SEEK_CUR -> 1 Sets the new position to the current position plus POSITION bytes within the file SEEK_END -> 2 Sets the new position to POSITION bytes, relative to the end of the file
Syntax
Following is the simple syntax for this function −
sysseek FILEHANDLE,POSITION,WHENCE
Return Value
This function returns undef on failure, a position of 0 is returned as the string 0 but true and Integer, new position (in bytes) on success.
perl_function_references.htm
Advertisements