Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: regex needed

by pfaut (Priest)
on Mar 14, 2003 at 14:17 UTC ( [id://243048]=note: print w/replies, xml ) Need Help??


in reply to regex needed

You have delimited data and want to extract one component. split is usually the correct way to deal with delimited data.

You don't like entering all those extra variables when you only want one of the values? Then assign to an array and extract the component you want from the array.

my @array = split /:/; # the $_ is implied my $foo = $array[1];

You can make this shorter by eliminating the temporary array.

my $foo = (split /:/)[1];
--- print map { my ($m)=1<<hex($_)&11?' ':''; $m.=substr('AHJPacehklnorstu',hex($_),1) } split //,'2fde0abe76c36c914586c';

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (6)
As of 2024-03-28 09:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found