gzayzay has asked for the wisdom of the Perl Monks concerning the following question:
I am trying to split a string into three parts. However, I am finding it difficult to come up with the appropriate pattern to help me split this string. Hence, could any monk kindly him me figure this out?
-MEMADDR- ----HEX REPRESENTATION---- ---ASCII--- 0000 21 74 63 5f 37 5f 31 5f 36 !tc_7_1_6
I am trying to get a pattern the will result to me having the following valuesmy($memAddr, $data, $ascii); open(DATAFILE $filename) while(<DATAFILE>) { my $line = $_; ($memAddr, $data, $ascii) = split(/PATTERN/, $line);
$memAddr = 0000; $data = 2174635f375f315f36; # I think I need join() to get this for +mat $ascii = !tc_7_1_6
I will highly appreciate a help for any Monk out there.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Splitting a string in Perl
by dragonchild (Archbishop) on Apr 25, 2008 at 20:39 UTC | |
|
Re: Splitting a string in Perl
by gamache (Friar) on Apr 25, 2008 at 20:32 UTC | |
by gzayzay (Sexton) on Apr 25, 2008 at 20:48 UTC | |
|
Re: Splitting a string in Perl
by holli (Abbot) on Apr 25, 2008 at 20:43 UTC | |
|
Re: Splitting a string in Perl
by FunkyMonk (Bishop) on Apr 25, 2008 at 20:37 UTC | |
by kyle (Abbot) on Apr 26, 2008 at 19:07 UTC | |
|
Re: Splitting a string in Perl
by johngg (Canon) on Apr 25, 2008 at 21:08 UTC | |
|
Re: Splitting a string in Perl
by ww (Archbishop) on Apr 25, 2008 at 20:55 UTC |