in reply to Re: Streaming to Handles
in thread Streaming to Handles
and then in my script make reference to this variable 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; }
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.my $f = List->new; $f->look_in('c:/'); foreach ($f->list) { ##problem?? print "${$f->{file}}\n"; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Re: Streaming to Handles
by zentara (Cardinal) on May 05, 2004 at 13:27 UTC |