Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re: Modules of Formats

by broquaint (Abbot)
on Oct 01, 2002 at 11:00 UTC ( #201967=note: print w/replies, xml ) Need Help??

in reply to Modules of Formats

I think the only real problem that you might encounter is copying the actual formats about. The problem is that there's no way of directly copying them unlike the other data types e.g
format foo = . { package mypkg; *form_foo = *main::foo; *form_ref = *form_foo{FORMAT}; } use Devel::Peek; Dump(*main::foo); Dump(*mypkg::form_foo); Dump(*mypkg::form_ref); __output__ SV = PVGV(0x80f9c78) at 0x8100de8 ... FORM = 0x80fd4e4 SV = PVGV(0x80f9dc0) at 0x8100e24 ... FORM = 0x80fd4e4 SV = PVGV(0x8101820) at 0x8100e3c ... FORM = 0x0
So you'll have to end up exporting entire globs into the given packages, which isn't ideal.


update: changed FORM to FORMAT

Replies are listed 'Best First'.
Re^2: Modules of Formats
by Anonymous Monk on Nov 11, 2012 at 14:27 UTC

    In the year 2012-11-11 with the perl v5.12.2/v5.14.1 it does work

    $ perl 2>&1 |grep FORM FORM = 0x99aa4c FORM = 0x99aa4c FORM = 0x99aa4c

    Still doesn't quite work in v5.8.9

    FORM = 0x182fa08 FORM = 0x182fa08 FORM = 0x0

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://201967]
[karlgoethebier]: Discipulus: Perhaps i should add some more of these idiots to my sig?
[karlgoethebier]: Discipulus: There are countries were people get imprisoned for things like this...
[1nickt]: Are there enough bytes for all the idiots you would need to include?
[choroba]: I find it more entertaining to have something clever there
[Discipulus]: ys Karl i know; there are also children who die in mines where precious metals for phones are taken
[Discipulus]: 1nickt for sure no! post has 64k limit..
[1nickt]: Until recently I had a sticker on my truck (in NJ) "Keep the immigrants. Deport Trump."
[Discipulus]: i'm just talking about what is appropriate to have here at PM, and I have no a solution but just some thougths
[1nickt]: But I removed it when I travelled to somewhere more, er ... red. Why? Because I thought how stupid I would feel ...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (8)
As of 2017-06-22 12:02 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (519 votes). Check out past polls.