Perl Monk, Perl Meditation | |
PerlMonks |
Re^3: How to write macro in perlby McDarren (Abbot) |
on Jan 11, 2008 at 18:24 UTC ( [id://661943]=note: print w/replies, xml ) | Need Help?? |
mihirjha,
I'm afraid that I'm still not clear about what it is that you are trying to do. You mention checking whether or not a variable is defined. Well, Perl has an inbuilt function for this, called defined. A very simple example of its usage is as follows: Which prints:
You also mention that you want to track the value of a variable. The easiest way to do this is with print, or perhaps something like Data::Dumper. If, as apl suggests, you are new to Perl and want to learn, then I would suggest that a good place to start would be the Tutorials section of the Monastery. In any case, welcome to PerlMonks. Darren :)
In Section
Seekers of Perl Wisdom
|
|