ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/ActiveDoc/Activate.pm
(Generate patch)

Comparing COMP/SCRAM/src/ActiveDoc/Activate.pm (file contents):
Revision 1.2 by williamc, Mon Aug 28 07:43:20 2000 UTC vs.
Revision 1.3 by williamc, Tue Nov 14 15:19:42 2000 UTC

# Line 43 | Line 43 | sub get {
43          $self->verbose("Attempt to get $url");
44          my $file;
45          # We dont want it messaging
46 <        if ( eval { $file=$self->{ad}->getfile($url)->ProcessedFile() } ) {
47 <          return ($file, $@);
46 >        require FileHandle;
47 >        local (*FHOLD);
48 >        local (*FHOLDERR);
49 >        # - copy STDERR and STDOUT
50 >        open(FHOLD,">&STDOUT");
51 >        open(FHOLDERR,">&STDERR");
52 >
53 >        # - redirect STDERR and STDOUT
54 >        my $rfile="/tmp/$$";
55 >        $self->verbose("Redirecting STDOUT to $rfile");
56 >        open(STDOUT, ">".$rfile) || die "Unable to open $!\n";
57 >        open(STDERR, ">&STDOUT") || die "Unable to open $!\n";
58 >
59 >        # -- call
60 >        my @rv=();
61 >        eval { $file=$self->{ad}->getfile($url)->ProcessedFile() };
62 >        if ( (! defined $file) || ($file eq "") ) {
63 >          push @rv, (undef,$rfile);
64          }
65          else {
66 <          return (undef, $@);
66 >          push @rv, ($file,$rfile);
67          }
68 +        close STDOUT;
69 +        close STDERR;
70 +
71 +        # -- restore STDOUT & STDERR
72 +        open(STDOUT, ">&FHOLD");
73 +        open(STDERR, ">&FHOLDERR");
74 +        close FHOLD;
75 +        close FHOLDERR;
76 +
77 +        $self->verbose("Redirection Finnished of STDOUT");
78 +        return (@rv);
79   }
80  
81   sub activatedoc {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines