Professional Documents
Culture Documents
Perl - m02 - Basics
Perl - m02 - Basics
Language
PERL
Basics
Scalars,
Scalar
A single number, string or reference.
$society = Redbrick;
# Output: 427
# Output: 10
# Output: 8
# Output: 20
# Output: 3.14
We can use the Perls concatenation operator, which is a dot (.) to add
two strings
$var1=Hello ;
$var2=there\n;
print $var1 . $var2;
10
Single quote
Double quote
Tab
Newline
Make next character Uppercase
Make next character Lowercase
Make all the following characters Uppercase
Make all the following characters Lowercase
Add a backslash to all following no alphanumeric characters
End of \L, \U, or \Q
Return
Form feed
Backspace
Alarm(Bell)
11
12
# Output: Hello
# Error: No Good
# Error: Doesnt work
13
Resorts In
``
()
m//
s///
y///
14
Data Types
In fact, we dont need to use / and / to enclose
the string in such cases.
15
16