Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > proto-type sub needs new ribbon ?

Reply
Thread Tools

proto-type sub needs new ribbon ?

 
 
stu7
Guest
Posts: n/a
 
      08-21-2003
+
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 ?
 
Reply With Quote
 
 
 
 
Brian Harnish
Guest
Posts: n/a
 
      08-22-2003
-----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-----

 
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
Death To Sub-Sub-Sub-Directories! Lawrence D'Oliveiro Java 92 05-20-2011 06:50 AM
web application vs windows application (ribbon) jmaycas@hotmail.com ASP .Net 3 05-27-2008 08:22 AM
Recognising Sub-Items and sub-sub items using xslt Ben XML 2 09-19-2007 09:35 AM
Any ASP.NET Ribbon controls? Michael Nemtsev ASP .Net 2 12-08-2006 04:39 AM
Sony Vaio Ribbon Cables Ronald Murray Computer Information 0 12-04-2006 01:29 AM



Advertisments