in reply to Functions (Return V Print)
$title does not exist outside of the sub.
You get warnings about this if you Use strict warnings and diagnostics or die
And off to read perlintro/perlsub (or Tutorials) you go
#!/usr/bin/perl -- use strict; use warnings; sub many { return @_ } my $one = many( 6 .. 12); my @all = many( 16 .. 18 ); my (undef, $second) = many( 26 .. 28 ); print " one $one all @all some $second "; __END__ one 7 all 16 17 18 some 27
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Functions (Return V Print)
by packetstormer (Monk) on Feb 04, 2011 at 10:35 UTC | |
by Anonymous Monk on Feb 04, 2011 at 11:26 UTC | |
by cjb (Friar) on Feb 04, 2011 at 11:05 UTC | |
by cjb (Friar) on Feb 04, 2011 at 11:22 UTC | |
by jethro (Monsignor) on Feb 04, 2011 at 14:10 UTC |