On Sat, 12 Feb 2011 12:13:13 +0100, Dr.Ruud wrote:
> On 2011-02-11 11:26, Alan Haggai Alavi wrote:
>
>> $variable_1 ||= $variable_2 is equivalent to $variable_1 = $variable_1
>> || $variable_2.
>
> Hmm, I don't buy that, I would say that $x ||= $y is equivalent to
>
>$x = $y unless $x;
>
>
On 2011-02-11 11:26, Alan Haggai Alavi wrote:
$variable_1 ||= $variable_2 is equivalent to
$variable_1 = $variable_1 || $variable_2.
Hmm, I don't buy that, I would say that $x ||= $y is equivalent to
$x = $y unless $x;
alternatively:
$x or $x = $y;
because the setting of $x only needs
Hi,
> then that I don't understand is the program logic :-(
It is a logical OR. Quoting `perldoc perlop`:
C-style Logical Or
Binary "||" performs a short-circuit logical OR operation. That
is, if the left operand is true, the right operand is not even
evaluated. Scalar
Hi,
> 12$sheet -> {MaxRow} ||= $sheet -> {MinRow};
Line 12 can be written as:
$sheet->{'MaxRow'} = $sheet->{'MaxRow'} || $sheet->{'MinRow'};
For example:
$variable_1 ||= $variable_2 is equivalent to $variable_1 = $variable_1
|| $variable_2.
The same applies to:
**=+=
> "sw" == shawn wilson writes:
RD> Perl has no proper boolean values. Instead, the boolean operators
RD> treat zero, undef, and the null string '' all as false. Anything else
RD> is true.
sw> to be pedantic, '0' is also false. it isn't exactly the same as 0.
sw> come again with t
RD> Perl has no proper boolean values. Instead, the boolean operators
RD> treat zero, undef, and the null string '' all as false. Anything else
RD> is true.
to be pedantic, '0' is also false. it isn't exactly the same as 0.
come again with that? how is:
$string = 0; #different from
$string =
> "RD" == Rob Dixon writes:
RD> On 11/02/2011 10:38, mailing lists wrote:
12$sheet -> {MaxRow} ||= $sheet -> {MinRow};
>>>
>>> Line 12 can be written as:
>>> $sheet->{'MaxRow'} = $sheet->{'MaxRow'} || $sheet->{'MinRow'};
>>
>>
>> then that I don't understand
On 11/02/2011 10:38, mailing lists wrote:
12$sheet -> {MaxRow} ||= $sheet -> {MinRow};
Line 12 can be written as:
$sheet->{'MaxRow'} = $sheet->{'MaxRow'} || $sheet->{'MinRow'};
then that I don't understand is the program logic :-(
what's the purpose of lines 12 and 14??
Perl has
On Fri, Feb 11, 2011 at 5:38 AM, mailing lists wrote:
>>> 12 $sheet -> {MaxRow} ||= $sheet -> {MinRow};
>>
>>Line 12 can be written as:
>>$sheet->{'MaxRow'} = $sheet->{'MaxRow'} || $sheet->{'MinRow'};
>
>
> then that I don't understand is the program logic :-(
>
> what's the purpose of line
It's the If $sheet->{MaxRow} is false[0], then the value of $sheet->{MinRow}
is assigned to that variable; If it's true, nothing happens.
Same deal with line 14; you canr ead more about the logical-or and other
operators in perldoc perlop[1].
Brian.
[0] http://perldoc.perl.org/perlsyn.html#Truth
>> 12$sheet -> {MaxRow} ||= $sheet -> {MinRow};
>
>Line 12 can be written as:
>$sheet->{'MaxRow'} = $sheet->{'MaxRow'} || $sheet->{'MinRow'};
then that I don't understand is the program logic :-(
what's the purpose of lines 12 and 14??
--
To unsubscribe, e-mail: beginners-unsubscr.
Hello,
for the following program, what is the function of lines 12 and 14 ???
1 #!/usr/bin/perl
2
3 use strict;
4 use warnings;
5 use 5.010;
6 use Spreadsheet::XLSX;
7
8 my $excel = Spreadsheet::XLSX -> new ('Datos RCP 4_2_11-v2.xlsx');
9
10 foreach my $sheet (@{$excel -> {W
12 matches
Mail list logo