#! /usr/bin/perl $temp=$ENV{'QUERY_STRING'}; $test_path = "/var/www/html/test_file/"; # separate each keyword foreach ( split( /&/, $temp ) ) { # separate the keys and values ( $key, $val ) = split( /=/, $_, 2 ); # translate + to spaces $key=~s/\+/ /g; $val=~s/\+/ /g; # translate %xx codes to characters $key=~s/%([0-9a-f]{2})/pack("c",hex($1))/gie; $val=~s/%([0-9a-f]{2})/pack("c",hex($1))/gie; } $file = $test_path . $val; $out = $test_path . $key; open FH, ">out"; print FH "I am here"; close FH; open FH, "$val" or die "Can not open for read: $val"; my $pid = ; close FH; print $pid;