Need to know why Perl fails.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Need to know why Perl fails.
# 1  
Old 07-12-2006
Need to know why Perl fails.

Hello .

Would really like to know why this code fails . I need to edit both the QUESNO : and <\p> tag at the same time .

open(TEXT, "<20030211.txt") || die ("Cannot open the text files");

while (<TEXT>) {

if ($_ =~ m/QUESNO :/) {

if ($_ =~ m/<\/p>/) {

print ($_);

}

}

}

Here is a sample of text file.

QUESTYPE: QUESTIONS FOR WRITTEN ANSWER
QUESTI : Written Question
QUESNO : 1
YEAR : 2003
QUESWRITTEN: 13 February 2003
QUESSP : Dr Muriel Newman
REPLYSP : Hon Steve Maharey
QUESTION:
QUESTION :
Dr Muriel Newman
to the Minister of Social Services and Employment
:
Is he and/or the Ministry of Social Development considering a welfare
reform initiative entitled New Directions; if so, what are the details
of this initiative,;if not, what are the details of any new welfare
reform initiatives, if any, that he or the Ministry are considering?
<p>
ANSWER :
Hon Steve Maharey
(Minister of Social Services and Employment)
replied:
New Directions is a Department of Child, Youth and Family Services programme, announced in 2001.
</p>

Thank You in advance.
Whatsup.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

PERL: In a perl-scripttTrying to execute another perl-script that SETS SOME VARIABLES !

I have reviewed many examples on-line about running another process (either PERL or shell command or a program), but do not find any usefull for my needs way. (Reviewed and not useful the system(), 'back ticks', exec() and open()) I would like to run another PERL-script from first one, not... (1 Reply)
Discussion started by: alex_5161
1 Replies

2. HP-UX

shl_load fails

Hi, I have written a simple program of 2 lines in C to load a library using SHL_LOAD. It fails with error "/usr/lib/hpux32/dld.so: Unable to find library 'xyz.sl'. Load failure for library , ERRNO = 2" Shlib_PATH,LD_LIBRARY_PATH,PATH,LD_PRELOAD are set correctly and library exists on the... (0 Replies)
Discussion started by: ashwinichavan
0 Replies

3. Programming

realloc() fails

Not sure in which forum to post this. I'm trying here, in Programming. I'm working on a PC with Intel Duo processor & 2GB of ram. OS is Ubuntu 10.04. I'm having problems with a C++ program that makes extensive use of realloc(). It happens that as soon as the overall memory allocated(OS +... (14 Replies)
Discussion started by: mamboknave
14 Replies

4. Programming

realloc fails in C : what next ?

Hi all I'm trying to use someone else's software, which has a realloc that fails in it. This is probably due to memory limitations, as it only happens when I use this software on huge datasets. First question : how to diagnose if it's a soft or hard limitation? I mean, if it's due to my... (10 Replies)
Discussion started by: jossojjos
10 Replies

5. Programming

What happens when realloc() fails?

Hi, I am seeing varying results about, when realloc() fails in reallocation. Which one is correct out of the below? a) realloc() maintains the original pointer (i.e) the original pointer is left unaltered/untouched but relloc() returns the NULL value. b) original buffer pointer is lost... (3 Replies)
Discussion started by: royalibrahim
3 Replies

6. Shell Programming and Scripting

until loop fails.

i have a script like below, i am trying to print "...." until a background process that was executed before is running,, the below does work and teh loop keeps on printing "..", can someone help where i am wrong. /tmp/test/abc.sh & until do echo "..\c" done abc.sh is the scipt... (8 Replies)
Discussion started by: yesmani
8 Replies

7. Programming

system() fails

Hi, I have the following code which fails with return value 1. sprintf(tmp, "rm -rf %s/* 2>/dev/null\n", dest); rc = system( tmp ); rc is 1 The files exist and the paths are correct. I can do a manual copy but the application fails. All the calls to system() function fail with the same... (6 Replies)
Discussion started by: mspaper
6 Replies

8. AIX

SCP fails sometimes

Hi, I got a unix script which copies a file from my AIX machine to a file server using SCP command. I am calling this script 3 times in my process after a time interval say 5mins. My issue here is like most of the time its not sending the file at the first time run while other 2 will work fine.... (10 Replies)
Discussion started by: vipinc
10 Replies

9. Shell Programming and Scripting

Script fails

Hi, I am trying to install a package on solaris and one of the packaging scripts fail unexpectedly. There is a script called "checkinstall" which checks for the /opt space and aborts the installation if /opt is less than 100MB. In my case, even if /opt has enoguh space, the script fails. ... (8 Replies)
Discussion started by: JStone
8 Replies

10. UNIX for Advanced & Expert Users

System Fails

Hi Exprts, There's a critical problem on one of the Workstations that the client reports every morning their system is down. It seems there's no power failure, as in the next startup the file systems are stable ,so i checked the "messages" file , the last line which i got before failure is :... (2 Replies)
Discussion started by: nikk
2 Replies
Login or Register to Ask a Question
DROP TEXT SEARCH 
TEMPLATE(7) SQL Commands DROP TEXT SEARCH TEMPLATE(7) NAME
DROP TEXT SEARCH TEMPLATE - remove a text search template SYNOPSIS
DROP TEXT SEARCH TEMPLATE [ IF EXISTS ] name [ CASCADE | RESTRICT ] DESCRIPTION
DROP TEXT SEARCH TEMPLATE drops an existing text search template. You must be a superuser to use this command. PARAMETERS
IF EXISTS Do not throw an error if the text search template does not exist. A notice is issued in this case. name The name (optionally schema-qualified) of an existing text search template. CASCADE Automatically drop objects that depend on the text search template. RESTRICT Refuse to drop the text search template if any objects depend on it. This is the default. EXAMPLES
Remove the text search template thesaurus: DROP TEXT SEARCH TEMPLATE thesaurus; This command will not succeed if there are any existing text search dictionaries that use the template. Add CASCADE to drop such dictionar- ies along with the template. COMPATIBILITY
There is no DROP TEXT SEARCH TEMPLATE statement in the SQL standard. SEE ALSO
ALTER TEXT SEARCH TEMPLATE [alter_text_search_template(7)], CREATE TEXT SEARCH TEMPLATE [create_text_search_template(7)] SQL - Language Statements 2010-05-14 DROP TEXT SEARCH TEMPLATE(7)