weird matching problems

Discussion in 'Perl' started by Eric A. Hall, Jul 24, 2003.

  1. Eric A. Hall

    Eric A. Hall Guest

    I'm trying to scratch up a whois-like client in perl, and am having a
    strange problem with matching input characters. Specifically, matching
    against things like "@" works fine over the network, but when the
    application is called locally, the matching does not work.

    Here's a snippet:

    #
    # if resource-type was not specified, detect from resource name
    #
    if ($resType eq "" ) {

    if ($queryInput =~ /@/) {
    $resType = "contact";
    print ( "[Warning: Resource type not specified, ",
    "detected as $resType.]\n");
    }

    The "@" matches perfectly when calling the application over the
    network, but it falls into the else{} trap at the end when calling
    locally. I've tried various escapes and such, but no luck. This
    happens on two different linux flavors and solaris 9, so I'm assuming
    there's something I'm missing.

    Does this have anything to do with locale (set to "C" usually) or
    charset (usually not set, but sometimes ISO-8859-1)? I didn't have
    this problem earlier with the script.

    Thanks
     
    Eric A. Hall, Jul 24, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. dorayme
    Replies:
    1
    Views:
    649
    richard
    Jan 21, 2011
  2. Andrew Berg

    Weird problem matching with REs

    Andrew Berg, May 29, 2011, in forum: Python
    Replies:
    11
    Views:
    386
    Thomas 'PointedEars' Lahn
    May 29, 2011
  3. Marc Bissonnette

    Pattern matching : not matching problem

    Marc Bissonnette, Jan 8, 2004, in forum: Perl Misc
    Replies:
    9
    Views:
    260
    Marc Bissonnette
    Jan 13, 2004
  4. Bobby Chamness
    Replies:
    2
    Views:
    262
    Xicheng Jia
    May 3, 2007
  5. Replies:
    4
    Views:
    106
Loading...

Share This Page