Loading ...
Sorry, an error occurred while loading the content.
 

Re: [peditors] Any perl experts here?

Expand Messages
  • Benjamin Esham
    ... Yep, that s pretty much what it does :-) -- Benjamin D. Esham { http://bdesham.net bdesham@iname.com } AIM: bdesham 1 2 8 Wikipedia,
    Message 1 of 4 , Jan 31, 2004
      On Jan 31, 2004, at 7:10 AM, Paul Nevai wrote:

      > I am not at all a perl guy so I can't help, but this is very
      > interesting. So
      > you split and then basically you replace ever href="#..." by it's new
      > pathname. Right? /Paul

      Yep, that's pretty much what it does :-)

      --
      Benjamin D. Esham { http://bdesham.net
      bdesham@... } AIM: bdesham 1 2 8
      Wikipedia, the Free Encyclopedia - wikipedia.org
    • mikeyb_134
      Benjamin I do some Perl at work but I am by know means an expert. The first thing I would say is Perl is a language to get the job done. And you did the job!
      Message 2 of 4 , Feb 5, 2004
        Benjamin

        I do some Perl at work but I am by know means an expert.
        The first thing I would say is Perl is a language to get the job done.
        And you did the job!
        The second thing is Perl's motto is "there is more than one way to do
        it" TMTOWTDI

        The third thing is (I'm running out of fingers!) Perl programmers are
        said to have 3 attributes Laziness, Impatience and Hubris. Being a
        lazy sole I would have used the excellent plucker – (www.plkr.org)
        Plucker free open source is an offline Web and e-book viewer. (the
        manual takes about 4 sec to load on my palm M500)

        At a quick glance of your code here are some things to think about…

        I don't think you don't need to call perl –w if it is specified in
        the #! (hash bang) – even the win32 Active Perl looks at this.

        Consider slurping up the file in one go and using it twice (saving
        reading in the file) things usually run quicker in memory.

        Consider using Perl's simple module for getting command line
        attributes (Getopt:Std). It may appear like over kill but you'd be
        suppressed how often you want to add the odd command line parameter or
        three

        In the later part of you program you build up a template before you
        write it out. I may have used a "here doc" or a "multi line" scalar
        assignment. Perl will assign all the text from the start quotes to
        the end quotes to a scalar such as $boil, even if the text spans more
        than one line. – I use this technique for printing out help text. My
        feeling is that using a here doc or here docs is better suited to
        incorporating more complex data structures at runtime e.g. iterating
        round an array or hash.

        But remember . . .!
        - TM TOW TDI

        The Camel Book and Cook book are excellent resources but for quick
        online snippets and more than one way to do it , I usually find myself
        meditating at the Monastery Gates (www.perlmonks.org).

        Mike



        --- In peditors@yahoogroups.com, Benjamin Esham <bdesham@i...> wrote:
        > One of pedit's strengths is that there's so much documentation
        > available (in the form of pedit_man.html, included in the pedit
        > distribution). On the other hand, it takes about 6.02e23 hours for
        > that page to load in my browser, and I can't even think about how slow
        > it would get on my PDA.
        >
        > To that end, I've written a perl script to take the pedit_man HTML file
        > and split it into a bunch of smaller chapters, with links between the
        > chapters remaining intact. My problem is that I'm basically an idiot
        > when
        > it comes to advanced stuff in perl, and so I'm asking that a perl hacker
        > or two (there's got to be a couple in here) take a look at my code and
        > tell me how it can be made more efficient/correct/whatever.
        >
        > My script is available at http://www.geneseo.edu/~eshamb/files/split.pl.
        > I'd greatly appreciate it if someone would take a look and improve it.
        > (Of course, email me if you have questions on any part of the script.)
        >
        > Many thanks,
        > --
        > Benjamin D. Esham { http://bdesham.net
        > bdesham@i... } AIM: bdesham 1 2 8
        > Wikipedia, the Free Encyclopedia - wikipedia.org
      Your message has been successfully submitted and would be delivered to recipients shortly.