Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
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 drinking their drinks and smoking their pipes about the Monastery: (12)
As of 2014-07-10 10:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (205 votes), past polls