If this doesn't quite do what you want, see if you can modify it so that it does:
#!/usr/bin/perl
use strict;
use warnings;
while (defined (my $x= <DATA>))
{
chomp $x;
if ($x =~ /^JOB::/)
{
print $x, "\n";
}
elsif ($x =~ m/^Something\s*$/)
{
print "~~Something~~ ", $x, "\n";
}
else
{
print "~~Something Else~~ ", $x, "\n";
}
}
=prints
JOB::HEREISASTRING
~~Something~~ Something
~~Something Else~~ StringA
~~Something Else~~ StringB
~~Something Else~~ StringC
~~Something Else~~ StringD
~~Something Else~~ Something Else
~~Something Else~~ StringE
~~Something Else~~ StringF
~~Something Else~~ StringG
~~Something Else~~ StringH
JOB::HEREISANOTHERSTRING
~~Something~~ Something
~~Something Else~~ StringI
~~Something Else~~ StringJ
~~Something Else~~ StringK
~~Something Else~~ StringL
~~Something Else~~ Something Else
~~Something Else~~ StringM
~~Something Else~~ StringN
~~Something Else~~ StringO
~~Something Else~~ StringP
=cut
__DATA__
JOB::HEREISASTRING
Something
StringA
StringB
StringC
StringD
Something Else
StringE
StringF
StringG
StringH
JOB::HEREISANOTHERSTRING
Something
StringI
StringJ
StringK
StringL
Something Else
StringM
StringN
StringO
StringP