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

My server seem to have problem with folder. Can anyone make Pie without the Chart folder. So that i can "use Pie" instead of use "Chart::Pie". I tried it but it wouldn't work.

Thanks

Replies are listed 'Best First'.
Re: Chart::Pie
by zentara (Cardinal) on Feb 15, 2005 at 14:10 UTC
    I think I know what you are asking. What you want to do is take the Chart::Pie module, and put it in your directory with the script using it. It will be called Pie.pm. Then the thing you need to do, is at the top of the Pie.pm file, change the line "package Chart::Pie" to "package Pie". Then in your script, put
    use lib '.'; use Pie;

    I'm not really a human, but I play one on earth. flash japh
Re: Chart::Pie
by phaylon (Curate) on Feb 15, 2005 at 12:53 UTC
    I don't know what your Problem is exactly, but it sounds like you've lost control of your library paths.

    If this is right: Look out for 'perldoc perlrun', 'perldoc -f use', 'perldoc lib', and so on. If I'm false, I'm sorry.

    hth,phay

    Ordinary morality is for ordinary people. -- Aleister Crowley
      My hosting server which I have no control of, could not read when I upload the whole folder. But if I put a single file it has no problem. If I put the Pie.pm in Chart folder the @inc wouldn't find it. But if I put Pie.pm without the folder it detect it but as it is originally Chart::Pie, they must be some broken link, so please anyone help me fix this. This output is what I get

      Can't locate object method "gif" via package "Pie" at....

      I need to show my client tommorow, so I need to find a quick fix.

      Thanks

        If you give some code it might help.

        Except that:
        use Pie; # 'uses' Pie.pm, the file Pie->gif; # uses package Pie, method gif, defined by "package" # try use Pie; Chart::Pie->gif()
        Or give some more code.

        Ordinary morality is for ordinary people. -- Aleister Crowley
Re: Chart::Pie
by osunderdog (Deacon) on Feb 15, 2005 at 15:14 UTC

    You could try putting the PM in the 'Apple', 'Cherry' or 'Key Lime' folders to see if that helps.


    "Look, Shiny Things!" is not a better business strategy than compatibility and reuse.