code jump does not work for main::

Help
forkdeath
2007-08-09
2013-05-20
  • forkdeath

    forkdeath - 2007-08-09

    Note the below code.

    use lib ("../../data/chgmgmt");
    use cm;
    ...
    main::create_cm_header($breadcrumbs);  // cannot code jump

    When I hold down the crtl key and click create_cm_header the editor does not jump to the referenced method.  If I remove 'main::' the code jump works fine. It jumps to the method within the cm module.

    create_cm_header($breadcrumbs);  // can code jump

    I inherited a lot of code that has this in it.  Is there a way to get EPIC to jump correctly without modifying all the files?  The code does execute correctly.

    Thanks for any help!
    John Hayles

     
    • Jan Ploski

      Jan Ploski - 2007-08-09

      Are you saying that the module 'cm' defines a subroutine 'create_cm_header' which belongs to the 'main' package (rather than to the 'cm' package)?

       
      • forkdeath

        forkdeath - 2007-08-09

        All the subroutines are exported by default, so that loads them into the ‘main’ memory space.  ‘main’ is the default space. The cm.pm module is using @EXPORT as opposed to @EXPORT_OK.  So by using @EXPORT = qw(create_cm_header), create_cm_header is automatically loaded into main. 

         

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks