22/02/2012 - Xem: 1532
Một vài câu hỏi dùng trong quá trình dạy perl tại aiti-aptech
Perl Question
- What is the address of Perl’s home page?
- Who was the creator of Perl?
- How much does Perl cost?
- Why are comments important to programming?
- What are the four types of literals?
- What is a numeric literal?
- How many types of string literals are there?
- What is the major difference between single- and double-quoted strings?
- What are three escape sequences and what do they mean?
- What would the following one-line program display?
print `dir /*.log`;
- What is scientific notation?
- How can you represent the number 64 in hexadecimal inside a double-quoted string?
- What is the easiest way to represent an array that includes the numbers 56 to 87?
- What are the three basic data types that Perl uses?
- How can you determine the number of elements in an array?
- What is a namespace?
- What is the special variable $[ used for?
- What is the special variable $" used for?
- What is the value of a variable when it is first used?
- What is an associative array?
- How can you access associative array elements?
- What are three arithmetic operators?
- What does the x operator do?
- What does it mean to pre-decrement a variable?
- What is the value of 1 ^ 1?
- What is the value of 1 << 3?
- What is the ternary operator used for?
- Can the x operator be used with arrays?
- What is the precedence level of the range operator?
- What is the value of 2 * 5 + 10?
- What is the value of 65 >> 1?
- What is the spaceship operator used for?
- If an array were defined with ("fy".."gb"), what would its elements be?
- What is a parameter?
- What two functions are used to create variables with local scope?
- What does parameter passing by reference mean?
- What is the @_ array used for?
- Do Perl variables have global or local scope by default?
- Why is it hard to pass two arrays to a function?
- What is the difference between variables created with local() and variables created with my()?
- What does the map() function do?
- What is an expression?
- What is a statement?
- What are the four statement modifiers?
- What are two uses for statement blocks?
- What can non-action statements be used for?
- How is the if modifier different from the unless modifier?
- What will the following code display?
$firstVar = 10; $secondVar = 20; $firstVar += $secondVar++ if ($firstVar > 10); print("firstVar = $firstVar\n"); print("secondVar = $secondVar\n");
- What are the four loop keywords?
- What are the four jump keywords?
- Which form of the until statement is used when the statement block needs to be executed at least once?
- What will be displayed when this program executes?
$firstVar = 5; { if ($firstVar > 10) { last; } $firstVar++; redo; } print("$firstVar\n");
- What is the default name of the local variable in the foreach loop?
- How is the next keyword different from the redo keyword?
- Why is the comma operator useful in the initialization expression of a for loop?
- What is the shift() function used for?
- What is a reference?
- How many types of references are there?
- What does the ref() function return if passed a non-reference as a parameter?
- What notation is used to dereference a reference value?
- What is an anonymous array?
- What is a nested data structure?
- What will the following line of code display?
print("${\ref(\(1..5))}");
- Using the %database array in Listing 8.6, what will the following line of code display?
print(%{$database{"MRD-100"}}->{"Zip"} . "\n");
- What is a file handle?
- What is binary mode?
- What is a fully qualified file name?
- Are variables in the computer's memory considered persistent storage?
- What is the <> operator used for?
- What is the default file handle for the printf() function?
- What is the difference between the following two open statements?
open(FILE_ONE, ">FILE_ONE.DAT"); open(FILE_TWO, ">>FILE_TWO.DAT");
- What value will the following expression return?
(stat("09lst01.pl"))[7];
- What is globbing?
- Can you use variable interpolation with the translation operator?
- What happens if the pattern is empty?
- What variable does the substitution operator use as its default?
- Will the following line of code work?
m{.*];
- What is the /g option of the substitution operator used for?
- What does the \d meta-character sequence mean?
- What is the meaning of the dollar sign in the following pattern?
/AA[.<]$]ER/
- What is a word boundary?
- What is the syntax of the format statement?
- What is a footer?
- What function is used to invoke the format statement?
- How can you change a detail format line into a header format line?
- What is the > format character used for?
- What is the $^L variable used for?
- Can associative array variables be used in value lines?
- What is the $/ variable used for?
- What file handle is used to avoid a second system call when doing two or more file tests?
- What will the following program display?
$_ = "The big red shoe"; m/[rs].*\b/; print("$`\n");
- What variable holds the value of the last match string?
- Why is it important to check for errors?
- How is the die() function different from the warn() function?
- What is the meaning of the $! special variable?
- What does the eval() function do?
- What is a signal?
- What will the statement $SIG{'ABRT'} = 'IGNORE' do??
- Which signal is used to trap floating point exceptions?
- What will the following program display?
@array = (1..5); $" = "+"; print("@array\n");
- What does the following program display?
@array = ('A'..'E'); foreach (@array) { print(); } $\ = "\n"; foreach (@array) { print(); }
- What will the following line of code do?
select((select(ANNUAL_RPT), $^ = "REGIONAL_SALES")[0]);
- What will be displayed by the following program?
$_ = 'AB AB AC'; print m/c$/i;
- What will the following statement display?
printf("%x", 16);
(i-php.net)