Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Simple RegEx Substring Extraction from a Delimited Text Record

by reasonablekeith (Deacon)
on Mar 15, 2006 at 09:54 UTC ( [id://536795]=note: print w/replies, xml ) Need Help??


in reply to Simple RegEx Substring Extraction from a Delimited Text Record

I'm a bit late to this post, but I couldn't resist adding the following. Why not just split it all into a hash?
#!/bin/perl -w use strict; my $string = 'SLOT3=4,4,2!INT=115!VC=4!CS=270!PK=/'; my %parsed_values = map { split '=' } split '!', $string; print $parsed_values{'INT'};
---
my name's not Keith, and I'm not reasonable.
  • Comment on Re: Simple RegEx Substring Extraction from a Delimited Text Record
  • Download Code

Log In?
Username:
Password:

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

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

    No recent polls found