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

[PBML] Help...

Expand Messages
  • Manolo.Marzan@icl.com
    ... I placed those backslashes ( ) in my parameter list because I want them as references. And inside those functions they are being manipulated. After the
    Message 1 of 1 , Aug 13, 1999
    • 0 Attachment
      > Hi,
      >
      > I am just new in Perl programming and I have this problem.. For
      > example:
      >
      > Currently I have a code like this:
      > Filename : "test"
      > Parameter that can be passed is a, b, c, etc....
      >
      > For ex:
      > $ test a
      >
      > and I have this code:
      >
      > If ($ARGV[0] eq "a") {
      > function_a(\$param1, \$param2, \$param3);
      > } elsif ($ARGV[0] eq "b") {
      > function_b(\$param1, \$param2, \$param3);
      > } elsif ($ARGV[0] eq "c") {
      > function_c(\$param1, \$param2, \$param3);
      > }
      >
      > As you can notice only the letters after the function_ is being
      > changed and I have a lot of lines. If only I can pass the $ARGV[0] to call
      > a function maybe it will look better.
      >
      I placed those backslashes (\) in my parameter list because I want
      them as references. And inside those functions they are being manipulated.
      After the function they will have a new values. I don't know if that's the
      right way to do it but currently it's working. If you have any suggestion on
      how will I do it better. Please respond...

      function_$ARGV[0](\$param1, \$param2, \$param3);

      this can already accommodate every parameter a user can type in just one
      line.

      Thanks for the help... and if you have not grasp what I mean on my
      example. Please mail me so that I can explain it further...

      Thanks in advance...

      MANOLO P. MARZAN
      ICL
      Wenlock Way
      West Gorton
      Manchester, UK
    Your message has been successfully submitted and would be delivered to recipients shortly.