How can I use macros in Perl?

前端 未结 4 1314
一生所求
一生所求 2021-01-01 05:36

How do I use macros in Perl, like I do in C?

Example:

#define value 100 
print value; 

I want to get the output as 100.

4条回答
  •  难免孤独
    2021-01-01 06:02

    Perl is not C. You would be much better served by learning the corresponding Perl idioms (such as the already mentioned use constant value => 100) than by trying to drag C idioms into Perl.

提交回复
热议问题