473,505 Members | 13,982 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

looking for perl synonym to #define in C/C++

51 New Member
Hello,
i'm looking for the equivalent perl symbol that match #define in C/C++
anybody have an idea if any such feature exists ...

thanks,
Jul 15 '08 #1
5 3303
numberwhun
3,509 Recognized Expert Moderator Specialist
If I remember right, #define is a way of defining a subroutine in C++. If that is the case, then the 'sub' keyword is what you are looking for.

Regards,

Jeff
Jul 15 '08 #2
zcabeli
51 New Member
Hi,

#define used as macro in C. it's simply replace the first argument with the string represented by the second argument. format type is as follows :

definition :
#define ABC(X,Y,Z) BLA(X) + BLA(Y) + BLA(Z)
#define FIVE 5

usage :
ABC(5,2,1) = BLA(5) + BLA(2) + BLA(1)
x = 1 + FIVE
Jul 16 '08 #3
numberwhun
3,509 Recognized Expert Moderator Specialist
One of my fellow colleagues will correct me if I am wrong, but I don't think there is anything similar to that in Perl. Like I said, you could create a subroutine that does what you expect, but I don't know if what you want is available. Then again, not knowing C/C++, comparison is somewhat hindered, sorry.

Regards,

Jeff
Jul 16 '08 #4
zcabeli
51 New Member
thanks for the help.
Jul 16 '08 #5
nithinpes
410 Recognized Expert Contributor
You can have a look at Text::Macroscript module which provides macro pre-processor.
Jul 17 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
1671
by: Xah Lee | last post by:
© # -*- coding: utf-8 -*- © # Python © © # in Python, one can define a boxed set © # of data and functions, which are © # traditionally known as "class". © © # in the following, we define a...
41
3496
by: Xah Lee | last post by:
here's another interesting algorithmic exercise, again from part of a larger program in the previous series. Here's the original Perl documentation: =pod merge($pairings) takes a list of...
0
2282
by: DP | last post by:
(2nd post, I think my first may have been to the wrong group - sorry) Hello Perl-ers - I´m hoping I can get some help here, because I'm very lost. Don't know Perl, I'm not a programmer. And...
3
3440
by: David F. Skoll | last post by:
Hi, I'm tearing my hair out on this one. I'm trying to embed a Perl interpreter into a C program. I need to be able to create and destroy the interpreter periodically, but will never actually...
0
1949
by: gary artim | last post by:
Hi All, I have a problem using DBIx::RecordSet. I get correct results but continue to get these messages on stderr. I looked at Compat.pm and it seems to be pointing out a problem with my call...
3
2423
by: Pat Deegan | last post by:
Greetings, I've been having issues while debugging programs. The problems only appear when using the '-d' switch and I get the impression it has to do with UTF8 and regex matching but I don't...
4
6433
by: banz | last post by:
Hello I have a problem to resolve: I wrote a Perlscript which caches data from a server (local on my machine) I would like to have a other connection to a remote server but I don't know how to...
7
3555
by: keyser soze | last post by:
hi i have a stored proc, pointed by a synonym i wish to execute it vía: cmd.commandType= adStoredProc cmd.commandText= "s_MyStoredProc" cmd.parameters.refresh ---to get the collection the...
21
34324
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Uploading files from a local computer to a remote web server has many useful purposes, the most...
0
7098
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7366
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7017
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5610
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5026
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4698
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3176
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
754
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
406
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.