Hi, for clarity can you confirm that the three sections of the image you have posted are the question, the answer and an explanation?
If we take the first image you've posted it then it's correct to say that there will be no output to speak of. Clarity can be gained by adding use warnings; to the example code:
#!/usr/bin/perl use warnings; @this_array = ("b", "a", "d", "c"); foreach($this_array){ print("$_\n"); }
Which will return:
Use of uninitialized value $_ in concatenation (.) or string at derp.p +l line 7.
By simply changing the code to:
#!/usr/bin/perl use warnings; @this_array = ("b", "a", "d", "c"); foreach(@this_array){ # note @this_array not $this_array print("$_\n"); }
We now have working code which prints each item within the array. This is discussed in the third pannel (the explanation?). Out of curiosity is this a distance learning thing?
In reply to Re: Please Help With Perl
by marto
in thread Please Help With Perl
by JackVanson
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |