Re: perl pattern matching

From: Bob Walton (see.sig_at_rochester.rr.com)
Date: 03/12/05

  • Next message: perlmodule_at_gmail.com: "Re: Dirty Arrays and how to clean them up!"
    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
    

  • Next message: perlmodule_at_gmail.com: "Re: Dirty Arrays and how to clean them up!"

    Relevant Pages

    • Re: perl pattern matching
      ... > void hiall() ... > If such old C style function definition exists ... > Seema Rao ... at any time during program execution (generally string, integer, ...
      (comp.lang.perl.misc)
    • perl pattern matching
      ... I am a fresher, learning the Perl programming. ... If such old C style function definition exists ...
      (comp.lang.perl)
    • perl pattern matching
      ... I am a fresher, learning the Perl programming. ... If such old C style function definition exists ...
      (comp.lang.perl.misc)