http://www.perlmonks.org?node_id=828353


in reply to Re^4: Trying to Copy Live Http Replay
in thread Trying to Copy Live Http Replay

using "" and qq{} should be nearly equivalent(1). In both cases you need to be careful to not include additional whitespace.

Here are four equivalent declarations using "" and qq{}.

#/usr/bin/perl use strict; use warnings; use Test::More tests =>4 ; my $a1 = qq{a\r\nb\r\nc\r\n}; my $a2 = qq{a\r b\r c\r }; my $b1 = "a\r\nb\r\nc\r\n"; my $b2 = "a\r b\r c\r\n"; is( $a1, $a2, "a1 and a2 are the same"); is( $b1, $b2, "b1 and b2 are the same"); is( $a1, $b1, "a1 and b1 are the same"); is( $a2, $b2, "a2 and b2 are the same"); __END__ 1..4 ok 1 - a1 and a2 are the same ok 2 - b1 and b2 are the same ok 3 - a1 and b1 are the same ok 4 - a2 and b2 are the same

1 -- except for the semantics used for escaping, qq will escape double-quotes in the string.