Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: Regex Doubt

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

Comment on Re: Regex Doubt
Select or Download Code
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 scrutinizing the Monastery: (4)
As of 2015-10-04 22:05 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (105 votes), past polls