I have a script that would check a xml file and find me strings that are between tags <Register> ...</Register>
script is :
while (my $line = <FILE>)
{
if ($line =~ m/<Register>/)
{
my $nextline =<FILE>;
if ($nextline =~ /^(.*)]*<\/Register/)
{
my $string = $1...
The Program code:
use strict;
use warnings;
my @register_list;
open (FILE, "Peint_FcN.xml");
while (my $line = <FILE>)
{
if ($line =~ m/<Register>/)
{
my $nextline =<FILE>;
if...
if ($string =~ /(.*?)u(.*)/s)
{
my $pre = $1;
my $post = $2;
for my $index(0..4)
{
print "$pre$index$post\n";
push(@register_list, "$pre$index$post");
}
}
is there a way to make it print like 0,1,2,3,4 and not just 1,2,3,4??
How can I point to an array using hash?
I have an array and I have a hash, I want the data in the array to be accessed through hash. How can I do that??
Please help me out. Thank you in advance.
perl script:
use strict;
use warnings;
open FILE, "reg_sample.xml" or die $!;
while (my $line =<FILE>){
if($line= ~ m/<Register> (.*?) <\/Register>/g)
{
print $line;
}
}
I just realized that in the xml file, I see register in following format:
<Register>...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.