Software >> Languages >> Perl >> How to assign the resulting matches of a pattern match operation to an array

$ip = "172.16.100.200";

@octets = ( $ip =~ m/^(\d*)[.](\d*)[.](\d*)[.](\d*)$/ );

foreach $octet (@octets)
{
    printf "%d\n",$octet;
}