Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re: Regex Doubt

by Athanasius (Chancellor)
on Nov 12, 2012 at 09:01 UTC ( #1003383=note: print w/replies, xml ) Need Help??

in reply to Regex Doubt

Perhaps you’re looking for something along these lines?

#! perl use strict; use warnings; use Data::Dump; my @records; while (my $line = <DATA>) { chomp(my @r = split / - /, $line); push @records, [ @r ]; } dd @records; __DATA__ Part Time - Weekend Receptionist - Barton le Clay - Barton-le-Clay (ne +ar Luton) Part-Time Weekend Day Veterinary Nurse - Milton Keynes Receptionist - Barton-le-Clay (near Luton) Full Time - Veterinary Nurse - Glasgow Referral - Glasgow


18:58 >perl ( [ "Part Time", "Weekend Receptionist", "Barton le Clay", "Barton-le-Clay (near Luton)", ], ["Part-Time Weekend Day Veterinary Nurse", "Milton Keynes"], ["Receptionist", "Barton-le-Clay (near Luton)"], ["Full Time", "Veterinary Nurse", "Glasgow Referral", "Glasgow"], ) 18:59 >

Hope that helps,

Athanasius <°(((><contra mundum

Replies are listed 'Best First'.
Re^2: Regex Doubt
by Anonymous Monk on Nov 12, 2012 at 09:09 UTC

    Thanks Athanasius. :)

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (15)
As of 2016-10-26 14:26 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (341 votes). Check out past polls.