in reply to Re: printing array using map
in thread printing array using map
and I want to process it to have something like this in output :w1 w2 w3 [t4 w4] w5 w6
each w is a token and t is a lable for some tokens. I've tried this but it dosnt work and I get the same output.w1 w2 w3 w4 t4 w5 w6
while my file is a text with my data as below.use strict; my $file = $ARGV[0]; open IN, $file or die "Can't open"; my @file =<IN>; close IN; m/\[(\S+)\s(\S+)\]/ ? print qq[$2 $1\n] :print qq[$_] for @file;
w1 w2 w3 [t4 w4] w5 w6
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: printing array using map
by johngg (Canon) on Apr 27, 2008 at 20:53 UTC | |
by GrandFather (Saint) on Apr 27, 2008 at 21:54 UTC | |
by johngg (Canon) on Apr 27, 2008 at 22:01 UTC | |
by FunkyMonk (Bishop) on Apr 27, 2008 at 22:22 UTC | |
by johngg (Canon) on Apr 28, 2008 at 10:04 UTC | |
|
Re^3: printing array using map
by FunkyMonk (Bishop) on Apr 27, 2008 at 22:19 UTC |