hi to all monks....and also to lesser mortals
i am using the below 'if' statement to process a text.
while (<>) { if (/ (\w\w) (\w\w) (\w\w) (\w\w) /) { #do smthing } 00 12 0d 90
the above text is part of a larger log file which i havent shown here. i am not wrong the 'which(<>)' command does line by line processing. so i intend to assign each pair of digits a variable like $1,$2 etc ...which i can later manipulate in my code. another such line might contain 3 pairs instead of 4 and yet another might contain 2 pairs.but i am only able to use the line having 4 pairs like the one shown above and none of the other lines having pairs less than 4.
what can i do to be able to include the line with less than 4 pairs also.
awaiting ur replies
thanks
vineet
In reply to pattern matching by vineet2004
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |