Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

comment on

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

Thank you. I was thinking about taking this road, using eval to switch package. I can't goto &$sub to erase the current stack frame, because I need to do the track housekeeping after the open, and record the (possible mutated) $_[0]. OTOH... thinking about it, I could switch package in that eval'ed sub again and do the housekeeping there. To that end, the %fh fieldhash must be a package var. Oh well.

Currently, I am inspecting $_[0] with Devel::Caller etc. to find out whether the filehandle variable is lexical, package global, typeglob, bareword etc and trying to do the right thing. Anyways the overridden open would show up in the stack trace of Carp::cluck, so another stack frame wouldn't matter I guess. But with Sub::Name I could make that sub into the calling package. Maybe that's the best way to do it. It is definitely the cheapest in effort :-) update: and maybe the most robust also...

Thanks again, salva!

perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'

In reply to Re^6: Track open file handles by shmem
in thread Track open file handles by shmem

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 studying the Monastery: (3)
As of 2024-03-29 01:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found