Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

I just wrote a one-off script to filter the output, and it shrank the output down to about 10,000 lines, much improved. The basic idea is just to look for modules I care about and forbid some commonly occuring but unhelpful methods like BEGIN, AUTOLOADS, etc. Obviously the code isn't very generalizable but I wonder if the problem is more commonly encountered. I'd like it if the -T option took some options on what to display and what to omit.

use strict; use warnings; setpriority(0, 0, 19); my ($dir, $forbidden_str, $in_file, @modules, $module_str, $out_file); $dir = "$ENV{HOME}/lib/Workflow"; $in_file = "$dir/DEBUG.txt"; $out_file = "$dir/FILTERED.txt"; opendir(DIR, $dir); foreach my $file (readdir(DIR)) { if ($file =~ /^(\w+)\.pm$/) { push (@modules, $1); } } closedir(DIR); $forbidden_str = 'BEGIN|DESTROY|AUTOLOAD'; $module_str = join('|', @modules); open(IN, $in_file); open(OUT, ">$out_file"); while(<IN>) { if ($_ =~ $module_str && $_ !~ /$forbidden_str/) { print(OUT $_); } } close(IN); close(OUT);

Update: actually using the $dir variable for it's intended purpose :)


"The dead do not recognize context" -- Kai, Lexx

In reply to Re: Simplifying dprofpp Output by djantzen
in thread Simplifying dprofpp Output by djantzen

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2024-04-19 23:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found