Consider the Perl program given below: ```perl @bases = ('A', 'G', 'C', 'T'); $base1 = shift @bases; print "@bases"; ``` What will be printed on the screen after running the above code?
- Execution Trace of Perl Array Shift:
- Initial array declaration:
@bases = ('A', 'G', 'C', 'T');
- Function call:
shift @bases: - The Perl built-in
shiftfunction removes and returns the first element from an array, shifting all subsequent elements down by one index. - `
$base1receives the shifted element'A'`. - The array
@basesis modified in-place to contain:('G', 'C', 'T'). - Print statement:
print "@bases";: - In double quotes, Perl interpolates array elements separated by the list separator `
$"` (a single space by default). - Output printed on screen: G C T.
- Conclusion: G C T (Option 2).
Correct option: (2) 6CT