LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-03-2003, 12:06 AM   #1
mimf
LQ Newbie
 
Registered: Dec 2003
Posts: 8

Rep: Reputation: 0
Unhappy How to search for a character?


I have created a perl script that will open a file for reading, but how can i make it search for a specific character, if that character is given at the prompt? e.g. i want to search for number 33 in a list inside a file. Any help would be greatly appreciated.
 
Old 12-03-2003, 07:20 AM   #2
tiger3
Member
 
Registered: Nov 2003
Location: Land of the Rising Sun!
Distribution: Fedors Core 3, Red Hat 9, Mandrake 8.1
Posts: 52

Rep: Reputation: 15
using variables and the m// operator you could do this
if($File =~ m/$Find)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Character Map Jongi Linux - General 1 07-06-2005 07:14 PM
search default: search post title only slackie1000 LQ Suggestions & Feedback 4 03-10-2005 08:50 AM
Quick VIM question (unhighlighting search terms after search) lrt2003 Linux - Newbie 5 05-08-2004 06:21 PM
How to 'apt-cache search' & 'apt-file search' by distribution? davidas Debian 3 04-19-2004 02:56 PM
^M character david_wliu Linux - General 6 03-17-2003 12:16 AM


All times are GMT -5. The time now is 12:58 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration