Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Regex Doubt

by Athanasius (Monsignor)
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

Output:

18:58 >perl 381_SoPW.pl ( [ "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


Comment on Re: Regex Doubt
Select or Download Code
Re^2: Regex Doubt
by Anonymous Monk on Nov 12, 2012 at 09:09 UTC

    Thanks Athanasius. :)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (9)
As of 2014-07-31 21:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (253 votes), past polls