Tie a file handle to a variable

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Carlo Filippini

    Tie a file handle to a variable

    Hi
    how can I tie a file handle to a variable (probably tie is not
    the right perl terminology in this case)? Basically I want that
    everything that is written to a file is copied into a variable as
    well. Of course I could read the file again, something like

    while (<FH>){
    ....
    }

    but I need to chenge the variable dinamically.
    Is it possible somehow?

    Thanks
    Carlo
  • nobull@mail.com

    #2
    Re: Tie a file handle to a variable

    carlo.filippini @t-mobile.co.uk (Carlo Filippini) wrote in message news:<b0b268d8. 0309290249.2c39 ae19@posting.go ogle.com>...[color=blue]
    > how can I tie a file handle to a variable (probably tie is not
    > the right perl terminology in this case)? Basically I want that
    > everything that is written to a file is copied into a variable as
    > well.[/color]

    Sounds like you want IO::Tee and IO::Scalar

    Note that as of 5.8 functionality similar to that of IO::Scalar is now
    in the Perl core (perldoc -f open).

    This newsgroup does not exist (see FAQ). Please do not start threads
    here.

    Comment

    Working...