Piping a really large variable dump to a file

Sometimes I’m looking at a really large variable dump in the perl debugger and I want to be able to look at it in something with more control.

To view the dump in less simply add a | in front of the dump command.  For example,

| x $var

If the control less gives you isn’t enough you can then use that to dump it to a file by doing this from less,

|$ cat > var_dump.txt

 

Leave a comment