This may or may not solve your problem, but....
Name your sub something other than 'ref'. Ref is a reserved word in Perl. (perldoc -f ref for details on what it does) Dave > > > ----------arg.pl--------------- > > > #/usr/plx/bin/perl -w > > > > > > use strict; > > > > > > sub ref > > > { > > > my ($href, $aref) =@_; > > > my (@leftovers); > > > > > > foreach (@$aref) { > > > chomp; > > > if (/^UserID\s+:\s+(\d+)/) { > > > ${$href}{'UserID'} = $1; > > > } elsif (/^SupportGroup\s+:\s+(\d+)/) { > > > ${$href}{'SupportGroup'} = $1; > > > } elsif (/^Assigned To\s+:\s+(\d+)/) { > > > ${$href}{'AssignTo'} = $1; > > > } elsif (/^DateOpened\s+:\s+(\d+)/) { > > > ${$href}{'DateOpened'} = $1; > > > } else { > > > push(@leftovers, "$_\n"); > > > } > > > } > > > return(@leftovers); > > > } > > > > > > my @array; > > > my @remains; > > > my (%hash); > > > > > > open(F_TMP, "/tmp/tfile") || die("Cannot open text file"); > > > @array = <F_TMP>; > > > close(F_TMP); > > > > > > @remains = &ref(\%hash, \@array); > > > print "User ID = $hash{'$UserID'}\n"; > > > print "Remains = " . @remains . "\n"; > > > -----------output------------ > > > User ID = > > > Remains = 2 > > > > > > -- > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > -- > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > -- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]