help with fetching the values from perlscript

Hi,

I have a perl script abc.pl..

#!/usr/bin/perl
 
    local ($buffer, @pairs, $pair, $name, $value, %FORM);
    # Read in text
    $ENV{'REQUEST_METHOD'} =~ tr/a-z/A-Z/;
    if ($ENV{'REQUEST_METHOD'} eq "POST")
    {
        read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
    }else {
        $buffer = $ENV{'QUERY_STRING'};
    }
    # Split information into name/value pairs
    @pairs = split(/&/, $buffer);
    foreach $pair (@pairs)
    {
        ($name, $value) = split(/=/, $pair);
        $value =~ tr/+/ /;
        $value =~ s/%(..)/pack("C", hex($1))/eg;
        $FORM{$name} = $value;
    }
    if( $FORM{Q1} ){
        $Q1_flag ="ON";
    }else{
        $Q1_flag ="OFF";
    }
    if( $FORM{Q2} ){
        $Q2_flag ="ON";
    }else{
        $Q2_flag ="OFF";
    }
 
    if( $FORM{Q3} ){
        $Q3_flag ="ON";
    }else{
        $Q3_flag ="OFF";
    }
 
    if( $FORM{Q4} ){
        $Q4_flag ="ON";
    }else{
        $Q4_flag ="OFF";
    }
 
    if( $FORM{Q5} ){
        $Q5_flag ="ON";
    }else{
        $Q5_flag ="OFF";
    }

This script has five variables(Q1_flag, Q2_flag,Q3_flag,Q4_flag and Q5_flag) whose value will be assigned from an html page.

Now I need help in writing a script which fetches the values of these variables and put them in one string(each answer seperated by ;)..
Any help is highly appreciated.

Thanks a ton in advance.

???

print "$Q1_flag;$Q2_flag;...\n"

hi yazu,

thanks for the reply.

I want to know how to write a script which refers to the existing abc.pl script and fetches the values of the variables assigned in abc.pl

Thanks again..

I want to know too... :slight_smile: