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

Re^3: use fields;

by Corion (Patriarch)
on Nov 23, 2004 at 08:12 UTC ( [id://409830]=note: print w/replies, xml ) Need Help??


in reply to Re^2: use fields;
in thread use fields;

Re-reading the documentation, Perl 5.8.x still uses the pseudo-hash implementation, so I guess you will have to temporarily switch off the warnings for that section of code:

my $self = do { no warnings 'deprecated'; fields::new($class); };

Replies are listed 'Best First'.
Re^4: use fields;
by nite_man (Deacon) on Nov 23, 2004 at 08:28 UTC

    I know that. It worryes me that after month or year Perl developers team will decide to forbid using pseudo hashes.

    So, I'm trying to find a way to produce a good code, probably without problems in the future.

    ---
    Michael Stepanov aka nite_man

    It's only my opinion and it doesn't have pretensions of absoluteness!

      Did you read the documentation for the fields pragma? It specifically mentions the differences between the pseudo-hash version for 5.8.x and lower, and the pseudo-hash free version for 5.9.x and higher. This distinction is made because, in 5.9.x and higher, pseudo-hashes will be gone. So, as long as you use fields;, and use fields::new, you should be safe, according to the documentation.

        And using fields::new is supposed to make the warning go away in most circumstances.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (5)
As of 2024-04-23 20:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found