Wagner-David wrote:
> 
> I have the following snippet of code:
> 
>        my $auditt = backtick("Type $qvmin");
>        foreach ( @$auditt ) {
>           printf "$_\n";
>         }
>         This will print out what I expect.
> 
>         Now I want to do two actions and then print it out and I know that I
> am doing it wrong, but unsure what the following code should be to get the
> output of both "type xxxx" to print within one foreach? Or how do I bring
> together the output.
>        my $sauditt = backtick("Type $qvmin");
>        $auditt = $sauditt;
>        $sauditt = backtick("Type $qvmdata");
>        $auditt .= $sauditt;
> 
>        foreach ( @$auditt ) {
>           printf "$_\n";
>         }
> 
>         Sorry if not clear, but unsure how to ask the question?

One approached would be to use a hash of lists:

my %hol = ();
my @keys = qw($qvmin $qvdata);

foreach (@keys) {
    $hol{$_} = backtick("Type $_");
}

// now print out the results
foreach (@keys) {
    print "$_: \n";
    print(join("\n\t", @{$hol{$_}}));
}


Ian


-- 
99 little bugs in the code, 99 bugs in the code.
Fix one bug, compile again, 100 little bugs in the code.
100 little bugs in the code, 100 bugs in the code.
Fix one bug, compile again, 101 little bugs in the code...

---
You are currently subscribed to perl-win32-users as: [archive@jab.org]
To unsubscribe, forward this message to
         [EMAIL PROTECTED]
For non-automated Mailing List support, send email to  
         [EMAIL PROTECTED]

Reply via email to