Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re: To Pattern Match or not to Pattern Match

by sh1tn (Priest)
on Mar 04, 2005 at 00:17 UTC ( #436422=note: print w/replies, xml ) Need Help??

in reply to To Pattern Match or not to Pattern Match

Array elements existence check:
my @all = 1..10; my @some = 1..5; my %h; my @c; @h{@some} = ( ); # Elements that exist in both arrays exists($h{$_}) and push @c, $_ for @all; # @c: 1 2 3 4 5 # Elements that do not exist in @some array exists($h{$_}) or push @c, $_ for @all; # @c: 6 7 8 9 10
Pattern matching negation:
my $string = 'string'; # true: $string =~ /^string$/ and print "$string is really string?\n"; # false: $string !~ /^string$/ and print "$string is not string?\n"; # STDOUT: string is really string

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (2)
As of 2022-01-28 00:45 GMT
Find Nodes?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:

    Results (72 votes). Check out past polls.