Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: chopping a string into slices - is there a more elegant way to do it?

by dragonchild (Archbishop)
on Nov 04, 2008 at 14:25 UTC ( #721405=note: print w/ replies, xml ) Need Help??


in reply to chopping a string into slices - is there a more elegant way to do it?

You've received help with your actual problem. But, I will point out that the "No CPAN modules" restriction is a restriction only in your mind. The code is freely available - just cut'n'paste the subroutines you care about into your code. Attribute the original author if you have a conscience (and can do so in your shop) and move on. There have been several times where I've had to do that in my career.


My criteria for good software:
  1. Does it work?
  2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?


Comment on Re: chopping a string into slices - is there a more elegant way to do it?
Re^2: chopping a string into slices - is there a more elegant way to do it?
by rovf (Priest) on Nov 04, 2008 at 14:34 UTC
    But, I will point out that the "No CPAN modules" restriction is a restriction only in your mind.

    I don't think so ;-)

    Actually, I use a lot of CPAN modules in other code I'm writing. The Perl script in question here, however, is supposed to work in a distributed environment, and I don't know more about the target platform than that at least Perl 5.8 will be present to execute it. Sure, one could think of downloading something from CPAN (as long it is native Perl and not compiled, because I don't even can make assumption about the operating system where my script will be running), and then include the CPAN module verbatim in my script (so that it still remains a single file) - but this would not really be a nice solution either.

    -- 
    Ronald Fischer <ynnor@mm.st>
      ... include the CPAN module verbatim in my script (so that it still remains a single file) ...
      I don't understand why this would be necessary. Why not just lift the code you need, with or without attribution, as dragonchild suggested?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (11)
As of 2014-07-29 09:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (212 votes), past polls