|
Posted by jl_post@hotmail.com on October 22, 2007, 5:35 pm
Please log in for more thread options wrote:
>
> print eval("my " . Dumper($s)); # prints =E2=98=BA
>
> (The "my " part is to suppress a warning given because the output's
> "$VAR1" is caught by "use warnings;" and "use strict;". Optionally,
> you may remove that part by using the following lines instead:
>
> # Remove the "$VAR1 =3D " part with substr():
> print eval( substr(Dumper($s), 8) );
>
> Either way should work.)
Jason, I just now figured out (by reading "perldoc Data::Dumper")
that the "$VAR =3D " part can be suppressed by setting
$Data::Dumper::Terse to 1. Therefore, you could add the following two
lines to the end of your script:
$Data::Dumper::Terse =3D 1; # to suppress "$VAR1 =3D "
print eval Dumper($s); # prints =E2=98=BA
and you'll see that, although Dumper may not output text in the form
you want, eval()ling the output text does return it in the form you
want.
-- Jean-Luc
|