Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: How can I avoid code repetition here

by bv (Friar)
on Oct 07, 2009 at 16:24 UTC ( [id://799754]=note: print w/replies, xml ) Need Help??


in reply to How can I avoid code repetition here

I'm not sure if this will help or hurt, but it seems to me that the more natural ordering of your arguments would be ($lchompstr, $optional_string_arg), since that would mirror the syntax of split, unpack, and others that act on $_ by default.

print pack("A25",pack("V*",map{1919242272+$_}(34481450,-49737472,6228,0,-285028276,6979,-1380265972)))

Replies are listed 'Best First'.
Re^2: How can I avoid code repetition here
by rovf (Priest) on Oct 08, 2009 at 09:41 UTC
    the more natural ordering of your arguments would be ($lchompstr, $optional_string_arg)

    In hindsight you are right. Unfortunately we already have other functions in use, which have the ordering in the way may lchompx is going to be used, and I don't know yet whether I'll have the nerves to change all these consistently. Maybe I'll do one day, and certainly I would do it in the way you propose, if I had to develop all this again.

    -- 
    Ronald Fischer <ynnor@mm.st>

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (8)
As of 2024-04-18 10:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found