Re: how to do something
From: James Willmore (jwillmore_at_remove.adelphia.net)
Date: 10/25/03
- Next message: Dr. Pastor: "Re: About Expect."
- Previous message: Jürgen Exner: "Re: exec() gives output??"
- In reply to: Lex: "how to do something"
- Next in thread: Lex: "Re: how to do something"
- Reply: Lex: "Re: how to do something"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 25 Oct 2003 17:50:25 GMT
On Sat, 25 Oct 2003 18:39:59 +0100
"Lex" <nospam@peng.nl> wrote:
> I've got two subroutines, one is saying 'do the other x times'. The
> other is checking records from a database and prints the x latest
> records. However, when a record matches something, it should be
> skipped. It all works, however, what happens is that the results are
> x - 1. So in the example underneath I normally get 3 results, except
> when $vergelijker = jep, than the I only get 2 results, although I'd
> prefer 3. I tried this but it doesn't work:
>
> subroutine 1:
>
> my $i = 2;
Where is ^^^ this line being declared? Inside subroutine 1 or
globally? If it's inside subroutine 1, then that's where I _think_
you're issue is - the variable's scope (or where it's life exists).
If $i is supposed to be accessed in _both_ subroutines, then declare
it _outside_ of the subroutines (aka globally).
Or did I miss what you were after?
HTH
-- Jim Copyright notice: all code written by the author in this post is released under the GPL. http://www.gnu.org/licenses/gpl.txt for more information. a fortune quote ... Hand, n.: A singular instrument worn at the end of a human arm <and commonly thrust into somebody's pocket. -- Ambrose Bierce, "The Devil's Dictionary"
- Next message: Dr. Pastor: "Re: About Expect."
- Previous message: Jürgen Exner: "Re: exec() gives output??"
- In reply to: Lex: "how to do something"
- Next in thread: Lex: "Re: how to do something"
- Reply: Lex: "Re: how to do something"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|