in reply to Loop through array or filehandle

Hello markdibley,

Have a look at the documentation for PerlIO::scalar:

A filehandle is opened but the file operations are performed "in-memory" on a scalar variable. All the normal file operations can be performed on the handle. The scalar is considered a stream of bytes.

This will allow you to use your current subroutine as-is: just pass it a “filehandle” opened to point to the variable containing the string.

Hope that helps,

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,