Just another Perl shrine | |
PerlMonks |
Re^4: Compiling and uploading a crontab to my Radioduinoby cavac (Parson) |
on May 30, 2021 at 10:09 UTC ( [id://11133301]=note: print w/replies, xml ) | Need Help?? |
but your code always sets the datalength value to 16 *facepalm* Well, that certainly explains why i had some "unexpected features"(tm) during tests. You probably just saved me a weekend of debugging. Thank you very much! Please don't understand the following as a critisism, just as why i prefer a different coding style: Your version of the code is much more compact, which is nice. But it makes it (in my opinion) much harder to read and comprehend, especially for beginners. That's why i also try to avoid pack()/unpack() and also all those implicit things like $_. More explicit code makes it also easier to port between different programming languages.
perl -e 'use Crypt::Digest::SHA256 qw[sha256_hex]; print substr(sha256_hex("the Answer To Life, The Universe And Everything"), 6, 2), "\n";'
In Section
Cool Uses for Perl
|
|