Is this the best perl code to match a string that can
only have letters, numbers,spaces,dash, forward slash, backslash, and pipe (|)?
#!/usr/bin/perl -w
$command=shift;
unless ($command=~ /^([-\w.\s\/\\\|]+)$/) {
print "Security error.\n";
exit (1);
}