You could split the line the first time at the space, assigning the name as the first side of the whitespace and put the rest into another variable, then split the $rest variable on the commas:
#!/usr/bin/perl
use warnings;
use strict;
open my $fh, "<", "infos.txt" or die "cannot open infos.txt: $!";
while ( my $line = <$fh> ){
chomp $line;
my ( $name, $rest ) = split /\s+/, $line;
my ( $age, $gender, $address ) = split /,/, $rest;
print "Name: $name\n";
print "Age: $age\n";
print "Gender: $gender\n";
print "Address: $address\n";
print "\n";
}
Output:
Name: Mawts
Age: 25
Gender: female
Address: melbourne
Name: Awts
Age: 24
Gender: male
Address: sydney