some string quoting exercises
This commit is contained in:
parent
f39fc4dc24
commit
760ded693b
34
cli/quoting.pl
Normal file
34
cli/quoting.pl
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
#!/usr/bin/env perl
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
|
||||||
|
|
||||||
|
print qq{I said "They're the most delicious fruits!".\n};
|
||||||
|
print q/I said "They're the most delicious fruits!"./ . "\n";
|
||||||
|
|
||||||
|
|
||||||
|
print <<OUTPUT
|
||||||
|
I said "They're the most delicious fruits!".
|
||||||
|
OUTPUT
|
||||||
|
;
|
||||||
|
|
||||||
|
my $one = 'mangoes';
|
||||||
|
|
||||||
|
print "I like $one.\n";
|
||||||
|
print 'I like $one.' . "\n";
|
||||||
|
print qq/I love $one.\n/;
|
||||||
|
print q#I love $one.# . "\n";
|
||||||
|
|
||||||
|
print <<OUT
|
||||||
|
I <3 $one
|
||||||
|
OUT
|
||||||
|
;
|
||||||
|
|
||||||
|
print <<'OUT'
|
||||||
|
I <3 $one
|
||||||
|
OUT
|
||||||
|
;
|
||||||
|
|
||||||
|
|
||||||
|
1;
|
||||||
|
__END__
|
Loading…
Reference in New Issue
Block a user