in reply to Tie::File doesn't save

They are visible if i print all the array but when i untie it, records are not saved...

Also insure you are using the correct recsep for your filesystem.

On Windows, I needed:

use Fcntl 'O_RDWR'; use Tie::File; my $file = "./filename.ext"; tie (my @lines, 'Tie::File', $file, mode => O_RDWR,
recsep => "\n"
) or die "Can't update $file: $! "; shift @lines; (tied @lines)->flush; untie @lines;

for Strawberry Perl (This is perl, v5.10.0 built for MSWin32-x86-multi-thread).

While on the same system, using Cygwin Perl (This is perl, v5.10.1 (*) built for i686-cygwin-thread-multi-64int), this did the trick:

use Fcntl 'O_RDWR'; use Tie::File; my $file = "./filename.ext"; tie (my @lines, 'Tie::File', $file, mode => O_RDWR) or die "Can't upda +te $file: $! "; shift @lines; (tied @lines)->flush; untie @lines;

Both were operating on the same file, which file described as:

$ file filename.ext filename.ext: ASCII text

HTH,

planetscape