#!/usr/bin/perl use warnings; use strict; use Data::Dumper; while () { next unless /action \( ([0-9,]+ ) \) /x; my @args = grep $_, split /,/, $1; my %hash; @hash{ ('a' .. 'z')[0 .. $#args] } = @args; print Dumper \%hash; } __DATA__ blah blah [AHB_REPORTER][INFO]: action(62,1,0,0,0,0,5,53,9,0,190)D:/XYZ/reg/Tests/Mcu/A_test.cCALL: (null)