Tie a file handle to a variable

Discussion in 'Perl' started by Carlo Filippini, Sep 29, 2003.

  1. 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
     
    Carlo Filippini, Sep 29, 2003
    #1
    1. Advertising

  2. Carlo Filippini

    Guest

    (Carlo Filippini) wrote in message news:<>...
    > 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.


    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.
     
    , Oct 2, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jonathan Weekes

    Tie to change line in file

    Jonathan Weekes, Sep 14, 2003, in forum: Perl
    Replies:
    0
    Views:
    500
    Jonathan Weekes
    Sep 14, 2003
  2. Carlo Filippini

    Tie a file handle to a variable

    Carlo Filippini, Sep 29, 2003, in forum: Perl
    Replies:
    3
    Views:
    641
    Kris Wempa
    Oct 1, 2003
  3. Dietrich
    Replies:
    1
    Views:
    660
    Joe Smith
    Jul 22, 2004
  4. John

    Module Tie::Handle::Intercepted

    John, May 6, 2004, in forum: Perl Misc
    Replies:
    0
    Views:
    143
  5. botfood

    tie() with DB_File not tie()ing ?

    botfood, Apr 24, 2006, in forum: Perl Misc
    Replies:
    23
    Views:
    475
    botfood
    Apr 26, 2006
Loading...

Share This Page