in reply to XML::XPath path creation problem

To clarify what I mean by "having to widen the scope of $response" Something like:

sub createPath { my $path = shift; my $response = 'n'; if ($xp->exists($path)) { print "Path already exists, overwrite element (N/Y): "; $response = <STDIN>; chomp($response); } print $response, "\n"; unless (lc($response) eq 'y') { print "Path creation call will be ignored\n"; return 0; } print "Creating node..."; }

Except even if 'y' is entered it never seems to execute the final print statement. Any guesses?