in reply to Re: Unpack Many Fields
in thread Unpack Many Fields
my $fmt = q[ x[10] a5 # code x[22] a10 # thingummy x[4] a3 a2 # doodah & whatsit ]; $fmt =~ s/#.*//g;
But pack allows for comments in patterns, so one doesn't even need that last line.
Update: Originally, the /g was missing, which led me to discover that one doesn't need to remove the comments.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Unpack Many Fields
by shoness (Friar) on Feb 16, 2010 at 02:23 UTC | |
by ikegami (Patriarch) on Feb 16, 2010 at 02:47 UTC | |
by shoness (Friar) on Feb 16, 2010 at 02:54 UTC | |
|
Re^3: Unpack Many Fields
by BrowserUk (Patriarch) on Feb 16, 2010 at 03:01 UTC | |
by ikegami (Patriarch) on Feb 16, 2010 at 05:09 UTC | |
by BrowserUk (Patriarch) on Feb 16, 2010 at 05:48 UTC |