Iterate through variable line by line.


/ Published in: Perl
Save to your folder(s)

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.


Copy this code and paste it in your HTML
  1. my @thing = split(/\n/, $results->{_content});
  2. foreach my $item(@thing) {
  3. # The Needful
  4. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.