Perl: quotes


To put the " (quote) character in a string, you need to escape the " character by putting a '\' in front of it.

The following is an example with all of these special issues.

Perl script with localtime, .=, spaces, and quotes
 

$host_name = shift;
$qmgr_name = shift;
$queue_name = shift;
$attr_name = shift;
$value = shift;
$time = shift;
$out_filename = "perl_out.txt";
open(FILE, ">>$out_filename") or die "Can't open file: $out_filename";
print FILE "Command line args : $host_name $qmgr_name $queue_name $attr_name $value $time\n";
close(FILE);

The following output results:

Command line args : FARGO FARGO INVENTORY CurrentQDepth 10 Thu Oct 10 13:29:58 2002

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

MainView Middleware Monitor 9.2