diff -r 000000000000 -r 42188c7ea2d9 Orb/Doxygen/DITA/plugins/apiref/sample/read.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Orb/Doxygen/DITA/plugins/apiref/sample/read.dita Thu Jan 21 17:29:01 2010 +0000 @@ -0,0 +1,63 @@ + + + +read +Read the specified quantity of data from a file into a variable. + + +read FILEHANDLE, SCALAR, LENGTH, OFFSET +read FILEHANDLE, SCALAR, LENGTH + +FILEHANDLE +The identifier for the file from which the data is read. + + +SCALAR +The name of the variable where the data is stored after reading. + + +LENGTH +The number of characters of data to read. + + +OFFSET +The number of characters from the start of the file prior to the +data to be read. + + +The read function returns the number +of characters actually read, 0 at end of file, or undef if there was an error +(in the latter case $! is also set). The SCALAR variable +will be grown or shrunk so that the last character actually read is the last +character of the scalar after the read.

An OFFSET may +be specified to place the read data at some place in the string other than +the beginning. A negative OFFSET specifies placement +at that many characters counting backwards from the end of the string. A positive OFFSET greater +than the length of SCALAR results in the string being +padded to the required size with "\0" bytes before the result of the read +is appended.

+
+ +INPUT_RECORD_SEPARATOR +Defines what a line is. + + +$INPUT_RECORD_SEPARATOR +$RS +$/ + +The input record separator defines what a line is (newline +by default). The input record separator treats empty lines as a terminator +if set to the null string. An empty line cannot contain any spaces or tabs. +You may set it to a multi-character string to match a multi-character terminator, +or to undef to read through the end of file.

Setting it to "\n\n" means +something slightly different than setting to "", if the file contains consecutive +empty lines. Setting to "" will treat two or more consecutive empty lines +as a single empty line. Setting to "\n\n" will blindly assume that the next +input character belongs to the next paragraph, even if it's a newline. (Mnemonic: +/ delimits line boundaries when quoting poetry.)

+
+
+