Hi all, Is there anything in perl to declare a variable volatile...I need the value of a variable to change immeadiately when I change.help out pls.

Recommended Answers

All 5 Replies

variables always change when you redefine them or use operators or functions on them. Not sure what your question is.

Actually a variable will stay in register for a while and then be put in memory..I need the memory location to change immediately when I change the variable.(Like volatile variable in C)

I don't know how to do that in perl or why you would even need to do it but I assume you know why and have a legitimate reason. Maybe someone else will know.

comment removed, irrelevant.

I would suggest searching www.cpan.org for some memory management module that might provide this functionality. Even if it is possible from straight perl, it is probably complicated or convoluted and a module from CPAN would probably make it a bit simpler to use (or at least let you study it to find out how to do it on your own).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.