Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
I still haven't found a great solution to this problem. Forking to me seems overly complicated implementation and doesn't create a simple interface for users.

This solution suggested above to me seems the closest to what I can imagine. But two things: In this example your print to the FILEHANDLE and the bound variable are in the same program. I've attempted to seperate them into a script and a seperate module method but was unsuccessful. Are you able to demonstrate the above in this way. That would be really helpful.

Secondly I had another thought along similar lines: I could create a object variable in my object like this:
# object interface sub new { my ($class, $stream, $path, ) = @_; my $file = undef; $path = cwd unless @_ > 2; my $self = { file => \$file, path => File::Spec->canonpath($path), }; bless $self, $class; return $self; }
and then in my script make reference to this variable like this:
my $f = List->new; $f->look_in('c:/'); foreach ($f->list) { ##problem?? print "${$f->{file}}\n"; }
Now I know straight up just looking at it that this code won't work in the foreach statement but is anyone getting the gist of what I'm attempting. In my program you can instantly dereference this $f->{file} at any time to access the file name it is currently working on. But how does the script know when this piece of memory changes value to rewrite it? Do you just call it in a "while" loop. Hmmmm ... the idea has merit but I'm not sure how to implement this.

Surely there must be a way to stream ... how is it done? Somebody .. anybody ... are you out there hearing my cries for help? How do you do this? There is a way, I just need to know how!

Dean
The Funkster of Mirth
Programming these days takes more than a lone avenger with a compiler. - sam
RFC1149: A Standard for the Transmission of IP Datagrams on Avian Carriers

In reply to Re: Re: Streaming to Handles by crabbdean
in thread Streaming to Handles by crabbdean

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others imbibing at the Monastery: (5)
    As of 2014-11-28 04:28 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      My preferred Perl binaries come from:














      Results (193 votes), past polls