Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Repeating Code - there has GOT to be a better way!

by brap (Pilgrim)
on Mar 31, 2010 at 17:32 UTC ( #832099=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
        if (int($fssbCmd{$cmd}{fixed_pattern}) <= 15) {
            $opcode = sprintf("0%x",$<name>Cmd{$cmd}{fixed_pattern});
        } else {
            $opcode = sprintf("%x",$<name>Cmd{$cmd}{fixed_pattern});
        }
    
  2. or download this
        $opcode = sprintf("%02x",$<name>Cmd{$cmd}{fixed_pattern});
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (8)
As of 2014-10-24 23:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (138 votes), past polls