#!/usr/bin/perl use warnings; use strict; use Text::Table; my $tb = Text::Table->new(qw/NAME VERSION RELEASE ARCH/); while() { $tb->load( [ /^(.*)-(.*)-(.*)\.(.*)$/ ] ); } print $tb; __DATA__ fipscheck-1.2.0-1.el5.x86_64 iptables-ipv6-1.3.5-5.3.el5_4.1.x86_64 libXi-1.0.1-4.el5_4.i386 perl-Carp-Clan-5.3-1.2.1.noarch rpm-build-4.6.1-2.el5.x86_64 #### NAME VERSION RELEASE ARCH fipscheck 1.2.0 1.el5 x86_64 iptables-ipv6 1.3.5 5.3.el5_4.1 x86_64 libXi 1.0.1 4.el5_4 i386 perl-Carp-Clan 5.3 1.2.1 noarch rpm-build 4.6.1 2.el5 x86_64