The following is a section of a program. Show the value of each variable at each step:
@array =(0, 2..6, "abc"); What is @array?
$a = pop(@array); What is $a?
$b = shift(@array); What is $b?
What is @array?
Can someone please help me. This is what I have so far but it seems like its telling me that I have an error and it won't execute.
#!/bin/bash/perl
@array = ( 0, 2..6, "abc" );
$a = pop(@array);
$b = shift(@array);
print ("What is @array?\n");
print ("$array\n");
print ("$a\n");
print ("$b\n");
print ("What is @array?\n");
print ("$array\n");
the error that i am recieving is
./lab10.pl: line 5: syntax error near unexpected token `('
./lab10.pl: line 5: `@array = (0, 2..6, "abc");'
I'd be greatful if you could help me out! Thank you.
No the way I have it there is what I have written on my program.
Bookmarks