proto-type sub needs new ribbon ?

Discussion in 'Perl Misc' started by stu7, Aug 21, 2003.

  1. stu7

    stu7 Guest

    +
    With Perl 5.6, I'm trying to use prototypes and a new
    subroutine...

    sub testproto($) { subroutine here }

    With this, I tried to use the actual "prototype" call...

    prototype testproto ;
    and I also tried
    print prototype testproto;

    however, the subroutine output seems unaffected regardless of
    what parameters are sent... $a or @Arr... and the prototype command
    doesnt seem to return anything at all.

    Am I using these correctly, or isnt prototyping of this kind
    working in Perl yet ?
    stu7, Aug 21, 2003
    #1
    1. Advertising

  2. -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    On Thu, 21 Aug 2003 14:14:51 -0700, stu7 wrote:

    > +
    > With Perl 5.6, I'm trying to use prototypes and a new
    > subroutine...
    >
    > sub testproto($) { subroutine here }
    >
    > With this, I tried to use the actual "prototype" call...
    >
    > prototype testproto ;
    > and I also tried
    > print prototype testproto;
    >
    > however, the subroutine output seems unaffected regardless of
    > what parameters are sent... $a or @Arr... and the prototype command
    > doesnt seem to return anything at all.
    >
    > Am I using these correctly, or isnt prototyping of this kind
    > working in Perl yet ?


    Try posting some real code so the rest of us can see your exact problem!

    #!perl -wl
    use strict;
    sub mypush(\@@) {return @_}
    print "Version: $]";
    print prototype \&mypush;
    my@x=(1..5);
    print mypush(@x,3,4,5)
    __END__

    I get this:
    Version: 5.006001
    \@@
    ARRAY(0x8100010)345

    Seems to work fine to me.

    - Brian
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.2.2 (GNU/Linux)

    iD8DBQE/RXUciK/rA3tCpFYRAhP1AJ9HpbLEXaOIJmaWaz+FKCUs47jQmACfbKaK
    2ZZcPMmAwOnYtBhwr+6LATM=
    =NAqT
    -----END PGP SIGNATURE-----
    Brian Harnish, Aug 22, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Philippe Guglielmetti
    Replies:
    3
    Views:
    393
    Victor Bazarov
    Oct 22, 2003
  2. Michael Nemtsev

    Any ASP.NET Ribbon controls?

    Michael Nemtsev, Dec 7, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    659
    Mark Fitzpatrick
    Dec 8, 2006
  3. Ben
    Replies:
    2
    Views:
    886
  4. Replies:
    3
    Views:
    546
    Munna
    May 27, 2008
  5. Lawrence D'Oliveiro

    Death To Sub-Sub-Sub-Directories!

    Lawrence D'Oliveiro, May 5, 2011, in forum: Java
    Replies:
    92
    Views:
    2,024
    Lawrence D'Oliveiro
    May 20, 2011
Loading...

Share This Page