in reply to Re: Re^2: Function Prototypes and Array vs. List (Pt. 2)
in thread Function Prototypes and Array vs. List (Pt. 2)
sub returns_rtwo { return reverse qw[ foo bar ]; }To cut down on duplication, I'd left them out.
On a regular, unprotyped function, you get your regular 'foo', but a prototyped version of same is a whole different thing.#!/usr/bin/perl -w use strict; sub foo_p($) { print "$_[0]\n" } sub foo { print "$_[0]\n" } sub baz { qw[ foo bar ] } sub zab { reverse baz() } sub bam { return (baz(),zab()) } sub bar { return bam() } foo(bar()); foo_p(bar());
sub bar { return my @foo = bam(); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re^5: Function Prototypes and Array vs. List (Pt. 2)
by Anonymous Monk on Jun 13, 2002 at 15:23 UTC | |
|
Re: Re^5: Function Prototypes and Array vs. List (Pt. 2)
by Anonymous Monk on Jun 13, 2002 at 16:01 UTC |