my $fn = make_filename($user); # or whatever $fn = '/path/to/default.jpg' unless -f $fn; print link_pic($fn);