[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] perl line pls



At 08:19 -0800 10/27/98, George Cingolani wrote:
>would anyone be kind enough to tell me what is wrong with this line...
>
><blockquote>
>print  "$hi{$input{'language'}}, $input{'name'} .
>$how{$input{'language'}}?\n";
></blockquote>
>
>it just won't compile no matter how I cut it :-(

Disregarding the "<blockquote>"s (you aren't really handing THEM to Perl,
are you?), it looks like you are trying to print the following:

  print $hi{$input{'language'}},
        $input{'name'} . $how{$input{'language'}} . "?\n";

My feeling, however, is that print() gets a bit awkward for such
convoluted output.  I might use, instead:

  printf("%s %s%s?\n", $hi{$input{'language'}},
    $input{'name'}, $how{$input{'language'}});

But then, as pudge would affirm, my Perl looks a lot like C...

-r

Rich Morin:          rdm@cfcl.com, +1 650-873-7841, http://www.ptf.com/~rdm
Prime Time Freeware: info@ptf.com, +1 408-433-9662, http://www.ptf.com
MacPerl: http://www.ptf.com/macperl,   http://www.ptf.com/ptf/products/MPPE
MkLinux: http://www.mklinux.apple.com, http://www.ptf.com/ptf/products/MKLP



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch