C
ChocMonk
Hello,
I have an array with contents as below (from a VB project file):
my @objs= ("Object={831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0;
mscomctl.ocx\n",
"Object={31B58EFA-5E2E-4651-9454-2227ABB82B62}#6.7#0;
GridControls.ocx\n",
"Object={B9AA5EAF-A9B4-11D5-96CA-0010A4B15184}#1.0#0;
CompanyLogo.ocx\n",
"Object={BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0; tabctl32.ocx\n",
"Object={CA8A9783-280D-11CF-A24D-444553540000}#1.3#0; pdf.ocx\n",
"Object={64EE12AF-3495-45BC-AC02-43C29DF43376}#9.1#0;
StandardControls.ocx\n",
"Object={86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0; mscomct2.ocx\n");
I populated the array from parsing a file with the following regexp:
my @objs = grep(/^Object=\{\w|\-*\}#\d+\.\d+#\d?; .+/,@str);
Now I'm cycling through the array trying to split it up such that for
the first string in the example above I get the following values:
my $crap = "Object="
my $guid ="{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}"
my $ver = "2.0"
my $rev = "0"
my $name = "mscomctl.ocx\n"
I tried the following which doesn't work:
for (@objs) {
chomp;
(my $crap, my $guid, my $ver, my $rev, my $name) =
/(^Object=)(\{\w|\-*\})#(\d+\.\d+)#(\d?); (.+)/;
}
WHat am I doing wrong? I thought clustering the subexpressions will
capture what I want..
Thanks!
Choc
I have an array with contents as below (from a VB project file):
my @objs= ("Object={831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0;
mscomctl.ocx\n",
"Object={31B58EFA-5E2E-4651-9454-2227ABB82B62}#6.7#0;
GridControls.ocx\n",
"Object={B9AA5EAF-A9B4-11D5-96CA-0010A4B15184}#1.0#0;
CompanyLogo.ocx\n",
"Object={BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0; tabctl32.ocx\n",
"Object={CA8A9783-280D-11CF-A24D-444553540000}#1.3#0; pdf.ocx\n",
"Object={64EE12AF-3495-45BC-AC02-43C29DF43376}#9.1#0;
StandardControls.ocx\n",
"Object={86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0; mscomct2.ocx\n");
I populated the array from parsing a file with the following regexp:
my @objs = grep(/^Object=\{\w|\-*\}#\d+\.\d+#\d?; .+/,@str);
Now I'm cycling through the array trying to split it up such that for
the first string in the example above I get the following values:
my $crap = "Object="
my $guid ="{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}"
my $ver = "2.0"
my $rev = "0"
my $name = "mscomctl.ocx\n"
I tried the following which doesn't work:
for (@objs) {
chomp;
(my $crap, my $guid, my $ver, my $rev, my $name) =
/(^Object=)(\{\w|\-*\})#(\d+\.\d+)#(\d?); (.+)/;
}
WHat am I doing wrong? I thought clustering the subexpressions will
capture what I want..
Thanks!
Choc