in reply to Problem while Data Extraction
It may be that on my first reading of your node I understood it backwards, in which case the following code is more likely useful:
#!/usr/bin/perl use strict; use warnings; while (<DATA>) { chomp; my @parts = split /(\|[^\|]*\|)/; for my $part (@parts) { if ($part =~ /\|(.*)\|/) { $part = join '', $part =~ /([\da-f]+)/ig; } else { $part = join '', map {sprintf '%02x', ord $_} split '', $p +art; } print $part; } print "\n"; } __DATA__ |30 31 32 33 34|.dropbox.com User-Agent|3A|Google|20 20|Desktop
Prints:
30313233342e64726f70626f782e636f6d 557365722d4167656e743A476f6f676c6520204465736b746f70
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Problem while Data Extraction
by jpvinny28 (Novice) on Dec 04, 2012 at 04:11 UTC |