\n newlineTry running this small program table.pl
\t tab
\a bell
#!/usr/local/bin/perl
$table = "ITEM1\tITEM2\tITEM3\nITEM4\tITEM5\tITEM6\n";
print $table;
$bell = "\a";
print $bell;
Example (students.pl):
#!/usr/local/bin/perl
$a = "Perl Programming";
$b = 72;
$line = "Total of $b students are registered to the $a course.";
print "$line\n";
Same thing if you want to have a literal backslash (\\).
Examples:
1. Let's surround the course name with double quotes (students1.pl):
#!/usr/local/bin/perl
$a = "Perl Programming";
$b = 72;
$line = "Total of $b students are registered to the \"$a\" course.";
print "$line\n";
2. Let's use a backslash when printing a file path in a PC (filepath.pl):
#!/usr/local/bin/perl
$file_path = "vered\\presentations\\dec2000\\db.ppt";
print "Please find file in: $file_path\n";