Content deleted Content added
Cardologist (talk | contribs) |
added a Bourne shell-based pseudo-JAPH |
||
Line 65:
Often Parrot JAPHs are only lightly obfuscated; they're usually intended to demonstrate or test a feature in a non-trivial use.
A different form of imitation would be to solve the exercise in a system outside of [[Perl]]. This example is supposed to be run in a [[Bourne shell]] and will create a [[Computer file|file]] named "Just another Perl Hacker" (on a [[file system]] that supports it) in the current working directory. The [[String (computer science)|string]] to print will be determined by the "basename" command.
a="Just another Perl Hacker"
[ -f"$a" ]||
echo "perl -e\"print '\$(basename \"\$0\")'\"">./"$a"
./"$a"
i.e. while it is true that (as demanded by the exercise text) "[[Perl]] prints \"Just another Perl Hacker\"", the code requires other software to function, here specifically [[Bourne shell]] and "basename".
==Additional information==
|