stonecolddevin has asked for the wisdom of the Perl Monks concerning the following question:

Hey all,

Awfully tired, so apologies for the unclarity of this post.

I'm just starting to use CGI::Application::PhotoGallery to create a small photo gallery of puppies for my parents. I went by the docs and used the code posted on my pad below, but the page is displaying nothing.

(code follows)
#!perl -w use strict; use CGI::Application::PhotoGallery; my $webapp = CGI::Application::PhotoGallery->new( PARAMS => { photos_dir => 'C:/BigApache/apache/htdocs/puppy_love/photo +s', title => 'Austin Shelties', script_name => $0 } ); $webapp->run();


Any thoughts?
meh.

Replies are listed 'Best First'.
Re: new to CGI::Application
by castaway (Parson) on Dec 06, 2004 at 08:11 UTC
    Hi dhoss,
    Looking at the source of that module, it appears that the directory you give it needs to contain sub-directories, that contain the pictures. (It does a loop through the contents of the directory, picking out dirs, and checking for pictures in them)

    You might want to report a documentation bug.

    Oh, and including a link to your scratchpad in a SoPW isnt clever, as the node will stay forever, but your scratchpad will quite likely change..

    C.

      hi cool, Its the common problem between the windows user and the *nix based user. Here is the modified script.Try this
      #!perl -w use strict; use CGI::Application::PhotoGallery; my $webapp = CGI::Application::PhotoGallery->new( PARAMS => { photos_dir => 'C:\\BigApache\\apache\\htdocs\\puppy_love\\ +photos', title => 'Austin Shelties', script_name => $0 } ); $webapp->run();
      The windows based file system should contain the slashes in reverse then to the *nix based os Sasi

      2004-12-06 Janitored by Arunbear - added code tags, as per Monastery guidelines

        Better would be to recommend usage of File::Spec so that the author doesn't have to worry about directory slashes. OS-dependency is sooo 1998!

        Being right, does not endow the right to be rude; politeness costs nothing.
        Being unknowing, is not the same as being stupid.
        Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
        Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.

Re: new to CGI::Application
by LTjake (Prior) on Dec 06, 2004 at 23:57 UTC

    Oh, hey. That's my module :).

    I guess i wasn't real clear on how it should work. Your photos should be set up like so

    • C:
      • photos
        • christmas
          • xmas01.jpg

    So, you'd point it to c:\photos\, and the script would read in the christmas dir and show a table w/ 1 image (xmas01.jpg).

    sasikumar and dragonchild have some good advice on putting in the path which should get your rolling.

    PS: C::A::PhotoGallery is old and I don't really like it. I'll fix it up Real Soon Now. :) -- that's what holidays are for!

    --
    "Go up to the next female stranger you see and tell her that her "body is a wonderland."
    My hypothesis is that she’ll be too busy laughing at you to even bother slapping you.
    " (src)