LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-11-2001, 02:58 PM   #1
LindsayJ
LQ Newbie
 
Registered: Nov 2001
Posts: 7

Rep: Reputation: 0
Perl programming question


I am trying to write a perl program that checks if a text file has an even number of characters and if it does to print it. This is what I have so far: #!/usr/bin/perl
if($str=~/\A(..)+\Z/)
{print OUTFL $STR;}
I was told that this is somewhat how you do it, but I don't understand what the text file is and what this program is looking at. Do I need to name a file somewhere and then this will work or does it need more lines? I have the Learning Perl book, but I can't seem to find anything like that. Thanks for any help.
 
  


Reply



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
New to perl programming jester_69 Programming 2 03-17-2005 02:45 PM
perl object Oriented Programming Question eastsuse Programming 1 08-20-2004 12:29 PM
Programming in Perl mimf Programming 5 12-04-2003 04:58 AM
A simple perl programming question J_Szucs Programming 12 07-14-2002 10:03 PM
Perl programming AliceC Programming 4 05-17-2001 10:18 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:00 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
Open Source Consulting | Domain Registration