# How to set PERL5LIB for node-red?

**URL:** <https://discourse.nodered.org/t/how-to-set-perl5lib-for-node-red/42189>\
**Category:** General\
**Created:** [7 March 2021 09:33 UTC](https://discourse.nodered.org/t/how-to-set-perl5lib-for-node-red/42189 "2021-03-07T09:33:07Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![hepcat72](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hepcat72/32/8078_2.png) [@hepcat72](https://discourse.nodered.org/u/hepcat72)\
**Post date:** [9 March 2021 14:05 UTC](https://discourse.nodered.org/t/how-to-set-perl5lib-for-node-red/42189/13 "2021-03-09T14:05:04Z")

</div>

Just to follow up. Your response inspired the following tests (after saving my sorted user environment in a file on the command line):

```auto
[{"id":"81ea3e84.bb722","type":"exec","z":"8b5ff0a3.decbe8","command":"env | sort | diff /home/pi/tmp.env - && exit 0","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"diff env file","x":250,"y":80,"wires":[["95bc6e3b.ff0d48","369ad5ad.dc0352"],["95bc6e3b.ff0d48"],["95bc6e3b.ff0d48"]]},{"id":"95bc6e3b.ff0d48","type":"debug","z":"8b5ff0a3.decbe8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":450,"y":60,"wires":[]},{"id":"71c6a30f.42003c","type":"inject","z":"8b5ff0a3.decbe8","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":100,"y":80,"wires":[["81ea3e84.bb722"]]},{"id":"369ad5ad.dc0352","type":"file","z":"8b5ff0a3.decbe8","name":"","filename":"/home/pi/tmp.nr.env.update.diff","appendNewline":true,"createDir":false,"overwriteFile":"false","encoding":"none","x":510,"y":100,"wires":[[]]},{"id":"f542aff2.b9cc18","type":"inject","z":"8b5ff0a3.decbe8","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":100,"y":180,"wires":[["3c26a4e4.3455d4"]]},{"id":"3c26a4e4.3455d4","type":"exec","z":"8b5ff0a3.decbe8","command":"perl -e 'use DateTime'","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"perl module env test","x":280,"y":180,"wires":[["33ed4241.31df7e"],["33ed4241.31df7e"],["33ed4241.31df7e"]]},{"id":"33ed4241.31df7e","type":"debug","z":"8b5ff0a3.decbe8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":470,"y":180,"wires":[]}]

```

Looks like to get the environment, I need to add the --update-env option to pm2.

Thanks for following up.

---

_[View the full topic](https://discourse.nodered.org/t/how-to-set-perl5lib-for-node-red/42189)._
