Without using $_[0] etc. a subroutine can only be invoked once in a programme .

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pwilliams
    New Member
    • Jul 2010
    • 21

    #1

    Without using $_[0] etc. a subroutine can only be invoked once in a programme .

    Unless I use all subscripts in a subroutine it just gives the same answer to a subsequent call,I've been through the Llama with a fine-toothcomb and yes,I've tried the net.

    All I'm trying to do is write a programme for factorials,
    ie N!/(N - R)!.

    Thanks in anticipation.
  • chorny
    Recognized Expert New Member
    • Jan 2008
    • 80

    #2
    Show us the code.

    Comment

    • RonB
      Recognized Expert Contributor
      • Jun 2009
      • 589

      #3
      Without using $_[0] etc. a subroutine can only be invoked once in a programme .
      Is that a statement or a question?

      Factorial questions like this and your prior one are clearly class homework assignments. We can't give the complete solution to your homework, but if you post your code, we can give you some guidance.

      Comment

      • pwilliams
        New Member
        • Jul 2010
        • 21

        #4
        RonB how very very wrong can one be! When I last did homework, we were in the UK, still using £.s.d and I would hazard a guess that you were not even born!

        Comment

        • RonB
          Recognized Expert Contributor
          • Jun 2009
          • 589

          #5
          It's possible that we're both wrong. I'm older than you think.

          If you still want help, then please post your code and a clear question.

          Comment

          Working...