On Thu, Jul 26, 2012 at 12:44 PM, Mikhael Goikhman <[email protected]>wrote:

> On 26 Jul 2012 10:34:27 +0300, sawyer x wrote:
> >
> > On Thu, Jul 26, 2012 at 8:29 AM, Shmuel Fomberg <[email protected]
> >wrote:
> > >
> > > You probably know that the construct:
> > > my <variable> = <something> if <condition>;
> > > is problematic.
> >
> > I never had such lines, probably because I never found it readable.
> > I write
> > if ( my $variable = <something ) {
> >     ..
> > }
> >
> > But if numbers are involved I'll probably write:
> > my $number = <something>;
> > if ( defined $number ) {
> >     ...
> > }
>
> These code samples are very different from what Shmuel wrote,
> because they do not use <condition>.
>

Whoops! Missed that one.

my $variable = <condition> ? <something> : '';

Ah, there we go! :)
Thanks!
_______________________________________________
Perl mailing list
[email protected]
http://mail.perl.org.il/mailman/listinfo/perl

Reply via email to