Loading ...
Sorry, an error occurred while loading the content.

Re: [PBML] Postcode

Expand Messages
  • Mike Southern
    ... You define them to be whatever you want them to be. They are your subroutines. This code says if the value of $format is ns then use the subroutine
    Message 1 of 14 , May 1, 2005
    • 0 Attachment
      At 5/1/2005, you wrote:
      >Sorry yeh i knew about "elsif" part, I forgot to change that.
      >
      >About the "ns" and "sp" part, how can i define them?
      >
      >do you mean just put ns = no space and sp = space sort of thing?
      >

      You define them to be whatever you want them to be. They are your subroutines.

      This code says if the value of $format is "ns" then use the subroutine
      called "ns" to process the variable called $postcode and store the results
      in the variable called $postcodens. Then print $postcodens.

      1: elseif ($format eq "ns") {
      2: my $postcodens = ns ("$postcode");
      3: print "$postcodens\n";
      4: }

      So if your subroutine was like this:

      sub ns {
      (my $t)=@_;
      $t = "fish";
      return $t;
      }

      Then your code would print "fish" at line 4.

      I have no clue why you would want to do that, but that's why your code is
      not working. You do not have a subroutine called "ns" or "sp".

      I am also not clear what it is you are trying to achieve in your postcode
      validator, therefore cannot tell what you want those subroutines to do.



      >Mike Southern <gb1198@...> wrote:
      >Because the subroutines "ns" and "sp" appear to be undefined.
    Your message has been successfully submitted and would be delivered to recipients shortly.