more useful options | |
PerlMonks |
Re^2: While i am executing a perl script in that one file will get as ouput in that ^M is priting and the actual output is getting disabled?by cavac (Parson) |
on Apr 04, 2022 at 08:52 UTC ( [id://11142656]=note: print w/replies, xml ) | Need Help?? |
As stated in the WIkipedia article (but not properly elaborated on): The reason that carriage return and linefeed are two different characters is mechanical constraints: On old Teletype (TTY) machines it takes about the time of two transmitted characters for the carriage to return to the starting position, but only one to advance the paper one line. So the encoding allows for the additional time requirement by always requiring to send carriage return first, followed by a linefeed. This provides that characters can be send non-stop at maximum (45 Baud) speed in normal use (for example using a paper tape as source). While still giving the option of using CR and LF separately for specific purposes (CR alone for overwriting a line, LF alone as sort of vertical tabulator). CuriousMarc has a nice demonstration of these early mechanical teletypes on his Youtube channel. Cynic me suspects these work about the same speed as a modern Windows cmd.exe, which is why Windows still uses CR+LF ;-)
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
Seekers of Perl Wisdom
|
|