Nathan Wiger wrote:
> Intermingling it freely:
>
> my Dog $spot;
> int x;
> my int $y;
> #include <sys/types.h>
> char * name;
> #do some regexp matching
> s/x/5/; /* match the C value of x defined above */
>
> Is really confusing, even for us humans. :-)
>
> -Nate
Is it confusing? I have no trouble with it at all. the scalar
of the perl typeglob named "spot" is a "Dog" type, bareword "x"
is a C int type, the scalar of the perl typeglob named "y" is a "int"
type (which may or may not be the same as the C int type, to be determined
one way or the other, as yet unknown), all the types in the standard C
include file sys/types.h have been defined in the current package,
the bareword "name" is a C pointer which is going to be expected to refer
to char, AKA raw, bytes, a line starting "#do " does not match any known
C preprocessor commands and is therefore a perl comment, and
s/x/5/; # this is still going to replace
# all the eckses in $_ with fives.
To test if x is five or not, something like this would be in order:
if( x == 5){ ... // slack
--
David Nicol 816.235.1187 [EMAIL PROTECTED]
perl -e'@w=<>;for(;;){sleep print[rand@w]}' /usr/dict/words