If this is your first visit, be sure to check out the FAQ by clicking the link above.
You may have to register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.
I am rather new to Perl. Can someone tell me what this line is doing?
Code:
if (($hh, $mm) = ($newdi{$dlr}{p_difexpectedtime} =~ /(\d+):(\d+)/))
It's seeing if $newdi{$dlr}{p_difexpectedtime} matches a pattern of one or more digits (\d+) followed by a colon followed by one or more digits. If the match is true the values of the digits are stored in pattern memory which is what the () are for in the regexp ($1 and $2 respectively) and those values are passed as a list and stored in the two scalars on the left side of the = sign. $hh will hold the first (\d+) found in the string ($1) and $mm will hold the second (\d+) found in the string ($2).