Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: strings that dont contain

by LameNerd (Hermit)
on Jul 24, 2003 at 19:04 UTC ( [id://277649]=note: print w/replies, xml ) Need Help??


in reply to strings that dont contain

Don't forget about !~
bash-2.03$ ./test.pl one bone one does NOT end in bone bash-2.03$ ./test.pl bone one bone does end in one bash-2.03$ ./test.pl bonetwo one bonetwo does NOT end in one bash-2.03$ ./test.pl bonetwo two bonetwo does end in two bash-2.03$ cat test.pl #!/usr/local/bin/perl -w use strict; my $s1 = shift; my $s2 = shift; if ( $s1 !~ /$s2$/ ) { print "$s1 does NOT end in $s2\n"; } else { print "$s1 does end in $s2\n"; }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (3)
As of 2024-04-20 15:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found