Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: A maybe rather silly question...

by dwm042 (Priest)
on Feb 27, 2014 at 19:12 UTC ( [id://1076436] : note . print w/replies, xml ) Need Help??


in reply to A maybe rather silly question...

The split function seems the simplest approach to me:

#! /usr/bin/perl while(<DATA>) { my @field = split " ", $_; print "Field 2 => ",$field[1], "\n"; } __DATA__ ID SP96_DICDI STANDARD; PRT; 600 AA.

And the output is:

C:\scripts>perl field_split.pl Field 2 => SP96_DICDI

Replies are listed 'Best First'.
Re^2: A maybe rather silly question...
by Anonymous Monk on Feb 27, 2014 at 20:28 UTC
    Thanks so much guys!
    I think I will (must) go with susbtr, because, technically, we don't "know" regexps and arrays yet!