CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Advanced:
Using Java-like URL-based namespaces


New User

May 6, 2002, 11:03 AM

Post #1 of 2 (2076 views)
Using Java-like URL-based namespaces Can't Post


This is my first post, and I'm a looking for an elegant solution to organizing my Perl code into a namespace structure that fits well into the way that my java code is laid out.

Basically, I want to code and distribute a package called


(based on the same URL as the Java package edu.usc.kmrg.vpdmf)

but then just get these horrendous strings whenever I create a new object. Imagine having

$a = edu::usc::kmrg::vpdmf::blahblahblah->new() scattered around your code.

Is this the only way? I've thought of separating the definition of the library file from the name of the package so I'd put the definition

package blahblahblah;

into the file: ./edu/usc/kmrg/vpdmf/blahblahblah; and then make sure that the package names are all unique, but I'm worried that this will break the Makefile generation process under perl Makefile.PL.

Any suggestions/ideas?




May 7, 2002, 3:46 AM

Post #2 of 2 (2070 views)
Re: [GullyBurns] Using Java-like URL-based namespaces [In reply to] Can't Post

You could shorten it by creating a

use vars qw/$obj/;

$obj = 'edu::usc::kmrg::vpdmf::blahblahblah';

Then you can just use:

$a = $obj->new()


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives