in reply to Using the P4 module through Apache

Can you please post your code snippet so that we can see what is wrong?

Some pointers will be helpful

1. are you running mod_perl (version)?

2. Does the apache have write permission on the directory you are using?

3. If you use open (something) or die ; what do you get in your apache error log?

cheers

SK

Replies are listed 'Best First'.
Re^2: Using the P4 module through Apache
by fatherlyons (Initiate) on Jun 30, 2005 at 14:09 UTC
    OK, heres my bit of code. I don't think it's anything to do with write access to the text file as the script successfully prints "Test" to the file. However, for some reason it does not print the contents of the @info array..
    use P4; open OUTFILE, ">.\\Testing.txt"; my $p4 = new P4; $p4->SetClient( "my-client" ); $p4->SetPort ( "Perforce01:xxxx" ); $p4->SetPassword( "my-password" ); $p4->Init() or die( "Failed to connect to Perforce Server" ); $p4->Login(); my $command = "describe"; my @options; push @options, "-s", "577536"; my @info = $p4->Run( $command, @options ); my @errors = $p4->Errors(); $p4->Disconnect(); foreach my $line (@info) { print OUTFILE $line; } print OUTFILE "Test"; close OUTFILE;
      I am not familiar with P4 module but here are some "have you tried(s)" -

      1. I see you are getting results into errors array but dont' check if there are errors. Can you check the length of this array?

      2. Is it possible that @info does not contain any elements?

      3. Can you print the resuls to the browser instead of text file so that you can verify the problem is not with Apache?

      cheers

      SK