CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate: Re: [FishMonger] how to split a table: Edit Log



technoman007
New User

Mar 4, 2014, 8:11 AM


Views: 4264
Re: [FishMonger] how to split a table


Code
#!/usr/bin/perl 
use strict;
use Data::Dumper;

my $dataserver=$ARGV[0];
my $username=$ARGV[1];
my $pass=$ARGV[2];

if(@ARGV < 1)
{

print "Usage :\n";
print " ./test.pl username dataserver pass\n";
exit;
}

my $result = qx { isql -U$username -S$dataserver -P$pass -s"," -b <<EOF

set nocount on
select * from class where subject="maths"
exit
EOF
};

print $result;

so im stuck thinking how to split if the $result has this

name age subjects
------ ----- --------
George 25 maths
mark 23 maths
hamond 22 maths
jeremy 24 maths


i need the output as
name=>george
age=>25
subject=>maths
and so on.


(This post was edited by FishMonger on Mar 4, 2014, 8:27 AM)


Edit Log:
Post edited by FishMonger (Veteran) on Mar 4, 2014, 8:27 AM: Added code tags


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives