Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
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!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1076436]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2025-06-19 13:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.