Marvin Bonilla wrote: > The first line has the hour that this report was origined, the > information that I need is the line where appears "Acct-Session-Time = > 5275" but just from the 08:00 to 19:00, and them sum the numerical > value. > > I can get the hour (with while and split functions) but once I get > that I do not how to read their "Acct-Session-Time" belong to this > hour. > > So I need a cue that tell me with which function I can read any > numbers of line before o after a match is found or some idea about how > I can do that.
What you want are the range operators ( .. ) and ( ... ). http://www.perldoc.com/perl5.6.1/pod/perlop.html#Range-Operators Something like this might do what you want. $begin = "08:00:"; $end = "19:00:"; while (<>) { if ( /$begin/ ... /$end/ ) { #do something with Acct-Session-Time } } > The other question is "Do Someone know some URL I can get excercises > to practice perl programing since beginners level?? http://www.perlmonks.org/index.pl?node=Tutorials http://bookmarks.cpan.org/ http://www.perldoc.com/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]