Help for this page
package File::With::State; use strict; ... # Note: this simple example is not thread-safe and also # needs a destructor to avoid leaking memory
my $fh = File::With::State->new( 'some_file' ); my @lines = <$fh>; $fh->stash( line_count => scalar @lines );