Hi Gurus,

I am trying to get tidy with my scripts and want to use Strict but am 
having difficulty with return values from subroutines. I have the 
following snippet:

  while (defined(my $i =<$fh>)) {
    chomp($i);
    my @a = split(/|/,$i);
    my $last = $a[1];
    my $first = $a[0];
    if ( $name =~ /$last/i ) {
          return($first,$last);
    }
 and get the error:
Global symbol "$last" requires explicit package name at 
/var/www/perl/reply.pl line 16.

When I later:  print "Hello $first $last\n";

I know it is out of the scope but I thought I could pass the results of 
a sub to main.

What am I doing wrong??
Dp.
 

 
~~
Dermot Paikkos * [EMAIL PROTECTED]
Network Administrator @ Science Photo Library
Phone: 0207 432 1100 * Fax: 0207 286 8668


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to