C:\bb\ko-win-x86-r\ide-6.1\build\release\dbgp\perl\contrib\IO-stringy\blib/lib/DB/IO/ScalarArray.pm


Construction

new [ARGS...]

Class method. Return a new, unattached array handle. If any arguments are given, they're sent to open().

open [ARRAYREF]

Instance method. Open the array handle on a new array, pointed to by ARRAYREF. If no ARRAYREF is given, a "private" array is created to hold the file data.

Returns the self object on success, undefined on error.

opened

Instance method. Is the array handle opened on something?

close

Instance method. Disassociate the array handle from its underlying array. Done automatically on destroy.

Input and output

flush

Instance method. No-op, provided for OO compatibility.

getc

Instance method. Return the next character, or undef if none remain. This does a read(1), which is somewhat costly.

getline

Instance method. Return the next line, or undef on end of data. Can safely be called in an array context. Currently, lines are delimited by "\n".

getlines

Instance method. Get all remaining lines. It will croak() if accidentally called in a scalar context.

print ARGS...

Instance method. Print ARGS to the underlying array.

Currently, this always causes a "seek to the end of the array" and generates a new array entry. This may change in the future.

read BUF, NBYTES, [OFFSET];

Instance method. Read some bytes from the array. Returns the number of bytes actually read, 0 on end-of-file, undef on error.

write BUF, NBYTES, [OFFSET];

Instance method. Write some bytes into the array.

Seeking/telling and other attributes

autoflush

Instance method. No-op, provided for OO compatibility.

binmode

Instance method. No-op, provided for OO compatibility.

clearerr

Instance method. Clear the error and EOF flags. A no-op.

eof

Instance method. Are we at end of file?

seek POS,WHENCE

Instance method. Seek to a given position in the stream. Only a WHENCE of 0 (SEEK_SET) is supported.

tell

Instance method. Return the current position in the stream, as a numeric offset.

setpos POS

Instance method. Seek to a given position in the array, using the opaque getpos() value. Don't expect this to be a number.

getpos

Instance method. Return the current position in the array, as an opaque value. Don't expect this to be a number.

aref

Instance method. Return a reference to the underlying array.