in reply to Scoping problem!!
In regards to question 2:
"Scoping" applies only within a single program; A.pl and B.pl are independent programs, so they have no variables in common. The only ways (of which I'm aware) to get information from one to the other are by environment variables (if, for example, B.pl is forked from A.pl), command line arguments, or some form of interprocess communication, such as pipes.As pointed out by the prior respondents, you've got a couple of choices, depending on your application design: re-write B.pl as a module (with a nice, descriptive name that does not clobber a core module), rewrite A.pl to include the required functionality of B.pl, or re-write both to use some form of interprocess communication. This could be as simple as something like
A.pl ]arguments for A.pl] | B.pl [arguments for B.pl]
…but probably not.
update: fixed markup
emc
"Being forced to write comments actually improves code, because it is easier to fix a crock than to explain it. "
|
|---|