When writing a Perl script, there's literally zero friction to using regular expressions because they're baked in. I just type what I want to run.
When writing a Python script, I realize I want a regular expression, and I have to stop the code I'm writing, jump to the top of the file, import re, go back to where I was.
Now, maybe I'm writing a quick script and I don't care about tidiness, and I only have to stop what I'm doing, put "import re", and then write the code I want, but still, I'm stopping.
Or I'll wait until I've written the code I want, and go back and put it in. If I remember. If not, I'll find out when I run it that I forgot it.
Or my IDE will show me in red ugly squigglies that I need to right click or hover, and there'll be a recommended solution to import it.
> stop the code I'm writing, jump to the top of the file, import re, go back to where I was.
If you're just shitting out a one off script and that's really a problem for you, you can just "import re" where you are, there's nothing other than convention and scope that forces you to import everything at the top. Given thats also a problem with sys and os, importing all the commonly used libraries and carrying that around as a template (from print import pprint, anyone?) also seems reasonable, if that's really a problem for you.
When writing a Perl script, there's literally zero friction to using regular expressions because they're baked in. I just type what I want to run.
When writing a Python script, I realize I want a regular expression, and I have to stop the code I'm writing, jump to the top of the file, import re, go back to where I was.
Now, maybe I'm writing a quick script and I don't care about tidiness, and I only have to stop what I'm doing, put "import re", and then write the code I want, but still, I'm stopping.
Or I'll wait until I've written the code I want, and go back and put it in. If I remember. If not, I'll find out when I run it that I forgot it.
Or my IDE will show me in red ugly squigglies that I need to right click or hover, and there'll be a recommended solution to import it.
This is all friction that isn't there with Perl.