another thing, i would bet that specifying the -w option would have thrown
an error/warning when you tried to run that code... make sure you try to
always do:
#!/usr/bin/perl -w
use strict; ## mandatory as well! :)
[code]
"dna" <magmalianathotmaildotcom> wrote in message
news:Qr********************@magma.ca...
this problem relates to operator/list precedence with and without
parenthesis.
for a good reference please read through 'perlop' in the perldocs. you
will be enlightened!
good luck
"JamesW" <gi*******@hotmail.com> wrote in message
news:27*************************@posting.google.co m... Sorry if this occurs twice, my nicely typed one just vanished. Anyway
in brief:
I want to store a range in a string, e.g. '2-5'.
I tried $range = $numOne.'-'.$numTwo+1;
And $range stored the sum of $numOne+1!
I got it to work with,
$range = $numOne.'-'.($numTwo+1);
I understand why this works not not why my initial instinct didn't.
Could someone please enlighten me?
Thanks
James