in reply to Calling external subroutine from a package

See Simple Module Tutorial and Modern Perl

When you  do 'dbselect.pl'; or  require 'dbselect.pl'; then sub dbSelect gets defined in package main, so its full name is main::dbSelect, and you can call it like main::dbSelect()

But you should turn dbselect.pl into a proper module :)

Replies are listed 'Best First'.
Re^2: Calling external subroutine from a package
by badoosan (Initiate) on Oct 15, 2012 at 17:47 UTC

    THANK YOU

    This solved the problem!!!

    I knew that I was missing something that should have been obvious. You saved the day.

    I will be converting all of this to packages eventually but I wanted to get over this hump for the near term.

Re^2: Calling external subroutine from a package
by Anonymous Monk on Oct 15, 2012 at 17:33 UTC
    $ perl -le " sub foo { die @_ }; package OTHER; foo( 666 ) " Undefined subroutine &OTHER::foo called at -e line 1. $ perl -le " sub foo { die @_ }; package OTHER; main::foo( 666 ) " 666 at -e line 1. $ perl -le " sub foo { die @_ }; package OTHER; ::foo( 666 ) " 666 at -e line 1.