MiniVend Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

Gloabl sub only working with debug on?




  I am having a probelm with getting the output of a open3 command.  I
seem to only actually get the output when minivend is run in it's debug
mode.  I append many different things to $output as I go through the sub,
to check that I'm doing what I'm thinking I'm doing.  But when minivend is
run normally, I only get the output from my check assignments.  I never
seem to get the output of my open3 program.  This program works as a stand
alone perl program.

  Does anyone have any ideas?  I'm desperate, as we'd like to go online
within 24 hours.

  Thanks,
   -Nick

-----Begin Global Sub-----
GlobalSub <<EndOfSub
sub pgp_encrypt {
  use FileHandle;
  use IPC::Open3;

  my($input) = @_;
  my($line, $output, $read, $write, $err);

  $read = new FileHandle;
  $write = new FileHandle;
  $err = new FileHandle;

  $output = "p3";

  open3($write, $read, $err, "/usr/bin/pgp -feat user") ||
        ($output = "Couldn't open pgp: $!\n");
  print $write "$input\n";
  close($write);

  while(defined($line = <$read>)) {
    $output .= "1" . $line;
  }
  close($read);

  while (defined($line = <$err>)) {
    $output .= "2" . $line;
  }
  close($err);

  $output .= "3" . "4";
  return $output . "l";
}
EndOfSub
----End Global Sub-----

  Again, if I run minivend normally I only get 'p334l' as output, and I
never get the output of the pgp program.
   
  If I run minivend in debug mode, then I get the proper output of the pgp
program as well.


-- 

"Laughter is the closest distance between two people."
                -- Victor Borge




Search for: Match: Format: Sort by: