NAME

Question types


Start with


Question limit

of 18 available terms

Print test

18 Multiple choice questions

  1. Specify a return value: the last line should be "1"
  2. Temporarily assign a value to a global variable within a block.

    $a=3;
    sub printA { printf("$a\n"); }

    {
    local $a = 5;
    &printA; // 5
    }
    &printA; // 3
  3. A module, named by 'package', is a class. It has a subroutine called "new", which calls "bless" between a hash containing member variables and the class name.
  4. 1) 'use' is executed during the compile time, 'require' doesn't.
    2) 'use' calls 'import', which is defined in modules to affect the current namespace.
  5. package::function
  6. last
  7. pm, not pl.
  8. Whenever a module is loaded, it's inserted into %INC, and thus preventing duplicated loading.
  9. $a = [1,2,3];
    $b = {1=>"a", 2=>"b", 3=>"c"};
  10. It indicates parent classes.
  11. @INC
  12. The exec command stops the execution of the current process and starts the execution of the new process and does not return back to the stopped process. But the system command, holds the execution of the current process, forks a new process and continues with the execution of the command specified and returns back to the process on hold to continue execution
  13. while (my ($name, $length) = each %lengths) {
    ...
    }
  14. @sum = (@arr1, @arr2);
  15. Make a variable visible in the entire file across packages.

    package bar;
    our $m = 5;
    package foo;
    print($m);
  16. $count = ($str =~ s/pattern/pattern/);
  17. It associates a reference with a package.
  18. main::