More Interpolation
- Problem:
$fruit = "apple"; print "I ate four $fruits\n";
- Solution:
print "I ate four ${fruit}s\n";
- Yes, escaping (\s) would work until we needed n or e..
| CPU: Perl, Fall 2005 | Perl, Week 2: Arrays, Hashes, Control Structures | #9 |
$fruit = "apple"; print "I ate four $fruits\n";
print "I ate four ${fruit}s\n";
| Copyright © 2005 Ian Langworth |