Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: regex needed

by pfaut (Priest)
on Mar 14, 2003 at 14:17 UTC ( #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
Node Status?
node history
Node Type: note [id://243048]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2021-04-11 18:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?