G
gooofoofs
I have the following script parsing a log file for me. Im not sure how to
package this into an email. I prefer not to use modules.
#!/usr/bin/perl -w
my @code1;
my @code2;
open(FILE, "test.log");
while (<FILE>){
if($_ =~ m/code1\:\s(.*?)\s/){
print "<XML>\n";
print "<code1>$1</code1>\n";
}elsif($_ =~ m/code2\:\s(.*?)\s/){
print "<code2>$1</code2>\n";
print "</XML>\n\n";
}
close(FILE);
package this into an email. I prefer not to use modules.
#!/usr/bin/perl -w
my @code1;
my @code2;
open(FILE, "test.log");
while (<FILE>){
if($_ =~ m/code1\:\s(.*?)\s/){
print "<XML>\n";
print "<code1>$1</code1>\n";
}elsif($_ =~ m/code2\:\s(.*?)\s/){
print "<code2>$1</code2>\n";
print "</XML>\n\n";
}
close(FILE);