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

Passing Array Variables in PERL

Expand Messages
  • bigelectricmac
    I am a PERL beginner and I am writting a script that verifies server builds, and am having trouble passing a variable to a called function. I am creating an
    Message 1 of 332 , Mar 2, 2001
    • 0 Attachment
      I am a PERL beginner and I am writting a script
      that verifies server builds, and am having trouble
      passing a variable to a called function. I am creating an
      output file, and want to create a function to write a
      header that consists of two lines of asterisks with the
      server name between these two lines. Herein lies my
      problem... The server name is actually contained in an array
      in the caller. I can not figure out how to pass this
      variable to the "header" sub.<br>the sub is as
      follows:<br>sub header (@servernames[$A])<br>{<br>#Set the header
      for the file<br>for ($i = 0; $i < 80;
      $i++)<br>{<br>print QA_REPORT "*";<br>}<br>print "QA performing on
      \@servernames[$A] \n";<br>print QA_REPORT "\n\tQA Check for
      \@servernames[$A] run on \$rundate\n";<br>for ($i = 0; $i < 80;
      $i++)<br>{<br>print QA_REPORT "*";<br>}<br>}<br><br>and the
      invokation is as
      follows:<br><br>header(@servernames[$A]);<br><br>what prints in the file is the actual element of the
      array. Any ideas??? Any and all suggestions are welcome.
      Thanks.
    • royale_sojin
      ... and ... Hi locoswede, did you find out the answer to your question ? I would like to do the same too. I only have a pentium P200 and just successfully
      Message 332 of 332 , Jan 15, 2004
      • 0 Attachment
        --- In perlforbeginners@yahoogroups.com, locoswede wrote:
        > OK, so I'm trying to learn how to write
        > CGI-scripts with Perl but I'm on a Windows98-machine and I
        > can't get PWS configured correctly to run the scripts.
        > I put the scripts in the cgi-bin and it is set to
        > be able to both read, write and execute but still I
        > can't run my Perl-scripts. Can somebody PLEASE give me
        > a hand and explain to me how I configure PWS to run
        > CGI-scripts?<br>Oh, and please don't get on my case for using PWS
        and
        > Windows98 because I really don't have a choice at this
        > point...

        Hi locoswede, did you find out the answer to your question ? I would
        like to do the same too. I only have a pentium P200 and just
        successfully installed PWS on the windows98 se system. I want to run
        a intranet web server and learn CGI programming with it. Any ideas or
        tips or books I should be looking for...windows 98 is not supported
        but a friend told me he still uses it because it is safe from all
        the .net virus stuff of the new windows operatiing systems. I also
        want to learn ASP so for now I want to see how far PWS can take me
        before I install apache web server. Hope to hear from you soon.
      Your message has been successfully submitted and would be delivered to recipients shortly.