Combine, Put Two Arrays Together in Perl
@ji=("Hello","Hi");
@hu=("Bye","Seeya");
@ko=(@ji, @hu);
print @ko;
Which Prints:
HelloHiByeSeeya
-We
created an array and named it
ji because typing
ji is fun.
-We created an array and named it
hu because typing
hu is even easier than typing
ji.
-We created the array
ko and stored the results of combining @ji and @hu.
-We
printed our new array.
Copy and Paste Perl Code:
#!/usr/bin/perl
print "Content-type:text/html\n\n";
@ji=("Hello","Hi");
@hu=("Bye","Seeya");
@ko=(@ji, @hu);
print @ko;
exit;
Resources:
Create or Put Items into an Array in Perl
Use the Perl PRINT FUNCTION