Ask a Question related to PERL Beginners, Design and Development.

  1. #1

    Default Matching String

    Hi again!

    Im saving some data of a configuration file in scalar var.

    My configuration file has something like this:

    mailaddr=mail1@yes.com
    replymailaddr=mail2@yes.com

    Im choosing them with a case statement:

    switch ($param) {
    case /mailaddr=/i { $envio_mail = $valor; }
    case /replymailaddr/i { $envio_reply = $valor; }
    }

    However Im finding a problem here, cause its stopping twice in replymailaddr.
    (I think that it sounds like mailaddr)

    So, how can I fix this?, that in each 'case statement' it will mix mailaddr
    with replymailaddr?

    Thanks!

    --
    Pablo Fischer Sandoval (pablo@pablo.com.mx)
    [url]http://www.pablo.com.mx[/url]
    [url]http://www.debianmexico.org[/url]
    GPG FingerTip: 3D49 4CB8 8951 F2CA 8131 AF7C D1B9 1FB9 6B11 810C
    Firma URL: [url]http://www.pablo.com.mx/firmagpg.txt[/url]
    Pablo Fischer Guest

  2. Similar Questions and Discussions

    1. Aprroximate string matching
      I am writing a script to check my newly ripped MP3 music in an INBOX to the stuff that I arleady have in the MUSIC directory. What I need is some...
    2. Reg. string matching using reg-exp
      Hi, I am a novice to perl programming. When I execute the following code, I get always "No Match". I guess my reg-exp is correct. I also tried...
    3. Pattern matching for xx-xx-xx string
      Hello, What is the syntax to make sure the user has entered this pattern in a web form: xx-xx-xx where x are integers, for example:...
    4. string matching
      I need to remove $b from $a $a = "abc/\def/ghi" ; $b = "abc/\def"; Regards Kamal
    5. String matching not working
      Hi, I am quite new to Perl. I have several sets of data and within each individual file news stories are seperated using ========. My goal is...
  3. #2

    Default Re: [solved] Matching String

    Again.. Solved.. duh

    case /^mailaddr/i, just add a ^ before the matched string.

    thanks!
    El día Sunday 24 August 2003 5:00 a Pablo Fischer mandó el siguiente correo:
    > Hi again!
    >
    > Im saving some data of a configuration file in scalar var.
    >
    > My configuration file has something like this:
    >
    > mailaddr=mail1@yes.com
    > replymailaddr=mail2@yes.com
    >
    > Im choosing them with a case statement:
    >
    > switch ($param) {
    > case /mailaddr=/i { $envio_mail = $valor; }
    > case /replymailaddr/i { $envio_reply = $valor; }
    > }
    >
    > However Im finding a problem here, cause its stopping twice in
    > replymailaddr. (I think that it sounds like mailaddr)
    >
    > So, how can I fix this?, that in each 'case statement' it will mix mailaddr
    > with replymailaddr?
    >
    > Thanks!
    >
    > --
    > Pablo Fischer Sandoval (pablo@pablo.com.mx)
    > [url]http://www.pablo.com.mx[/url]
    > [url]http://www.debianmexico.org[/url]
    > GPG FingerTip: 3D49 4CB8 8951 F2CA 8131 AF7C D1B9 1FB9 6B11 810C
    > Firma URL: [url]http://www.pablo.com.mx/firmagpg.txt[/url]
    --
    Pablo Fischer Sandoval (pablo@pablo.com.mx)
    [url]http://www.pablo.com.mx[/url]
    [url]http://www.debianmexico.org[/url]
    GPG FingerTip: 3D49 4CB8 8951 F2CA 8131 AF7C D1B9 1FB9 6B11 810C
    Firma URL: [url]http://www.pablo.com.mx/firmagpg.txt[/url]
    Pablo Fischer Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139