Perl/Shell Knowledge Sharing
Perl Interview Questions and Answers
Tuesday, December 28, 2010
Use array references with the array operators in Perl
#Use array references with the array operators
my $ref = [ qw(Buster Mimi Ginger Ella) ];
sub get_dogs { [ qw(Nicki Addy) ] }
push @$ref, 'Addy';
print "Pets are @$ref\n";
my $dog = shift @{ get_dogs() };
print "Dog is $dog\n";
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment