Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Win32::Sound constants are weird (autoloaded, not actual constants)

by beech (Parson)
on Dec 16, 2017 at 02:18 UTC ( [id://1205642]=note: print w/replies, xml ) Need Help??


in reply to Win32::Sound constants are weird

Hi,

Those don't look to be actual constants in the perl sense(empty prototype)/use constant

$ perl -MO=Deparse -MWin32::Sound -e " print Win32::Sound::SND_NODEFAU +LT & Win32::Sound::SND_ASYNC " use Win32::Sound; print Win32::Sound::SND_NODEFAULT(&Win32::Sound::SND_ASYNC); -e syntax OK

Its one of the reasons I tend to always use () for anything called constants in the docs

$ perl -MWin32::Sound -e " print Win32::Sound::SND_NODEFAULT() & Win3 +2::Sound::SND_ASYNC() " 0

update: after looking at the source, I see they're also autoloaded using some old ExtUtils::Constant code ... and there is a warning about that in https://metacpan.org/pod/Exporter#AUTOLOADed-Constants

You might wish to report this bug to rt://Win32-Sound, all that autoload stuff for 20 constants seems like it belongs in the past :)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2024-04-25 21:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found