The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Perl Pattern Matching !!! Help maxmave Shell Programming and Scripting 0 06-03-2008 07:05 PM
perl pattern matching zedex Shell Programming and Scripting 2 09-30-2007 08:29 AM
perl - how do i find out if a file doesn't contain a pattern? mjays Shell Programming and Scripting 4 09-19-2007 06:28 AM
perl pattern matching vs. grep junkmail426 Shell Programming and Scripting 0 09-28-2005 10:40 AM
pattern matching + perl question Optimus_P Shell Programming and Scripting 1 12-05-2003 07:43 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-22-2006
scorreg scorreg is offline
Registered User
  
 

Join Date: Mar 2006
Posts: 4
Pattern Recognition - perl

can someone help me with this..
cant for the life of me figure it out..
=~ m!^(/.*)/bin/xx!

specific query > What does m!^ do
> What does the ! at the end do..
  #2 (permalink)  
Old 09-22-2006
apoorvasharma80 apoorvasharma80 is offline
Registered User
  
 

Join Date: Aug 2006
Posts: 69
Hi Scorreg,

In perl we most often we use directl pattern matching. This 'm' is nothin but the match operator, often used in conjunction with the bind operator(~).
'^' just signifies the start of the pattern and '!' is delimiter.

You can write the same as ......

=~ {^(/.*)/bin/xx}

Now the 'm' is absent and '{' and '}' are delimiters!!
  #3 (permalink)  
Old 09-22-2006
scorreg scorreg is offline
Registered User
  
 

Join Date: Mar 2006
Posts: 4
thanks.. man
  #4 (permalink)  
Old 09-23-2006
cbkihong cbkihong is offline Forum Advisor  
Advisor
  
 

Join Date: Sep 2002
Location: Hong Kong, China
Posts: 1,624
Quote:
Originally Posted by apoorvasharma80
You can write the same as ......

=~ {^(/.*)/bin/xx}

Now the 'm' is absent and '{' and '}' are delimiters!!
Actually the 'm' is necessary unless '/' is used as delimiter. So, m{} but not {}, as {} means something else in Perl (reference to hash literal).
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:42 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0