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

issue in regular expression

by maheshganesh (Initiate)
on May 10, 2018 at 13:08 UTC ( [id://1214324]=perlquestion: print w/replies, xml ) Need Help??

maheshganesh has asked for the wisdom of the Perl Monks concerning the following question:

Hi Perl monks Need help in code we i have written in which I am facing issue on the below one can you please help me.. in which the code is getting stuck.. Please suggest what is wrong in the code..

@{temp}=grep {$_ =~ /#%#/ && $_ !~ /#%#$/} @{temp};

Replies are listed 'Best First'.
Re: issue in regular expression
by choroba (Cardinal) on May 10, 2018 at 13:26 UTC
    It works for me:
    #!/usr/bin/perl use warnings; use strict; use feature qw{ say }; my @temp = do { no warnings 'qw'; qw( a b c #%# #%#a #%#b ) }; @temp = grep /#%#/ && ! /#%#$/, @temp; say "@temp.";
    Output:
    #%#a #%#b.

    ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,
Re: issue in regular expression
by hippo (Bishop) on May 10, 2018 at 13:54 UTC
Re: issue in regular expression
by Anonymous Monk on May 11, 2018 at 00:39 UTC
    Wich result do you expect?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1214324]
Approved by marto
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-19 23:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found