ok, long day, let me write it like it IS
concider:
if ('a' == 'b') { print "foo" } # this will print 'foo', seeing 'a' compared to 'b'
yields '1' even in
numeric context here
(ie, the RETURN value of the compare, not the representation of the characters)
sorry for the confusion and thanks for
On Wed, Jun 27, 2001 at 12:04:53PM -0400, Jeff 'japhy' Pinyan ([EMAIL PROTECTED])
spew-ed forth:
> On Jun 27, Kevin Meltzer said:
>
> >On Wed, Jun 27, 2001 at 11:51:01AM -0400, Chas Owens ([EMAIL PROTECTED]) spew-ed
>forth:
> >> On 27 Jun 2001 17:45:18 +0200, Jos Boumans wrote:
> >> > > How do
On Jun 27, Kevin Meltzer said:
>On Wed, Jun 27, 2001 at 11:51:01AM -0400, Chas Owens ([EMAIL PROTECTED]) spew-ed
>forth:
>> On 27 Jun 2001 17:45:18 +0200, Jos Boumans wrote:
>> > > How do you mean?
>> >
>> > concider:
>> > if ('a' == 'b') { print "foo" } # this will print 'foo', seeing 'a' and
On Wed, Jun 27, 2001 at 11:51:01AM -0400, Chas Owens ([EMAIL PROTECTED]) spew-ed
forth:
> On 27 Jun 2001 17:45:18 +0200, Jos Boumans wrote:
> > > How do you mean?
> >
> > concider:
> > if ('a' == 'b') { print "foo" } # this will print 'foo', seeing 'a' and 'b' both
>yield '1' in numeric
> > con
On 27 Jun 2001 17:45:18 +0200, Jos Boumans wrote:
> > How do you mean?
>
> concider:
> if ('a' == 'b') { print "foo" } # this will print 'foo', seeing 'a' and 'b' both
>yield '1' in numeric
> context here.
You mean 0 not 1 don't you?
>
> however
>
> $x = 'a';
> print $x + 4;
>
> will print
On Wed, 27 Jun 2001, Pierre Smolarek wrote:
> does this all mean that c++ is ACTUALLY D ?
No, c++ is ACTUALLY a pain in the butt to code... :-)
-- Brett
http://www.chapelperilous.net/btfwk/
--
> How do you mean?
concider:
if ('a' == 'b') { print "foo" } # this will print 'foo', seeing 'a' and 'b' both yield
'1' in numeric
context here.
however
$x = 'a';
print $x + 4;
will print '4';
Jos Boumans
> Converting 'a' to a number gives 0.
>
> --
> Paul Johnson - [EMAIL PROTECTED]
> htt
t; <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Wednesday, June 27, 2001 4:38 PM
Subject: Re: Incrementing Strings
> On Wed, Jun 27, 2001 at 06:21:30PM +0200, Paul Johnson ([EMAIL PROTECTED])
spew-ed forth:
> > On Wed, Jun 27, 2001 at 11:07:12AM -0400, Kevin Meltzer wrote:
> >
On Wed, Jun 27, 2001 at 06:21:30PM +0200, Paul Johnson ([EMAIL PROTECTED]) spew-ed forth:
> On Wed, Jun 27, 2001 at 11:07:12AM -0400, Kevin Meltzer wrote:
> >
> > Is that the reason? I would think --'a' would be z, but that is my own
> > internal logic :)
>
> But ++'z' isn't 'a'.
No, it is aa,
On Wed, 27 Jun 2001, Paul Johnson wrote:
> > Is that the reason? I would think --'a' would be z, but that is my own
> > internal logic :)
>
> But ++'z' isn't 'a'.
Technically, you can't do ++'z' because you are modifying a constant...
but autoincrementing a variable whose value is 'z' will make
On Wed, 27 Jun 2001, Paul wrote:
> The auto-decrement operator is not magical.
The Camel Book adds that there are not any plans to make it magical.
-- Brett
http://www.chapelperilous.net/btfwk/
--
On Wed, Jun 27, 2001 at 11:07:12AM -0400, Kevin Meltzer wrote:
> On Wed, Jun 27, 2001 at 10:55:54AM -0400, Jeff 'japhy' Pinyan ([EMAIL PROTECTED])
>spew-ed forth:
> > On Jun 27, Nick Transier said:
> >
> > The perlop documentation says that ++ is magical for strings, but that --
> > isn't. The
--- Nick Transier <[EMAIL PROTECTED]> wrote:
> If I define a variable as a string
> my $var = "a";
>
> I can get the increment to work
> print ++$var; --> prints b
>
> but the decrement
> print --$var --> prints -1
>
> Why? and how can I dec
On Wed, Jun 27, 2001 at 10:55:54AM -0400, Jeff 'japhy' Pinyan ([EMAIL PROTECTED])
spew-ed forth:
> On Jun 27, Nick Transier said:
>
> The perlop documentation says that ++ is magical for strings, but that --
> isn't. The reason is because there's not a clear-cut way of defining it.
>
> What is
On Jun 27, Nick Transier said:
>If I define a variable as a string
>my $var = "a";
>
>I can get the increment to work
>print ++$var; --> prints b
>
>but the decrement
>print --$var --> prints -1
>
>Why? and how can I decrement it?
The perlop documentation says that ++ is magical for strings, but
If I define a variable as a string
my $var = "a";
I can get the increment to work
print ++$var; --> prints b
but the decrement
print --$var --> prints -1
Why? and how can I decrement it?
Thanks,
-Nick
_
Get your FREE download of
16 matches
Mail list logo