in reply to Re^3: How to store matched $1 values one by one to array?
in thread How to store matched $1 values one by one to array?
if($line =~ /^.*:agent_id=>(.+?),/){ # Calls count based on call type my $agent_value=$1; my $agent_value=~s/\"//g; push @agent_ids, $agent_value; print Dumper\@agent_ids; }
Before while loop I have declared the @agent_ids and then added the push function with array and scalar variable.
While printing the @agent_ids variable it printed the undef in array.
I don't know why it is printing the undef values instead of exact values.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^5: How to store matched $1 values one by one to array?
by trizen (Hermit) on Feb 02, 2013 at 11:12 UTC | |
Re^5: How to store matched $1 values one by one to array?
by choroba (Cardinal) on Feb 02, 2013 at 11:12 UTC |
In Section
Seekers of Perl Wisdom