Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Reaped: Re: How to print out package code ?

by NodeReaper (Curate)
on Mar 18, 2013 at 20:44 UTC ( [id://1024148]=note: print w/replies, xml ) Need Help??


in reply to How to print out package code ?

This node falls below the community's threshold of quality. You may see it by logging in.
  • Comment on Reaped: Re: How to print out package code ?

Replies are listed 'Best First'.
Re^2: How to print out package code ?
by Martin90 (Sexton) on Mar 18, 2013 at 20:58 UTC
    open MODULE, "perldoc -m Session|" or die "Failed to open pipeline($!) +"; while (<MODULE>) { open(X,"> xxx_dump.txt")|| warn "Fail: ($!)"; print X $_; } close X; close S;
    Unfortunatelly prints out "13695" ;/ What is wrong ?
      You are opening the file for each line, overwriting the previous output. Open it just once before entering the loop.
      لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
        Unfortunatelly, still doesn't work. Now, I am getting empty file ;/
        my @tab; open MODULE, "perldoc -m ModuleX|" or die "Failed to open pipeline +($!)"; open(X,"> xxx_dump.txt")|| warn "Fail: ($!)"; while (<MODULE>) { @tab = split; foreach $_ (@tab) { print X $_; } } close X; close MODULE;
        What is wrong ? Maybe perldoc -m ModuleX doesn't work with used modules ?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1024148]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2024-04-24 09:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found