Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^3: String Buffer

by ambrus (Abbot)
on Aug 25, 2008 at 13:07 UTC ( #706683=note: print w/replies, xml ) Need Help??


in reply to Re^2: String Buffer
in thread String Buffer

In fact, that uses a perlio layer silently.

I've been wishing a perlio layer that allows you to simply open a stream that behaives like any tied handle eg.

use StringBuffer; use PerlIO::Tied; # Note: never close one of the three standard handles. It's almost alw +ays a bad idea. open OLDSTDOUT, ">&=STDOUT"; open STDOUT, ">:tied(StringBuffer)"; # I presume extra arguments to ti +e get passed as extra argument to open print STDOUT "this magically gets put to \$stdout\n"; open STDOUT, ">&=OLDSTDOUT"; print STDOUT "this gets put to the original standard output again\n";

This gets even more useful if you want to use a tied io handle from the command line eg. perl -MPerlIO::Tied -we 'some code' ':tied(SomeModule, arguments)'.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://706683]
help
Chatterbox?
[stevieb]: it is exceptionally difficult I'm finding to debug a dist that is x-platform, where on each platform you're wrapping a different binary. Trying to co-ordinate a successful test run where tests are extensive is a nightmare, especially when the dist...
[stevieb]: ...you're testing is a test system itself. 10+ documented issues fixed, another half dozen found while fixing the original ones. I'm getting there...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2017-03-28 21:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (342 votes). Check out past polls.