Next Lightweight Databases 11

Using -i inside a program

        sub delete_user {
          my ($file, $target_user) = @_;
          local $^I = ".bak";
          local @ARGV = ($file);
          while (<>) {
            my ($user) = split /:/;
            print unless $user eq $target_user;
          }
        }


Next Copyright © 2003 M. J. Dominus