Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Script fails to insert text and appends it towards the end of file.

by GrandFather (Saint)
on Nov 22, 2020 at 08:24 UTC ( [id://11124010]=note: print w/replies, xml ) Need Help??


in reply to Script fails to insert text and appends it towards the end of file.

It's kinda hard to tell where this code may be going, but it smells like there should be a database involved. If this sort of random access to lines continues to be required beyond an initialisation phase then a database is likely to perform better with less messing around and less effort than most other techniques.

Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond
  • Comment on Re: Script fails to insert text and appends it towards the end of file.

Replies are listed 'Best First'.
Re^2: Script fails to insert text and appends it towards the end of file.
by always_coys (Novice) on Nov 22, 2020 at 15:14 UTC
    Hi GrandFather, there is indeed a database involved. I am using Perl to run multiple instances of a finite element software. So, it requires the input files to be updated for every run, using values from the database.

      In that case wouldn't it be more efficient to add a table or tables to the database rather than work with external temporary files?

      Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond

        In that case wouldn't it be more efficient to add a table or tables to the database...

        Or even dynamically create a temporary table or tables from within the code.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-04-25 16:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found