Strings: Double Quoted
 
Double-quoted Strings
  • Allows numerous control sequences
     
  • Allows variable interpolation
    $basename = "myfile";
    $datafile = "$basename.dat";
    $idxfile = "$basename.idx";
    
Some control sequences
    \n newline
    \t tab
    \e escape
    \x7F hex sequence (here, hex 7F)
    \007 octal sequence (here, hex 07, or bell)
    \Cg control character (here, Ctrl-G, or bell)
    \" doublequotes
    \\ backslash
  • Remember that if you use backslashes in path names, you must escape them.
    "c:\temp" is actually "c:<tab>emp"
    "c:\\temp" or 'c:\temp' is what you want

     
  • Fortunately, Perl allows forward slashes as separators in filenames
    "c:/temp" works, too.
Index
Introduction
What Is Perl?
Perl Resources
Running a Perl Program
Perl Thinking
Data Types
Scalars
Strings: Single Quoted
Strings: Double Quoted
Scalar operations
Scalar comparisons
Variables
Lists
Using Lists
Control Structures
Hashes
Hash Manipulation
File Handling
Regex Matching
Regex Matching: Ex. 1
Regex Matching: Ex. 2
Regex Replacing
Subroutines
Anonymous subs
References
Structures
Modules
Modules: File::Find
Modules: Internet
Modules: Win32::*
Everything Else
  Next page >>>