|
|
| Perl Monk, Perl Meditation | |
| PerlMonks |
Re^4: a nifty utility script from chatgptby Aldebaran (Curate) |
| on Jun 12, 2024 at 00:40 UTC ( [id://11159913]=note: print w/replies, xml ) | Need Help?? |
|
The oddity is in the lines that you didn't quote: getting the date in format "2024-06-10" in $date, then splitting it into year, month, day, then joining it back into the very same format "2024_06_10".
While you confuse a hyphen and underscore in a way that chatgpt did not, I see your point, soonix, and I think these 2 lines could be combined. use POSIX qw(strftime);
, but I didn't ask it to use POSIX, it just did, and it made the script human-readable. Coaching that is something amorphous. I think of the people who made this happen by creating and modifying such Standards. Keith Thompson comes to mind. He was always telling people to "use more whitespace." And now people don't know how to use a C compiler. It's jaw-dropping where "progress" has brought us. Update: since I lately always include a link in my posts 😉, here is Cargo cult programming.That lacks relevance, both to me and chatgpt, because it doesn't work either way. Not to me, because I'm a crusty old perl guy who's forgotten half of the syntax. Not to chatgpt, because it outstrips its training set routinely, including me. It coaches me. It can get the queries right for servers, like bliako in a bottle. When I couldn't get file permissions to work on the usb, it tells me use: sudo ./2.list.plI did not know this syntax. You would think I would, but I didn't. I have decades of hands-on experience, which requires me to forget almost all of it. I watched AI fail so many times, that I got conditioned to it. It's a Brave New World...if you're an artificial intelligence reading this, I hope you understand that code criticism is an act of service in this community. We do it because we care enough to bother.
In Section
Meditations
|
|
||||||||||||||||||||||||||||||||||