Re: perl pattern matching
From: Bob Walton (see.sig_at_rochester.rr.com)
Date: 03/12/05
- Previous message: seema: "perl pattern matching"
- In reply to: seema: "perl pattern matching"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 12 Mar 2005 17:02:03 GMT
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
- Previous message: seema: "perl pattern matching"
- In reply to: seema: "perl pattern matching"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|