#!/usr/bin/perl -w sub trace { print join(' ', map { defined($_) ? $_ : '#undef#' } @_), "\n"; } my $val; trace('Before first chunk, value is', $val); $val='foobar'; trace('Before second chunk, value is', $val); $val=7.3; trace('Final value is', $val); #### roboticus@swill $ ./foo.pl Before first chunk, value is #undef# Before second chunk, value is foobar Final value is 7.3