Tag Archives: literals

Strings (Part 4)

Below is an example of a document that consists of lines in the source but without the terminating string that is needed after the “<<” character. This terminator must start in the first column but with the minus “-” sign after the “<<” character, indention can be done on that specific terminator\ as shown below.
print [...]

Posted in Development, Programming Basics | Also tagged | Comments closed

Strings (Part 3)

There are more ways of constructing string literals such as %q, %Q and “here documents.” The first two are used to starte single or double-quoted strings such as;
%q/general single-quoted string/ >> general single-quoted string
%Q!general single-quoted string! >> general double-quoted string
%Q{Seconds/day: #{24*60*60}} >> Seconds/day: 86400
The character following the “q” or “Q” is the delimiter that if it is an [...]

Posted in Development, Programming Basics | Also tagged | Comments closed