-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmulti_line_strings.pl
More file actions
64 lines (39 loc) · 933 Bytes
/
Copy pathmulti_line_strings.pl
File metadata and controls
64 lines (39 loc) · 933 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/perl
use warnings;
use strict;
=head1 DESCRIPTION
Using single quotes when using here-document does not use interpolation.
Here is an example of hear-document with single quotes
=cut
my $name = 'Foo';
my $message = <<'END_MESSAGE';
Dear $name
this is a message I plan to send you.
regards,
Matt
END_MESSAGE
print $message;
=head1 DESCRIPTION
Using double quotes when using here-document does use interpolation.
You can also use no quotes and it will default to double quotes
Here is the same example as above using interpolation
=cut
$message = <<"END_MESSAGE";
Dear $name
this is a message I plan to send you.
regards,
Matt
END_MESSAGE
print $message;
=head1 Description
Using q or qq instead of here-document
this example uses qq to allow interpolation, use q to prevent
interpolation
=cut
$message = qq{
Dear $name
this is a message I plan to send you.
regards,
Matt
};
print $message;