b chen wrote:
i am completely new to perl, can you explain to me the following line of
code in red.

There is no red here, there is only black and white.


how does this line of code grab a time value and assign it to $ time,

how does assigment happend in this conditiona statement.



while (<>)
{
 chop;

Better to use chomp instead of chop.


 # Grab the time
 next unless ($time) = /(\d+:\d+:\d+\,\d+)/;

The capturing parentheses in the regular expression return their contents in list context and the parentheses around the variable $time define a list context with a single lvalue.



John
--
Those people who think they know everything are a great
annoyance to those of us who do.        -- Isaac Asimov

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


Reply via email to