From: Paul Jakma (paul at domain clubi.ie)
Date: Wed 11 Sep 2002 - 08:40:37 IST
On Tue, 10 Sep 2002, kevin lyda wrote:
> awk is a subset of perl.
really? :)
> the scalar variable "m" has the scalar variable _ appended to it.
ah. of course.. doh! just so obvious.
> i'm using the -n flag to perl which has it implicitly loop over the
> input. without -n the loop could be written like so:
>
> while ($line = <>) {
> $m = $m . $line;
> }
that's at least intelligible.
> > > $s{$s=$1}=1;
> > urg.... that is just sick. :)
>
> how? the hash part
yes. cute, but still sick somehow.
> interestingly enough similar code in perl and c give different results:
>
> % perl -ne 'END {$a=3;printf "%d %d %d\n", $a, $a=5, $a}' /dev/null
> 5 5 5
> % cat foo.c
> main(){int a=3;printf("%d %d %d\n", a, a=5, a);}
> % ./foo
> 5 5 3
>
> of course that's all related to order of evaluation.
yep. though the latter order seems more natural to me.
> better?
not really.
> kevin
regards,
-- Paul Jakma paul at domain clubi.ie paul at domain jakma.org Key ID: 64A2FF6A warning: do not ever send email to spam at domain dishone.st Fortune: Practical people would be more practical if they would take a little more time for dreaming. -- J. P. McEvoy
This archive was generated by hypermail 2.1.6 : Thu 06 Feb 2003 - 13:18:47 GMT