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
    awesome! ..thanks toolic.
Re^2: Script issue involves File Handling.
by Irishboy24 (Sexton) on Oct 01, 2009 at 20:42 UTC

    hey toolic
    quick question,In the script while reads line by line rite? Hence the array @tokens changes every time the script reads a new line.

    thanks
    Irishboy
      while reads line by line rite?
      Yes.
      the array @tokens changes every time the script reads a new line.
      Correct.