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 XMLarser 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
pretty columms but it always come out not nice and pretty. I looked at
the XMLarser 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