<HTML >
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16705" name=GENERATOR></HEAD>
<BODY >
<DIV>
<DIV dir=ltr align=left><FONT face=Arial size=2></FONT> </DIV>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV></DIV>
<DIV><SPAN class=132472516-14102008><FONT face=Arial><FONT size=2><SPAN
class=490211817-14102008> Hi, first post
here</SPAN></FONT></FONT></SPAN></DIV>
<DIV><SPAN class=132472516-14102008><FONT face=Arial><FONT size=2><SPAN
class=490211817-14102008></SPAN></FONT></FONT></SPAN> </DIV>
<DIV><SPAN class=132472516-14102008><FONT size=+0><FONT face=Arial><FONT
size=2><SPAN class=490211817-14102008>I have a qu</SPAN>estion
regarding <SPAN class=490211817-14102008> getting column names from
a </SPAN>DBIx<SPAN class=490211817-14102008> ::Class $resultset or
$row.</SPAN></FONT></FONT></FONT></SPAN></DIV>
<DIV><SPAN class=132472516-14102008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=132472516-14102008><FONT face=Arial size=2>I have a
DBIx::Class resultset which I'll call $rset</FONT></SPAN></DIV>
<DIV><SPAN class=132472516-14102008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=132472516-14102008><FONT face=Arial size=2>I need to get the
column names of the resultset in the correct order.</FONT></SPAN></DIV>
<DIV><SPAN class=132472516-14102008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=132472516-14102008><FONT face=Arial size=2>I was advised<SPAN
class=490211817-14102008> by a coleague </SPAN> to use
$rset->result_source->columns;</FONT></SPAN></DIV>
<DIV><SPAN class=132472516-14102008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=132472516-14102008><FONT face=Arial size=2>This have me the
column names of the table that was the original source of the resultset which
initially worked ok.</FONT></SPAN></DIV>
<DIV><SPAN class=132472516-14102008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=132472516-14102008><FONT face=Arial size=2>However, now that
I am doing some selects on the table the resultset only contains a subset of
the table columns</FONT></SPAN></DIV>
<DIV><SPAN class=132472516-14102008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=132472516-14102008><FONT face=Arial size=2>I tried doing
</FONT></SPAN></DIV>
<DIV><SPAN class=132472516-14102008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=132472516-14102008><FONT face=Arial size=2>my $row =
$rset->first;</FONT></SPAN></DIV>
<DIV><SPAN class=132472516-14102008><FONT face=Arial size=2>%row =
$row->get_columns;</FONT></SPAN></DIV>
<DIV><SPAN class=132472516-14102008><FONT face=Arial size=2>my @cols = keys
%row;</FONT></SPAN></DIV>
<DIV><SPAN class=132472516-14102008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=132472516-14102008><FONT face=Arial size=2>But now I dont
have them in the correct order.</FONT></SPAN></DIV>
<DIV><SPAN class=132472516-14102008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=132472516-14102008><FONT face=Arial size=2>Is there anyway to
get a<SPAN class=490211817-14102008>n (ordered) </SPAN> list of
the column names from the $resultset or the $row</FONT></SPAN></DIV>
<DIV><SPAN class=132472516-14102008></SPAN><SPAN
class=132472516-14102008><FONT face=Arial size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=132472516-14102008><FONT face=Arial
size=2>Thanks</FONT></SPAN></DIV>
<DIV><SPAN class=132472516-14102008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=132472516-14102008><FONT face=Arial
size=2>Tom</FONT></SPAN></DIV></BLOCKQUOTE></DIV>
<DIV>
<HR>
</DIV>
<P CLASS="BulletedList" STYLE="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0in; mso-list: none; tab-stops: .5in"><SPAN STYLE="FONT-SIZE: 8pt; COLOR: gray; mso-bidi-font-family: Arial"><FONT FACE="Arial" COLOR="gray" SIZE="1">NOTICE: If received in error, please destroy and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error.</FONT></SPAN></P>
<DIV>
</DIV></BODY></HTML>