Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Need to grep for a string that ends with $$

by wallisds (Beadle)
on Mar 06, 2012 at 15:47 UTC ( [id://958100]=note: print w/replies, xml ) Need Help??


in reply to Need to grep for a string that ends with $$

Consider using regular expressions to do your matching:

my $string = 'PARJT$$'; if ($string=~m/\$\$$/) { print "match"; }

The backslashes are used to literally match the $ which otherwise is interpreted as the special character which represents the end of the string. We use a bare $ later to show we are only looking for matches at the end of the string.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (1)
As of 2024-04-25 04:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found