Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Use of the m/.../g idiom in list context (formatting MAC addresses)

by eyepopslikeamosquito (Canon)
on Jan 18, 2005 at 06:47 UTC ( #422907=note: print w/ replies, xml ) Need Help??


in reply to Use of the m/.../g idiom in list context (formatting MAC addresses)

$mac = join( ':' => ($mac =~ /(..)/g) );
Why not drop the parens?
$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);


Comment on Re: Use of the m/.../g idiom in list context (formatting MAC addresses)
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://422907]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (8)
As of 2014-10-21 19:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (106 votes), past polls