I have a string in the xml file
<I want to extract the digit 72 from this file
Where is the mistake in the code ?
String is
<stlib:mem_bit>72</stlib:mem_bit>
use strict; use warnings; my $data = <<'EOD'; <stlib:mem_bit>72</stlib:mem_bit> EOD open my $fh, '<', \$data; while (my $line = <$fh>) { while ( $line =~ /.*st_mem_bit.*(\d+)/g ) { my $a= $1; } } print $a; close $fh;
In reply to Extract a string from the line by kulua
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |