This example shows how to list the contents of directories in Perl. It also demonstrates how to change directories, create directories, differentiate between files and directories, and use a regular expression to limit the results or search for particular file names or extensions.
Serial communication is still used a bit today. Arduino's are fun programmable microcontrollers and the main method of communication is serial over USB. This example will show you how to communicate using serial in Perl.
RCON, or Remote Console, is a way to manage a minecraft server from another computer with a console. The Minecraft::RCON module needs to be installed from CPAN first.
CPAN is a Perl tool for installing and managing modules. CPAN stands for the Comprehensive Perl Archive Network. There are many mirrors around the world that host the same CPAN archive. Sometimes mirrors shut down or you may want to add mirrors that are closer to you. These examples demonstrate how to add and remove mirrors from your configuration.
Standard in and Standard out (STDIN/STDOUT) are very common methods of interacting with the user. Standard in is typically the keyboard and standard out is the terminal. Haskell makes this very easy to access. The getLine function gets a value from the user and putStrLn and putStr allow you to write to output. The ++ operator is used to concatenate strings.
In Haskell, you can access the command line arguments with getArgs. Check out this example.
Haskell is a purely functional programming language create in 1990. This Hello World example will help you get started with Haskell. Install Haskell for your system from the Haskell website. The program installed is called ghc which stands for the Glasgow Haskell Compiler. It can be run interactively or as a compiler.
C and Assembly can be used together to provide extra flexibility. You can create static libraries in Assembly that you call from C, and vice-versa, you can call C functions from within Assembly. Check out the code samples below that demonstrate that process.
NASM, or The Netwide Assembler, is an x86 compiler that allows us to turn Assembly code in to machine code object files. Once we have an object file, we can link it and create the final executable. This example is meant for Unix systems or Windows with MinGW toolchain installed. On Debian systems, it can be installed with the nasm package. Put the code below in to hello.asm
Scala programs can accept run-time variables as command line arguments. Here is an example of how to access the variables.