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

Re^3: Regex random values pattern match and code efficiency

by Anonymous Monk
on Sep 12, 2013 at 14:13 UTC ( #1053733=note: print w/replies, xml ) Need Help??


in reply to Re^2: Regex random values pattern match and code efficiency
in thread Regex random values pattern match and code efficiency

just a basic regex loop.. try to adapt this..
use strict; my $value='$DOMAIN{HOST},$DOMAIN{IP},$DOMAIN{CONFIG}'; my @data = split(',',$value); foreach my $attributes (@data) { $attributes=~ m/(DOMAIN){(.+?)}/; print $2."\n"; }
prints:
HOST
IP
CONFIG

kindly perlig

Replies are listed 'Best First'.
Re^4: Regex random values pattern match and code efficiency
by AlexTape (Monk) on Sep 12, 2013 at 14:14 UTC
    lol.. why i was logged out?! ^^
    $perlig =~ s/pec/cep/g if 'errors expected';
Re^4: Regex random values pattern match and code efficiency
by Mark.Allan (Sexton) on Sep 13, 2013 at 12:18 UTC
    this works nicely until I bump into the following value then it crashes

    DEPLOY_PARAMS=$DOMAIN{HOST},$DOMAIN{IP},$DOMAIN{DEVICE,NAME}

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1053733]
help
Chatterbox?
[atcroft]: abner: Or are you wanting to do something where you need to bind an array to a placeholder (in which case the bind_param_array method may be of use.

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (8)
As of 2017-01-24 04:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (202 votes). Check out past polls.