Setting values to feed example() and printing inside the function works. You are courting trouble by reusing $scalar1 and friends as names in the sub and not making them lexical with my.
Please say what the symptoms of 'not working' are, and show how the variables are declared and assigned.
$ cat pit.pl
#!/usr/bin/perl --
use strict;
use warnings;
my $scalar1 = 'foo';
my $scalar2 = 'ferall';
my @info1 = ( 0..10 );
&example($scalar1, $scalar2, @info1);
sub example {
$scalar1 = shift;$scalar2 = shift;@info1 = @_; # bad
# prefer lexical scope, ought not to reuse names
# my ($scalar1, $scalar2, @info1) = @_;
print $scalar1,$/;
print $scalar2,$/;
print @info1,$/;
# .....
}
$ ./pit.pl
foo
ferall
012345678910
$
After Compline, Zaxo |