http://www.perlmonks.org?node_id=857104


in reply to What is this line doing in the perl script?

You haven't told us what part of the line you have problems understanding.

You can learn what the line is doing from perlre about the /g flag, and from perlsyn about what the assignment does.

Maybe it helps you to look at this example:

use strict; use Data::Dumper; my @list = ("abcdef" = /(.)./g); print Dumper \@list; (my ($first)) = @list; print "$first\n"; # in one step (my $first) = ("abcdef" = /(.)./g);