[Melbourne-pm] Important whitespace

Sisyphus sisyphus1 at optusnet.com.au
Thu Oct 12 01:31:14 PDT 2006


----- Original Message ----- 
From: "Jacinta Richardson" <jarich at perltraining.com.au>
To: "Melbourne Perlmongers" <melbourne-pm at pm.org>
Sent: Thursday, October 12, 2006 6:09 PM
Subject: [Melbourne-pm] Important whitespace


> Most of the time we say that Perl doesn't care about white space.  We all
know
> that *sometimes* it does, for example:
>
> print "$a [0]";
>
> is not the same as:
>
> print "$a[0]";
>
> but that seems pretty easy to grasp and most people go on believing that
by and
> large white space doesn't matter.
>
> So, can you guess (before running it) what happens with the following
code?
>
> $a = 10;
> $b = 20;
> print $a +$b;
>
> how about:
>
> use warnings;
> use strict;
>
> my $c = 10;
> my $d = 20;
> print $c +$d;
>
> Cute huh?  All the best,
>

Heh ... you been perusing perlmonks SOPW, too ? (
http://www.perlmonks.org/index.pl?node_id=577561 )

It's interesting that the op there was thinking in terms of "hidden secrets"
(perhaps the op was being sarcastic .... not sure), whereas I'm thinking in
terms of "hair removal" :-)

Cheers,
Rob



More information about the Melbourne-pm mailing list