in reply to Re: Benchmark comparison of Text::xSV and Text::CSV_XS
in thread Benchmark comparison of Text::xSV and Text::CSV_XS

.. Or just open a scalarref, assuming a newish perl (5.8+ I believe) ..
my $content = ''; open($fh, '<', \$content) ..
C.

Replies are listed 'Best First'.
Re^3: Benchmark comparison of Text::xSV and Text::CSV_XS
by diotalevi (Canon) on Dec 09, 2004 at 14:58 UTC

    I'd like to note that the open ..., "<", \ EXPR syntax is a shortcut for open ..., "<:scalar", \ EXPR. I found out once that if you specify any sort of PerlIO layer in the open-type format, you also have to explicitly use the long form otherwise you end up attempting to work with a file named "SCALAR(0x....)" instead of an in-memory file.

    # Ok open ..., "<", \ $content open ..., "<:scalar", \ $content open ..., "<:scalar:crlf", \ $content # Not ok open ..., "<:crlf", \ $content