my $EMPTY_STRING = q{};
my $STRING = 'foo';
my $NUM_IN_STRING = 'has 42 in it';
+my $INT_WITH_NL1 = "1\n";
+my $INT_WITH_NL2 = "\n1";
my $SCALAR_REF = \( my $var );
my $SCALAR_REF_REF = \$SCALAR_REF;
$EMPTY_STRING,
$STRING,
$NUM_IN_STRING,
+ $INT_WITH_NL1,
+ $INT_WITH_NL2,
$SCALAR_REF,
$SCALAR_REF_REF,
$ARRAY_REF,
$EMPTY_STRING,
$STRING,
$NUM_IN_STRING,
+ $INT_WITH_NL1,
+ $INT_WITH_NL2,
$SCALAR_REF,
$SCALAR_REF_REF,
$ARRAY_REF,
$EMPTY_STRING,
$STRING,
$NUM_IN_STRING,
+ $INT_WITH_NL1,
+ $INT_WITH_NL2,
$SCALAR_REF,
$SCALAR_REF_REF,
$ARRAY_REF,
$EMPTY_STRING,
$STRING,
$NUM_IN_STRING,
+ $INT_WITH_NL1,
+ $INT_WITH_NL2,
$SCALAR_REF,
$SCALAR_REF_REF,
$ARRAY_REF,
$NEG_NUM,
$STRING,
$NUM_IN_STRING,
+ $INT_WITH_NL1,
+ $INT_WITH_NL2,
$SCALAR_REF,
$SCALAR_REF_REF,
$ARRAY_REF,
$EMPTY_STRING,
$STRING,
$NUM_IN_STRING,
+ $INT_WITH_NL1,
+ $INT_WITH_NL2,
$SCALAR_REF,
$SCALAR_REF_REF,
$ARRAY_REF,
$EMPTY_STRING,
$STRING,
$NUM_IN_STRING,
+ $INT_WITH_NL1,
+ $INT_WITH_NL2,
$GLOB,
],
reject => [
$EMPTY_STRING,
$STRING,
$NUM_IN_STRING,
+ $INT_WITH_NL1,
+ $INT_WITH_NL2,
$GLOB,
$UNDEF,
],
$NEG_INT,
$NUM,
$NEG_NUM,
+ $INT_WITH_NL1,
+ $INT_WITH_NL2,
],
reject => [
$EMPTY_STRING,
$EMPTY_STRING,
$STRING,
$NUM_IN_STRING,
+ $INT_WITH_NL1,
+ $INT_WITH_NL2,
$SCALAR_REF,
$SCALAR_REF_REF,
$ARRAY_REF,
$EMPTY_STRING,
$STRING,
$NUM_IN_STRING,
+ $INT_WITH_NL1,
+ $INT_WITH_NL2,
],
reject => [
$SCALAR_REF,
$EMPTY_STRING,
$STRING,
$NUM_IN_STRING,
+ $INT_WITH_NL1,
+ $INT_WITH_NL2,
$ARRAY_REF,
$HASH_REF,
$CODE_REF,
$EMPTY_STRING,
$STRING,
$NUM_IN_STRING,
+ $INT_WITH_NL1,
+ $INT_WITH_NL2,
$SCALAR_REF,
$SCALAR_REF_REF,
$HASH_REF,
$EMPTY_STRING,
$STRING,
$NUM_IN_STRING,
+ $INT_WITH_NL1,
+ $INT_WITH_NL2,
$SCALAR_REF,
$SCALAR_REF_REF,
$ARRAY_REF,
$EMPTY_STRING,
$STRING,
$NUM_IN_STRING,
+ $INT_WITH_NL1,
+ $INT_WITH_NL2,
$SCALAR_REF,
$SCALAR_REF_REF,
$ARRAY_REF,
$EMPTY_STRING,
$STRING,
$NUM_IN_STRING,
+ $INT_WITH_NL1,
+ $INT_WITH_NL2,
$SCALAR_REF,
$SCALAR_REF_REF,
$ARRAY_REF,
$EMPTY_STRING,
$STRING,
$NUM_IN_STRING,
+ $INT_WITH_NL1,
+ $INT_WITH_NL2,
$SCALAR_REF,
$SCALAR_REF_REF,
$ARRAY_REF,
$EMPTY_STRING,
$STRING,
$NUM_IN_STRING,
+ $INT_WITH_NL1,
+ $INT_WITH_NL2,
$SCALAR_REF,
$SCALAR_REF_REF,
$ARRAY_REF,
$EMPTY_STRING,
$STRING,
$NUM_IN_STRING,
+ $INT_WITH_NL1,
+ $INT_WITH_NL2,
$SCALAR_REF,
$SCALAR_REF_REF,
$ARRAY_REF,
$EMPTY_STRING,
$STRING,
$NUM_IN_STRING,
+ $INT_WITH_NL1,
+ $INT_WITH_NL2,
$SCALAR_REF,
$SCALAR_REF_REF,
$ARRAY_REF,
$EMPTY_STRING,
$STRING,
$NUM_IN_STRING,
+ $INT_WITH_NL1,
+ $INT_WITH_NL2,
$SCALAR_REF,
$SCALAR_REF_REF,
$ARRAY_REF,
$EMPTY_STRING,
$STRING,
$NUM_IN_STRING,
+ $INT_WITH_NL1,
+ $INT_WITH_NL2,
$SCALAR_REF,
$SCALAR_REF_REF,
$ARRAY_REF,
{
package Duck;
- sub quack {}
- sub flap {}
+ sub quack { }
+ sub flap { }
}
{
package DuckLike;
- sub quack {}
- sub flap {}
+ sub quack { }
+ sub flap { }
}
{
package Bird;
- sub flap {}
+ sub flap { }
}
{
$EMPTY_STRING,
$STRING,
$NUM_IN_STRING,
+ $INT_WITH_NL1,
+ $INT_WITH_NL2,
$SCALAR_REF,
$SCALAR_REF_REF,
$ARRAY_REF,
$EMPTY_STRING,
$STRING,
$NUM_IN_STRING,
+ $INT_WITH_NL1,
+ $INT_WITH_NL2,
$SCALAR_REF,
$SCALAR_REF_REF,
$ARRAY_REF,
$EMPTY_STRING,
$STRING,
$NUM_IN_STRING,
+ $INT_WITH_NL1,
+ $INT_WITH_NL2,
$SCALAR_REF,
$SCALAR_REF_REF,
$ARRAY_REF,
if ( !ref $val ) {
return q{''} if $val eq q{};
- }
- return $val unless ref $val;
+ $val =~ s/\n/\\n/g;
+
+ return $val;
+ }
return 'open filehandle'
if openhandle $val && !blessed $val;