is there //= operator?

is there //= operator?

am 03.08.2011 07:32:08 von terry peng

SSBoYXZlIGZvcmdvdCB0aGF0LCBpcyB0aGVyZSBhIC8vPSBvcGVyYXRvciBp biBQZXJsPwp3aGlj
aCBzaG91bGQgZG8gdGhlIHNhbWUgc3R1ZmYgYXM6Cgp1bmxlc3MgKGRlZmlu ZWQoJGZvbykgKSB7
CiAgICAkZm9vID0gLi4uOwp9CgpUaGFua3MuCgo=

Re: is there //= operator?

am 03.08.2011 07:39:22 von Brian Fraser

--bcaec52c5c8d56144c04a99349be
Content-Type: text/plain; charset=UTF-8

On Wed, Aug 3, 2011 at 2:32 AM, terry peng wrote:

> I have forgot that, is there a //= operator in Perl?
> which should do the same stuff as:
>
> unless (defined($foo) ) {
> $foo = ...;
> }
>
> Thanks.
>
>
Yes.

Now wasn't that simple? : ) It's the defined-or, and you can read more about
it on perlop[0]. Do be mindful that in ancient versions of Perl it's not
available; If for whatever reason you are on one of those.. Please update?

[0] http://perldoc.perl.org/perlop.html#C-style-Logical-Defined- Or

--bcaec52c5c8d56144c04a99349be--

Re: is there //= operator?

am 03.08.2011 07:59:54 von Shawn Wilson

--0022158c0589cb2f3b04a9939242
Content-Type: text/plain; charset=ISO-8859-1

On Aug 3, 2011 12:40 AM, "Brian Fraser" wrote:
>
> On Wed, Aug 3, 2011 at 2:32 AM, terry peng wrote:
>
> > I have forgot that, is there a //= operator in Perl?
> > which should do the same stuff as:
> >
> > unless (defined($foo) ) {
> > $foo = ...;
> > }
> >
> > Thanks.
> >
> >
> Yes.
>
> Now wasn't that simple? : ) It's the defined-or, and you can read more
about
> it on perlop[0]. Do be mindful that in ancient versions of Perl it's not
> available; If for whatever reason you are on one of those.. Please update?
>
> [0] http://perldoc.perl.org/perlop.html#C-style-Logical-Defined- Or

Debian stable ( <6 ) was 5.8, so if you're in a shop that uses debian and
likes to test that still might not be available to you.

--0022158c0589cb2f3b04a9939242--

Re: is there //= operator?

am 03.08.2011 08:37:46 von Feng He

Ubuntu 10.04 is Perl 5.10, which has this operator avaiable.


On Wed, Aug 3, 2011 at 1:59 PM, shawn wilson wrote:
> On Aug 3, 2011 12:40 AM, "Brian Fraser" wrote:
>>
>> On Wed, Aug 3, 2011 at 2:32 AM, terry peng wrote:
>>
>> > I have forgot that, is there a //=3D operator in Perl?
>> > which should do the same stuff as:
>> >
>> > unless (defined($foo) ) {
>> >    $foo =3D ...;
>> > }
>> >
>> > Thanks.
>> >
>> >
>> Yes.
>>
>> Now wasn't that simple? : ) It's the defined-or, and you can read more
> about
>> it on perlop[0]. Do be mindful that in ancient versions of Perl it's not
>> available; If for whatever reason you are on one of those.. Please updat=
e?
>>
>> [0] http://perldoc.perl.org/perlop.html#C-style-Logical-Defined- Or
>
> Debian stable ( <6 ) was 5.8, so if you're in a shop that uses debian and
> likes to test that still might not be available to you.
>

--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/