Help for this page

Select Code to Download


  1. or download this
    my @ARRAY = split(/[\r\n]+/, $ENTIRE_FILE_CONTENT);
    
  2. or download this
    for (my $i = 0; $i < @ARRAY; $i++)
    {
      print "\n$ARRAY[$i];";
    }
    
  3. or download this
    for (my $i = 0; $i < @ARRAY; $i++)
    {
      if ($i + 3 < @ARRAY) { print "\n$ARRAY[$i + 3]"; }
    }
    
  4. or download this
    my $STOP = @ARRAY - 3;
    for (my $i = 0; $i < $STOP; $i++)
    {
      print "\n$ARRAY[$i + 3]";
    }
    
  5. or download this
    my $FOUND = index($ARRAY[$i], 'solar winds');
    if ($FOUND >= 0) { print "\nFOUND SOLAR WINDS IN LINE $i"; }
    
  6. or download this
    if ($ARRAY[$i] eq 'solar winds') { print "\nLINE $i MATCHES SOLAR WIND
    +S"; }
    
  7. or download this
    my $STOP = @ARRAY - 3;
    for (my $i = 0; $i < $STOP; $i++)
    ...
      if (index($ARRAY[$i], 'solar winds') >= 0)
      { $ARRAY[$i + 3] =~ s/country/place/; }   # Use a regex to replace c
    +ountry...
    }