Results 1 to 4 of 4

Thread: Perl is driving me crazy!

  1. #1
    Mod.. with bite.. Croc Hunter's Avatar
    Join Date
    Sep 2002
    Location
    Australia
    Posts
    7,332
    Rep Power
    26

    Perl is driving me crazy!

    I have a javascript pop-up on a MoveableType site which I want to display comments in. My knowledge of Perl sucks!

    Here's a page: http://www.travisruse.com/archives/2...ss_train_u.php
    Clicking "comments (x)" pulls the pop-up window travisruse-talk.cgi then errors out.

    This is the entire travisruse-talk.cgi code: '<mt:Comments... is where it seems to fail.
    Code:
    #!/usr/bin/perl -w
    use strict;
    
    my($MT_DIR);
    BEGIN {
        if ($0 =~ m!(.*[/\\])!) {
            $MT_DIR = $1;
        } else {
            $MT_DIR = './';
        }
        unshift @INC, $MT_DIR . 'lib';
        unshift @INC, $MT_DIR . 'extlib';
    }
    
    eval {
        require MT::App::Comments;
        my $app = MT::App::Comments->new( Config => $MT_DIR . '<mt:Comments lastn="4">
            <$mt:CommentAuthor$> left a comment on
            <mt:CommentEntry><$mt:EntryTitle$></mt:CommentEntry>.
        </mt:Comments>' ,
                                          Directory => $MT_DIR )
            or die MT::App::Comments->errstr;
        local $SIG{__WARN__} = sub { $app->trace($_[0]) };
        $app->run;
    };
    if ($@) {
        print "Content-Type: text/html\n\n";
        print "An error occurred: $@";
    }
    CGI error log:
    Unsuccessful stat on filename containing newline at /home/users/web/xxxx/pow.user/htdocs/cgi-bin/lib/MT.pm line 785.

    MT.pm lines 780-785
    Code:
        for my $cfg_file ( $param->{Config},
            File::Spec->catfile( $param->{Directory}, 'mt-config.cgi' ),
            'mt-config.cgi' )
        {
            return $cfg_file if $cfg_file && -r $cfg_file && -f $cfg_file;
    ARRRRGGGGG!! I just wanna pull the comments into the pop-up window. Not many here seem to use MovableType Blah. Can one of you clever perl mongers please help?
    Croc Hunter MSC :

  2. #2
    Mod.. with bite.. Croc Hunter's Avatar
    Join Date
    Sep 2002
    Location
    Australia
    Posts
    7,332
    Rep Power
    26
    Need the mt-config.cgi?
    Code:
    ## Movable Type Configuration File
    ## This file defines system-wide settings for Movable Type. 
    
    #======== REQUIRED SETTINGS ==========
    
    CGIPath        /cgi-bin/
    StaticWebPath  /mt-static/
    StaticFilePath /home/users/web/xxxx/pow.username/htdocs/mt-static
    
    #======== DATABASE SETTINGS ==========
    
    ObjectDriver DBI::mysql
    Database [dbname]
    DBUser [dbuser]
    DBPassword [dbpass]
    DBHost [user].powwebmysql.com
    I [removed] sensitive info.
    Croc Hunter MSC :

  3. #3

    Join Date
    Mar 2005
    Location
    Hungary
    Posts
    68
    Rep Power
    13
    hi,

    just one idea, try to change

    Code:
    return $cfg_file if $cfg_file && -r $cfg_file && -f $cfg_file;
    into

    Code:
    chomp($cfg_file);
    return $cfg_file if $cfg_file && -r $cfg_file && -f $cfg_file;
    hope this helps.

  4. #4
    Mod.. with bite.. Croc Hunter's Avatar
    Join Date
    Sep 2002
    Location
    Australia
    Posts
    7,332
    Rep Power
    26
    Thanks strato, but that didn't fix.
    Croc Hunter MSC :

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •