XML columms not lining up.

U

usaims

Hi, I'm trying to get the output of this script to print straight
pretty columms but it always come out not nice and pretty. I looked at
the XML:parser module but I think its an overkill for what I'm doing,
can somebody suggest something. TIA

#!/usr/bin/perl
use strict;
use warnings;
use diagnostics;

while ( my $line = <DATA> ) {
#checking to see if query is enabled
if ($line =~ m/\bavailable\b/) {

if ($line =~ m/^<Service name="(.*?)"/i) {
$main::queryname = $1;
#print "$queryname\n";
}
if ($line =~ m/\burl="http:\/\/(.*?)\.br\.xxx.com/i) {
$main::roxie = $1;
#print "$roxie\n";

}
if ($line =~ m/\bqueryname="(.*?)"/i) {
my $stuff = $1;
print "$main::roxie $main::queryname $stuff\n";


}
}
}


__DATA__
<Service name="Search" url="http://xxx.xx.xxx.com:1234" path="foxie"
queryname="foxie.SexOffender_Search" username="nouser"
password="vFQ/T13eG17MjaYs4l7V1A==" status="unavailable"/>
<Service name="EnSearch" url="http://xxx.xx.xxx.com:1234" path="foxie"
queryname="foxie.headerfilesearchservice" username="nouser"
password="vFQ/T13eG17MjaYs4l7V1A==" status="available"/>
<Service name="Bpsport" url="http://xxx.xx.xxx.com:1234" path="foxie"
queryname="foxie.Comprehensive_Report_Service" username="nouser"
password="vFQ/T13eG17MjaYs4l7V1A==" status="unavailable"/>
<Service name="Search" url="http://xxx.xx.xxx.com:1234" path="foxie"
queryname="foxie.HeaderFileRollupService" username="nouser"
password="vFQ/T13eG17MjaYs4l7V1A==" status="unavailable"/>
<Service name="CriminalReport" url="http://xxx.xx.xxx.com:1234"
path="foxie" queryname="foxie.DOC_Report" username="nouser"
password="vFQ/T13eG17MjaYs4l7V1A==" status="unavailable"/>
<Service name="CriminalSearch" url="http://xxx.xx.xxx.com:1234"
path="foxie" queryname="foxie.DOC_Search" username="nouser"
password="vFQ/T13eG17MjaYs4l7V1A==" status="unavailable"/>
<Service name="DriverLicenseSearch" url="http://xxx.xx.xxx.com:1234"
path="foxie" queryname="foxie.dl_Search" username="nouser"
password="vFQ/T13eG17MjaYs4l7V1A==" status="unavailable"/>
<Service name="MotorVehicleReport" url="http://xxx.xx.xxx.com:1234"
path="foxie" queryname="foxie.Vehicle_Report" username="nouser"
password="vFQ/T13eG17MjaYs4l7V1A==" status="unavailable"/>
<Service name="MotorVehicleSearch" url="http://xxx.xx.xxx.com:1234"
path="foxie" queryname="foxie.Vehicle_Search" username="nouser"
password="vFQ/T13eG17MjaYs4l7V1A==" status="unavailable"/>
<Service name="RollupPersonSearch" url="http://xxx.xx.xxx.com:1234"
path="foxie" queryname="foxie.HeaderFileRollupService"
username="nouser" password="vFQ/T13eG17MjaYs4l7V1A=="
status="available"/>
@
"roxie.pl" 43L, 3113C
21,9 Top
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top