in reply to tie::file function
Using Tie::File:
#! perl use strict; use warnings; use Data::Dump; use Tie::File; my @array = ('x', 'y', 'z'); dd @array; tie @array, 'Tie::File', 'data.txt'; dd @array; untie @array; dd @array;
With file data.txt as follows:
AAA BBBBBB C DDDD
Output:
14:32 >perl 378_SoPW.pl ("x", "y", "z") ("AAA", "BBBBBB", "C", "DDDD") ("x", "y", "z") 14:32 >
So, @array neither retains the values of the file, nor does it fall empty. Rather, it resumes the values it had before the tie.
Hope that helps,
Athanasius <°(((>< contra mundum
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: tie::file function
by PriNet (Monk) on Nov 10, 2012 at 04:39 UTC | |
by AnomalousMonk (Archbishop) on Nov 10, 2012 at 05:04 UTC |
In Section
Seekers of Perl Wisdom