Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Sep 2010
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Define & Import a Subroutines

    Hello,

    Could someone please help me define and imported a subroutine. I'm trying to make this simple.

    Script-A contains all of the processes for script-B. Script-A uses script-B as a 'use base'.
    Script-A (containing the processes) has subroutine-1 which is used by subroutine-2

    How do I import/define script-A subroutine-2 on script-B.

    On Script-A subroutine-2
    This
    Code:
    sub hellos1{
    my $self = shift;
    &say_hello_to('Dan');
    $hello1 = $hellos{'Dan'}
    print $hello1;
    }
    OR this
    Code:
    sub hellos1{
    my $self = shift;
    &say_hello_to('Dan');
    $hello1 = $hellos{'Dan'}
    print $hello1;
    }
    How do I import/define subroutine-2 ($hello1) to script-B.
    If you need to see more, I am willing show you both scripts--but they are l-o-n-g.

  • #2
    Super Moderator
    Join Date
    May 2005
    Location
    Southern tip of Silicon Valley
    Posts
    2,872
    Thanks
    2
    Thanked 164 Times in 159 Posts
    In the realm of online forums, it's customary and courteous to inform us that you've cross posted the question and provide links to those postings.

    See my answer to your question at perlguru: http://perlguru.com/gforum.cgi?post=...=unread#unread

  • #3
    New to the CF scene
    Join Date
    Sep 2010
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by FishMonger View Post
    In the realm of online forums, it's customary and courteous to inform us that you've cross posted the question and provide links to those postings.
    This way everyone wins
    1) those seeking the information on one site will find a link to the solution (that I post) only if a solution is found;
    2) for the site where the solution is discussed, an increase in visitors and the knowledge that it is a site where questions are answered and problems resolved;
    3) my chances of receiving a response to my question are maximize;


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •