in reply to Use of the m/.../g idiom in list context (formatting MAC addresses)
Why not drop the parens?$mac = join( ':' => ($mac =~ /(..)/g) );
$mac = join( ':' => ($mac =~ /../g) );
BTW, I did something a bit similar today to get all the pod sections with name $sname in file $fname as a string:
join("", my_slurp_file_function($fname) =~ /^=begin[ \t]+$sname[ \t]*\n(.*?)^=end[ \t]+$sname[ \t]*$/msg);
|
---|