For example, to print "Hello World" at the terminal, just type the following at the command line:
$ perl -e 'print("Hello World");'Notice that the parentheses and semicolon can be left out. But I do not recommend it.
$ perl -e '$result = sqrt(144) + sqrt(196); print($result);'or shorter
$ perl -e 'print(sqrt(144) + sqrt(196));'To add automatically a newline character use the -l switch:
$ perl -l -e '$result = sqrt(144) + sqrt(196); print($result);'Any Perl one-liner can be converted into a full script via the