Next Lightweight Databases 53

Tie::File Examples

How do I change one line in a file?

        tie @LINE, 'Tie::File', 'my_file.txt' or die ...;
        for (@LINE) {
          if (/not a text editor/) {
            s/not/now/;
            last;
          }
        }


Next Copyright © 2003 M. J. Dominus