#!/bin/perl5 use strict; use warnings; my @vars = qw( first second third fourth fifth sixth ); my @aarr = ('<chap', '<book', '<isb'); my %out; # hash to hold output my $i = 0; for (@aarr) { $out{$vars[$i]} = $_; $i++; } print "$out{first}\t$out{second}\t$out{third}\n"; __DATA__ ---------- Capture Output ---------- > "c:\perl\bin\perl.exe" _new.pl <chap <book <isb > Terminated with exit code 0.
In reply to Re: Assigning value to the array elements
by wfsp
in thread Assigning value to the array elements
by anniyan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |