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

 

About these ads
Tagged

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 64 other followers