in reply to Script issue involves File Handling.
One way is to use split:
use strict; use warnings; while (<DATA>) { chomp; my @tokens = split /\|/; print "Wrestlername: $tokens[0]\n"; print "Crowdreaction: $tokens[1]\n"; print "Specialmove: $tokens[2]\n\n"; } __DATA__ The Rock|Cheer|Rock Bottom Triple H|Boo|Pedigree Stone Cold|Cheer|Stone Cold Stunner
prints out:
Wrestlername: The Rock Crowdreaction: Cheer Specialmove: Rock Bottom Wrestlername: Triple H Crowdreaction: Boo Specialmove: Pedigree Wrestlername: Stone Cold Crowdreaction: Cheer Specialmove: Stone Cold Stunner
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Script issue involves File Handling.
by Irishboy24 (Sexton) on Oct 01, 2009 at 20:31 UTC | |
|
Re^2: Script issue involves File Handling.
by Irishboy24 (Sexton) on Oct 01, 2009 at 20:42 UTC | |
by toolic (Bishop) on Oct 01, 2009 at 20:54 UTC |