Mar 10, 2007 #1 Yarka Technical User Joined Jan 14, 2007 Messages 192 Location ES Hi, I've my script as: my $aa = "aa"; while (<>){ if (/^(\d+)\t$aa\t.*?\t(\d+:\d+)\t/) { ... } ... } After if (/^(\d+)\t$aa\t.*?\t(\d+:\d+)\t/), I need to take out data to the next line of the input's file. How can I go next line on Perl? Thanks.
Hi, I've my script as: my $aa = "aa"; while (<>){ if (/^(\d+)\t$aa\t.*?\t(\d+:\d+)\t/) { ... } ... } After if (/^(\d+)\t$aa\t.*?\t(\d+:\d+)\t/), I need to take out data to the next line of the input's file. How can I go next line on Perl? Thanks.
Mar 11, 2007 #2 mbrooks Programmer Joined Apr 19, 2006 Messages 676 Location US Code: my $aa = "aa"; while (<>){ next if ( /^(\d+)\t$aa\t.*?\t(\d+:\d+)\t/ ); # parse line } M. Brooks http://mbrooks.info Upvote 0 Downvote
Code: my $aa = "aa"; while (<>){ next if ( /^(\d+)\t$aa\t.*?\t(\d+:\d+)\t/ ); # parse line } M. Brooks http://mbrooks.info
Mar 11, 2007 #3 KevinADC Technical User Joined Jan 21, 2005 Messages 5,070 Location US or maybe: Code: my $aa = "aa"; while (<>){ if (/^(\d+)\t$aa\t.*?\t(\d+:\d+)\t/) { $next_line = <>; } } ------------------------------------------ - Kevin, perl coder unexceptional! Upvote 0 Downvote
or maybe: Code: my $aa = "aa"; while (<>){ if (/^(\d+)\t$aa\t.*?\t(\d+:\d+)\t/) { $next_line = <>; } } ------------------------------------------ - Kevin, perl coder unexceptional!