in reply to String contents

Hi, How do I print out the contents of a string, not just words and numbers, but also white space, newline, and anything in that string. Thanks,

print doesn't care what its printing, it will happily print anything

Maybe you want to use Data::Dump?

Replies are listed 'Best First'.
Re^2: String contents
by perlyr (Novice) on Jun 29, 2012 at 07:17 UTC
    you are right, I wanted to print out the string structure. If I know the structure, then I could extract it. Any other suggestions?
      use strict; use warnings; use Data::Dumper; #do some stuff that generates a structure called $struct->stuff print Dumper($struct->stuff);

      or if you want a structure more stringified, use Data::Dump as already mentioned

        still not sure how to use it. Assumer my variable is $var, and my output filehandle is OUTFILE.When I tried the following, it failed. print Dumper($struct->stuff); print OUTFILE "stuff\n";

      you are right, I wanted to print out the string structure. If I know the structure, then I could extract it. Any other suggestions?

      About what? Read How do I post a question effectively?