Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: [RFC] File::Replace

by Anonymous Monk
on Sep 20, 2017 at 22:27 UTC ( #1199790=note: print w/replies, xml ) Need Help??


in reply to [RFC] File::Replace

A guy|gal after my own heart! Thanks for creating the module.

I am, however, curious to know why you want to support more than one method (3!) to interact with your module.

Replies are listed 'Best First'.
Re^2: [RFC] File::Replace
by haukex (Monsignor) on Sep 21, 2017 at 07:19 UTC

    I'm glad you like it!

    I am, however, curious to know why you want to support more than one method (3!) to interact with your module.

    The TL;DR is that I know people have different preferences, and since all three interfaces are fully tested and provide the same functionality (same parameters, same safety features, etc.), it really just is a matter of preference. The slightly longer answer is:

    1. I started with only the "single magic tied filehandle" interface because I thought it was kind of neat, and it helps keep short scripts short. However, I realized that not everyone likes too much magic, plus it might be too hard to remember which I/O functions operate on the input file and which on the output file, so
    2. I implemented the "two filehandles" interface because I thought it would be the most natural, and indeed, as I demonstrated in the root node, for code that is already using two filehandles, no major changes to the I/O code should be needed.
    3. By that point however, I was packing too much into one module and I was running into implementation problems, so I made the cleaner separation of putting the core functionality in an OO module, and wrapping that functionality with the tied filehandles. I figured that some people might prefer OO and/or dislike tied filehandles. It has the added benefit of being the only of the three interfaces that doesn't use tied filehandles at all, in case the user wants to do something fancy with the underlying filehandles, like tie-ing them on their own.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1199790]
help
Chatterbox?
[Corion]: Hurr - as I'm running some not-so-static websites nowadays, maybe I really should implement a link checker that crawls these sites and checks that all internal links work ...
[Corion]: (in the sense of not returning 404 errors)

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (16)
As of 2017-10-18 11:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (244 votes). Check out past polls.

    Notices?