I'm sure there is a pretty solution with map but this is what i came up with. Using sprintf makes it easier to switch formatting as required.
#!/usr/bin/perl
use warnings;
use strict;
my @Code = (404,408);
my @Portal_Name = ("http://software.com","http://yahoo.com");
my @Text = ("Not found","Request Timeout");
for my $i ( 0 .. $#Portal_Name ) {
$Portal_Name[$i] = sprintf "%s %s %s\n", $Code[$i], $Portal_Name[$
+i], $Text[$i];
}
for( @Portal_Name ) {
print;
}
And the output is:
C:\Code>perl array_cat.pl
404 http://software.com Not found
408 http://yahoo.com Request Timeout