Writing a persistent perl script

前端 未结 4 478
無奈伤痛
無奈伤痛 2020-12-09 23:59

I am trying to write a persistent/cached script. The code would look something like this:

...
Memoize(\'process_fille\');
print process_file($ARGV[0]);
...
s         


        
4条回答
  •  难免孤独
    2020-12-10 00:19

    No. Not directly but can be achieved by very many ways.

    1) I understand **extract_values_from_file()** parses given file returning hash.
    2) 1 can be made as a script, then dump the parsed hash using **Data::Dumper** into file.
    3) When running my_script.pl, ensure that file generated by 2 is later than of the config file. Can achieve this via **make**
    3.1) **use** the file generated by 2 to retrieve values.
    

    The same can be achieved via freeze/thaw

提交回复
热议问题