#!/usr.bin/perl -l BEGIN { $| = 1; $^W = 1; } use strict; use autodie; use warnings; my $file = "file.txt"; 1 while unlink $file; use Tie::File; my $o = tie my @lines, 'Tie::Tile', $file, memory => 0; for (@lines) { $lines[2] = "something else is here now'; print $lines[2]; #line 3 is now "something else is here now". } END { undef $o; untie @lines; 1 while unlink $file; #clears and empties everything. }
In reply to Re: what is the purpose of Tie::File
by Khen1950fx
in thread what is the purpose of Tie::File
by Lotus1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |