use File::Watch; my $w = File::Watch->new( file => '/var/run/foo', open = sub { use YAML; return LoadFile( $_->[0] ) } }; my $data = $w->get; while( 1 ) { # uses the same $data forever do_something( $data ); sleep 10; } while( 1 ) { # may the same $data forever, unless /var/run/foo changes # during the process's lifetime do_something( $w->get ); sleep 10; }