Posted By

EmbeddedInsanity on 03/17/12


simple memory Jogger

Versions (?)

Iterate through variable line by line.

 / Published in: Perl

Splits on new line, to load array, and cycle through each line in array.

In this example, we are loading the holding array "@thing" with data from the "_content" key of the $results hashref.

  1. my @thing = split(/\n/, $results->{_content});
  2. foreach my $item(@thing) {
  3. # The Needful
  4. }

Report this snippet  

You need to login to post a comment.