MORSE(1)
π MORSE(1) β like, the manual page, but make it make sense π
okay bestie, welcome to the Perl User Contributed Documentation page for morse β yes, that morse. dots and dashes. the OG texting. pull up a chair, we're doing this π
β¨ NAME β¨
morse β translate text to morse code. that's it. that's the whole vibe. π¦
πΈ SYNOPSIS πΈ
morse [-frs] [file ...]
morse [-rs] [string ...]
(yes, file really does have two spaces before the ... β it's giving quirky but we love her for it π)
π DESCRIPTION π
so morse takes input from one of three places: a list of files, standard input, or command line arguments. pick your fighter. no cap.
here's the thing though β morse code can be written in two whole forms:
- short form β the classic dots-and-dashes look:
-- --- .-. ... . - long form β the spelled-out one:
daw daw, daw daw daw, dit daw dit, dit dit dit
and long form is the default, just so you know. that's where she lives. π
now, the separator rules, because this is where people get humbled:
- short-form morse uses both spaces and newline characters as a separator. easy. slay.
- long-form morse needs a space between each
'dit'or'daw'β literally every single one, no skipping. - long form ALSO needs a comma or newline character as the separator between each morse code. so like, both rules apply. iykyk.
also!! plot twist: a morse code document can be translated back to text. decoding arc. π₯
β οΈ but fr fr heads up β the program will terminate if it runs into a series of dots and dashes it can't translate. not a warning, not a gentle nudge. just gone. π
π OPTIONS π
the following options are available (there's only three, we're chill):
-fβ treat command arguments as files instead of morse code strings. like, they're files now, congrats.-rβ decode input from morse to text. reverse mode. backwards era. π-sβ process short-form morse (dots and dashes) instead of the default long-form. and listen β the argument'--'should precede any morse code you're passing as command arguments. that's not optional, bestie, that's the rule. π«Ά
π¦ ENVIRONMENT π¦
the working of morse is not influenced by any environment variables.
that's it. that's the section. she's unbothered. completely unbothered. no env vars, no drama, no $HOME nonsense. iconic behaviour honestly π
β EXAMPLES β
okay this is the part you actually came for. here's every single one, and yes we're doing all of them π
decode short-form morse from stdin
echo - .- --- | morse -rs
decode long-form morse from stdin
echo daw, dit daw, daw daw daw | morse -r
decode short-form morse from argument list
note that '--' terminates the processing of command options, so the first morse code is '-'. love a flirty little ambiguity π
morse -rs -- - .- ---
decode long-form morse from argument list
morse -r daw, dit daw, daw daw daw
encode short-form morse from stdin
echo foo | morse -s
encode long-form morse from stdin
echo foo | morse
encode short-form morse from argument list
morse -s tst txt
encode long-form morse from argument list
morse tst txt
decode short-form morse from files
morse -frs file1 file2
decode long-form morse from files
morse -fr file1 file2
encode short-form morse from files
morse -fs file1 file2
encode long-form morse from files
morse -f file1 file2
see the pattern? -f for files, -r to decode, -s for short form. mix and match, that's the whole energy β¨π¦
π AUTHOR π
the Perl implementation of morse was written by Abigail, perlpowertools@abigail.be. the program was extended by Michael Mikonos. legends, both of them π
πΈ COPYRIGHT and LICENSE πΈ
this program is copyright by Abigail 1999.
this program is free and open software. you may use, copy, modify, distribute and sell this program (and any modified variants) in any way you wish β provided you do not restrict others to the same. so like, go off, but keep the door open behind you, bestie π«Άβ¨
okay that's the whole page!! go forth and morse ππ
sign-off era: this beauty is from perl v5.42.2, dated 2026-02-15 β stamped and sealed, muah π
π¦ where this page comes from
- alpine 3.24: perl-power-tools-doc 1.053-r1 Β· GPL-2.0-or-later AND Artistic-1.0-Perl AND Artistic-2.0 AND BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms