in reply to Re^2: How can I use the values which is passed as arguments?
in thread How can I use the values which is passed as arguments?
subroutine prototypes in Perl are much discussed because generally using them is a bad idea. For a recent discussion see subroutine prototypes still bad?.
The bottom line is: don't do that. And a follow up line is: Always use strictures (use strict; use warnings;).
Instead of using prototypes consider:
use strict; use warnings; my $str = 'Welcome'; my @array = qw(to the world of); serious ($str, \@array, 'Perl'); sub serious { my ($str, $arrayRef, $constStr) = @_; print join (' ', $str, @$arrayRef, $constStr), ".\n"; }
Prints:
Welcome to the world of Perl.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: How can I use the values which is passed as arguments?
by anbutechie (Sexton) on Mar 10, 2009 at 08:27 UTC |