>>>>> "MS" == Malesha, Sachin <[email protected]> writes:
MS> Below is one way to do it.
if you are going to help, please cover most of the weaknesses of the
code and there are many.
MS> #!/usr/bin/perl
MS> use strict;
use warnings as well
MS> sub func {
poor sub name. names are important, even in test cases
MS> my %list;
MS> $list{"map"} = "key";
MS> $list{"l"}="j";
others have shown how to declare and initial in one statement. it should
be done that way.
MS> my @arr;
MS> push @arr,"egg";
MS> push @arr,"hell";
same here. that is wasteful and clunky code.
MS> return (\%list, \@arr);
MS> }
MS> my ($hashref, $arrref) = &func();
others have said not to call subs with & so don't do it. there are
several reasons why.
MS> To unsubscribe, e-mail: [email protected]
MS> For additional commands, e-mail: [email protected]
MS> http://learn.perl.org/
MS> --
MS> To unsubscribe, e-mail: [email protected]
MS> For additional commands, e-mail: [email protected]
MS> http://learn.perl.org/
and you need to learn to bottom post and to trim quoted posts. i left
both footers to show you some of what you left behind.
uri
--
Uri Guttman ------ [email protected] -------- http://www.sysarch.com --
----- Perl Code Review , Architecture, Development, Training, Support ------
--------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/