Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Str extract the word between the first and the 2nd '|' character

by radiantmatrix (Parson)
on Apr 11, 2008 at 16:41 UTC ( [id://679755]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $string = '(<some word> | No Qualifier | <some word> | <some word>'
    +;
    my $start = index( $string, '|' );          # find first pipe position
    my $end = index( $string, '|', $start+1 );  # find next pipe position
    
    my $qualifier = substr( $string, $start, $end-$start+1 ); # extract
    
  2. or download this
    use IO::File;
    use Text::CSV_XS;
    ...
        my $row = $csv->getline($io);  # read and parse line into an ARRAY
    +ref
        print "Second field says: ", $row->[1], "\n";
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (5)
As of 2024-04-19 06:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found