- or download this
my @ARRAY = split(/[\r\n]+/, $ENTIRE_FILE_CONTENT);
- or download this
for (my $i = 0; $i < @ARRAY; $i++)
{
print "\n$ARRAY[$i];";
}
- or download this
for (my $i = 0; $i < @ARRAY; $i++)
{
if ($i + 3 < @ARRAY) { print "\n$ARRAY[$i + 3]"; }
}
- or download this
my $STOP = @ARRAY - 3;
for (my $i = 0; $i < $STOP; $i++)
{
print "\n$ARRAY[$i + 3]";
}
- or download this
my $FOUND = index($ARRAY[$i], 'solar winds');
if ($FOUND >= 0) { print "\nFOUND SOLAR WINDS IN LINE $i"; }
- or download this
if ($ARRAY[$i] eq 'solar winds') { print "\nLINE $i MATCHES SOLAR WIND
+S"; }
- 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...
}