Advertisement
Guest User

Untitled

a guest
Jan 24th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  1. @things = ("hello", "why", 6, "we are the weirdos mister");
  2. print "$things[0] @things[0..3]\n";
  3. $things[2] = "no longer a number";
  4. print "@things[0..3]\n";
  5. #print "$things[6]\n";
  6. #push @things, qw(sup newfriend );
  7. #print "$things[6]/n";
  8. #$nope = pop @things;
  9. #print "$nope\n";
  10.  
  11. returns
  12.  
  13. hello hello why 6 we are the weirdos mister
  14. hello why no longer a number we are the weirdos mister
  15.  
  16.  
  17. @things = ("hello", "why", 6, "we are the weirdos mister");
  18. print "$things[0] @things[0..3]\n";
  19. $things[2] = "no longer a number";
  20. print "@things[0..3]\n";
  21. print "$things[6]\n";
  22. push @things, qw(sup newfriend );
  23. print "$things[6]/n";
  24. #$nope = pop @things;
  25. #print "$nope\n";
  26.  
  27. returns
  28.  
  29. hello hello why 6 we are the weirdos mister
  30. hello why no longer a number we are the weirdos mister
  31. Use of uninitialized value in concatenation (.) or string at test.pl line 27.
  32.  
  33. Use of uninitialized value in concatenation (.) or string at test.pl line 29.
  34.  
  35.  
  36.  
  37. from what I know, you can't have undefined slots between defined slots in arrays?
  38.  
  39. push @things, qw(sup newfriend ); would put this in the 4th slot anyhow.
  40.  
  41.  
  42. @things = ("hello", "why", 6, "we are the weirdos mister");
  43. print "$things[0] @things[0..3]\n";
  44. $things[2] = "no longer a number";
  45. print "@things[0..3]\n";
  46. #print "$things[6]\n";
  47. push @things, qw(sup newfriend );
  48. #print "$things[6]/n";
  49. $nope = pop @things;
  50. print "$nope\n";
  51.  
  52.  
  53. hello hello why 6 we are the weirdos mister
  54. hello why no longer a number we are the weirdos mister
  55. newfriend
  56.  
  57.  
  58. so I have zero idea what you're expecting for the answer to Question 6.
  59.  
  60.  
  61. ..I mean especially since things[6] (dimensions[6]) would imply 7 scalars, not 6.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement