for eg: if this is my line <head><to>tove</to></head> i got the position of each matched pattern now if i want only tove to be printed how can i do with substr()
while($line = <MYFILE>){ if($line =~ m/<.[^>]*>/g){ $new = substr($line,0,10); print "THE NEW LINE is : $new\n"; } }
In reply to use of substr() with file by satishchandra
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |