darkreaper00
Technical User
I've got myself a program that parses another program's output and formats it in a way that is useful to our lab. The biggest hangup I have with the program is trying to get it to print my usage message when /? is used for an argument. Below is the first way I tried to do that, before I realized that / was not a metacharacter that gets escaped with a backslash (which, incidentally, will behave the way i want it to if i feed it '\?', which is something I don't understand but is irrelevant at the moment):
since then I've tried:
, with $e being the string '/?'
and many others... I understand why putting / between // could be problematic, and I think my next route would be to try unicode names, but I'm inclined to think there must be an easier way to do this. Any thoughts?
Thanks,
Tony
Code:
while ($ARGV[0] ne "") {
# code for arguments it does
# know how to handle
}
elsif ($ARGV[0] =~ /^\/\?/) {
die($usage);
}
since then I've tried:
Code:
($ARGV[0] =~ /^'/'\?/)
($ARGV[0] =~ /(^'/'\?)/)
($ARGV[0] =~ /^/+\?/)
($ARGV[0] =~ /^$e/)
and many others... I understand why putting / between // could be problematic, and I think my next route would be to try unicode names, but I'm inclined to think there must be an easier way to do this. Any thoughts?
Thanks,
Tony