Home
41.
Is a continue block executed if a redo statement restarts the loop?

No. The continueblock is executed only when an iteration of a loop is successfully completed.

42.
What do I do if I want to build a tree that has more than two children per node?

Again, there are many ways to do this. A possible solution is to use child1, child2, child3,and so on, instead of leftand right

43.
How many levels of nested subroutines can a program have?

It depends on the amount of memory in the machine. Normally, it is large enough to only be an issue when you are using recursive subroutines.

44.
How can I tell whether a reference to an array variable such as @arrayrefers to the stored list or to the length of the list?

It's usually pretty easy to tell. In a lot of places, using a list makes no sense:$result = $number + @array; For example, it makes no sense here to add a list to $number, so the length of the list stored in @arrayis used.

45.
Why does Perl add spaces when you substitute for an array variable in a string?

The most common use of string substitution is in the printstatement. Normally, when you print a list you don't want to have the elements of the list running together, because you want to see where one element stops and the next one starts. To print the elements of a string without spaces between them, pass the list to printwithout enclosing it in a string, as follows: print ("Here is my list", @list, "\n");

46.
What is the CPAN? Where is it?

CPAN stands for Comprehensive Perl Archive Network; it’s a collection of usercontributed modules, scripts, documentation, and utilities for use by anyone programming in Perl. CPAN is available at several sites around the world;

47.
What is the @INC array used for?

The @INC array defines the directories in which Perl will look for modules and code imported into your scripts using use.

48.
How do you import a module into your script? What does that give you?

Import a module into your script using use with the name of the module and an optional list of variables or import tags. Importing a module gives you access to the variables and subroutines defined by that module.

49.
What is an import tag and why would you use it?

An import tag defines a subset of variables and subroutines in the module to be imported into your own script. Import tags are defined by the module developer and documented in the documentation for that module.

50.
How do you call a subroutine you’ve imported from a module? How do you call a subroutine from an object-oriented module?

Subroutines imported from modules can be called just like regular subroutines, using the name of the subroutine with parentheses surrounding any arguments.
In object-oriented modules, you must create a new object before you can call subroutines. With a new object stored in a scalar variable, you’d then call a subroutine using the $var->sub() syntax, where $var is the name of the variable holding the object and sub is the name of the subroutine. Subroutines defined inside objects are called methods.