{
    "mode": "perldoc",
    "parameter": "Test::Builder::IO::Scalar",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Test%3A%3ABuilder%3A%3AIO%3A%3AScalar/json",
    "generated": "2026-06-15T10:42:50Z",
    "sections": {
        "NAME": {
            "content": "Test::Builder::IO::Scalar - A copy of IO::Scalar for Test::Builder\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This is a copy of IO::Scalar which ships with Test::Builder to support scalar references as\nfilehandles on Perl 5.6. Newer versions of Perl simply use \"open()\"'s built in support.\n\nTest::Builder can not have dependencies on other modules without careful consideration, so its\nsimply been copied into the distribution.\n\nCOPYRIGHT and LICENSE\nThis file came from the \"IO-stringy\" Perl5 toolkit.\n\nCopyright (c) 1996 by Eryq. All rights reserved. Copyright (c) 1999,2001 by ZeeGee Software Inc.\nAll rights reserved.\n\nThis program is free software; you can redistribute it and/or modify it under the same terms as\nPerl itself.\n",
            "subsections": [
                {
                    "name": "Construction",
                    "content": "new [ARGS...]\n*Class method.* Return a new, unattached scalar handle. If any arguments are given, they're\nsent to open().\n\nopen [SCALARREF]\n*Instance method.* Open the scalar handle on a new scalar, pointed to by SCALARREF. If no\nSCALARREF is given, a \"private\" scalar is created to hold the file data.\n\nReturns the self object on success, undefined on error.\n\nopened\n*Instance method.* Is the scalar handle opened on something?\n\nclose\n*Instance method.* Disassociate the scalar handle from its underlying scalar. Done\nautomatically on destroy.\n"
                },
                {
                    "name": "Input and output",
                    "content": "flush\n*Instance method.* No-op, provided for OO compatibility.\n\ngetc\n*Instance method.* Return the next character, or undef if none remain.\n\ngetline\n*Instance method.* Return the next line, or undef on end of string. Can safely be called in\nan array context. Currently, lines are delimited by \"\\n\".\n\ngetlines\n*Instance method.* Get all remaining lines. It will croak() if accidentally called in a\nscalar context.\n\nprint ARGS...\n*Instance method.* Print ARGS to the underlying scalar.\n\nWarning: this continues to always cause a seek to the end of the string, but if you perform\nseek()s and tell()s, it is still safer to explicitly seek-to-end before subsequent print()s.\n\nread BUF, NBYTES, [OFFSET]\n*Instance method.* Read some bytes from the scalar. Returns the number of bytes actually\nread, 0 on end-of-file, undef on error.\n\nwrite BUF, NBYTES, [OFFSET]\n*Instance method.* Write some bytes to the scalar.\n\nsysread BUF, LEN, [OFFSET]\n*Instance method.* Read some bytes from the scalar. Returns the number of bytes actually\nread, 0 on end-of-file, undef on error.\n\nsyswrite BUF, NBYTES, [OFFSET]\n*Instance method.* Write some bytes to the scalar.\n\nSeeking/telling and other attributes\nautoflush\n*Instance method.* No-op, provided for OO compatibility.\n\nbinmode\n*Instance method.* No-op, provided for OO compatibility.\n\nclearerr\n*Instance method.* Clear the error and EOF flags. A no-op.\n\neof *Instance method.* Are we at end of file?\n\nseek OFFSET, WHENCE\n*Instance method.* Seek to a given position in the stream.\n\nsysseek OFFSET, WHENCE\n*Instance method.* Identical to \"seek OFFSET, WHENCE\", *q.v.*\n\ntell\n*Instance method.* Return the current position in the stream, as a numeric offset.\n\nuseRS [YESNO]\n*Instance method.* Deprecated and ignored. Obey the current setting of $/, like IO::Handle\ndoes? Default is false in 1.x, but cold-welded true in 2.x and later.\n\nsetpos POS\n*Instance method.* Set the current position, using the opaque value returned by \"getpos()\".\n\ngetpos\n*Instance method.* Return the current position in the string, as an opaque object.\n\nsref\n*Instance method.* Return a reference to the underlying scalar.\n"
                }
            ]
        },
        "WARNINGS": {
            "content": "Perl's TIEHANDLE spec was incomplete prior to 5.00557; it was missing support for \"seek()\",\n\"tell()\", and \"eof()\". Attempting to use these functions with an IO::Scalar will not work prior\nto 5.00557. IO::Scalar will not have the relevant methods invoked; and even worse, this kind of\nbug can lie dormant for a while. If you turn warnings on (via $^W or \"perl -w\"), and you see\nsomething like this...\n\nattempt to seek on unopened filehandle\n\n...then you are probably trying to use one of these functions on an IO::Scalar with an old Perl.\nThe remedy is to simply use the OO version; e.g.:\n\n$SH->seek(0,0);    ### GOOD: will work on any 5.005\nseek($SH,0,0);     ### WARNING: will only work on 5.00557 and beyond\n",
            "subsections": []
        },
        "VERSION": {
            "content": "$Id: Scalar.pm,v 1.6 2005/02/10 21:21:53 dfs Exp $\n",
            "subsections": []
        },
        "AUTHORS": {
            "content": "",
            "subsections": [
                {
                    "name": "Primary Maintainer",
                    "content": "David F. Skoll (dfs@roaringpenguin.com).\n"
                },
                {
                    "name": "Principal author",
                    "content": "Eryq (eryq@zeegee.com). President, ZeeGee Software Inc (http://www.zeegee.com).\n"
                },
                {
                    "name": "Other contributors",
                    "content": "The full set of contributors always includes the folks mentioned in \"CHANGE LOG\" in IO::Stringy.\nBut just the same, special thanks to the following individuals for their invaluable\ncontributions (if I've forgotten or misspelled your name, please email me!):\n\n*Andy Glew,* for contributing \"getc()\".\n\n*Brandon Browning,* for suggesting \"opened()\".\n\n*David Richter,* for finding and fixing the bug in \"PRINTF()\".\n\n*Eric L. Brine,* for his offset-using read() and write() implementations.\n\n*Richard Jones,* for his patches to massively improve the performance of \"getline()\" and add\n\"sysread\" and \"syswrite\".\n\n*B. K. Oxley (binkley),* for stringification and inheritance improvements, and sundry good\nideas.\n\n*Doug Wilson,* for the IO::Handle inheritance and automatic tie-ing.\n"
                }
            ]
        },
        "SEE ALSO": {
            "content": "IO::String, which is quite similar but which was designed more-recently and with an\nIO::Handle-like interface in mind, so you could mix OO- and native-filehandle usage without\nusing tied().\n\n*Note:* as of version 2.x, these classes all work like their IO::Handle counterparts, so we have\ncomparable functionality to IO::String.\n",
            "subsections": []
        }
    },
    "summary": "Test::Builder::IO::Scalar - A copy of IO::Scalar for Test::Builder",
    "flags": [],
    "examples": [],
    "see_also": []
}