Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > perl pattern matching

Reply
Thread Tools

perl pattern matching

 
 
seema
Guest
Posts: n/a
 
      03-12-2005
hi all,

I am a fresher, learning the Perl programming.
I have got a problem i just want to match old
C style function definition,
for example,
void hiall()
int k,j,l,m;
char *dare;
{
//BODY OF THE FUNCTION
}
If such old C style function definition exists
then i just need that function name. Hope somebody will
help a chinless wonder like me

Seema Rao
 
Reply With Quote
 
 
 
 
Bob Walton
Guest
Posts: n/a
 
      03-12-2005
seema wrote:

....

> I have got a problem i just want to match old
> C style function definition,
> for example,
> void hiall()
> int k,j,l,m;
> char *dare;
> {
> //BODY OF THE FUNCTION
> }
> If such old C style function definition exists
> then i just need that function name. Hope somebody will
> help a chinless wonder like me
>
> Seema Rao


Please read:

perldoc perlsub

In Perl, functions are "sub"'s, and variables are declared with
"my". So it would go something like:

use warnings;
use strict;
#...
sub hiall{
my $k,$j,$l,$m,$dare;
#pick up incoming arguments if any from array @_
#do stuff
#return a value with the "return" statement, or
#otherwise return the value of the last statement
#executed
}
#...

Note that the type of value a variable may hold is not defined
ahead of time in Perl. Any variable may take on any valid value
at any time during program execution (generally string, integer,
floating point, filehandle, dirhandle, or reference, with
automatic conversion).

HTH.

--
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.pl
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with Pattern matching. Matching multiple lines from while reading from a file. Bobby Chamness Perl Misc 2 05-03-2007 06:02 PM
[perl-python] text pattern matching, and expressiveness Xah Lee Python 4 02-11-2005 09:11 PM
[perl-python] string pattern matching Xah Lee Python 9 02-02-2005 11:43 AM
Perl Pattern Matching-- Newbie Vandana Perl Misc 4 01-19-2004 11:21 PM
Pattern matching : not matching problem Marc Bissonnette Perl Misc 9 01-13-2004 05:52 PM



Advertisments