Perl/Shell Knowledge Sharing
Perl Interview Questions and Answers
Monday, January 17, 2011
repetation operator
print 'Ma' x 8;
print "\n\n";
print 123 x 3;
print "\n\n";
@abc = qw(a b c);
@abc = @abc x 5; #take length of array. ie 3 is printed in 5 times
print "@abc";
print "\n\n";
@abc = qw(a b c);
@abc = (@abc) x 5;
print "@abc";
print "\n\n";
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment