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