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
ALTER TEXT SEARCH 
DICTIONARY(7) PostgreSQL 9.2.7 Documentation ALTER TEXT SEARCH DICTIONARY(7) NAME
ALTER_TEXT_SEARCH_DICTIONARY - change the definition of a text search dictionary SYNOPSIS
ALTER TEXT SEARCH DICTIONARY name ( option [ = value ] [, ... ] ) ALTER TEXT SEARCH DICTIONARY name RENAME TO new_name ALTER TEXT SEARCH DICTIONARY name OWNER TO new_owner ALTER TEXT SEARCH DICTIONARY name SET SCHEMA new_schema DESCRIPTION
ALTER TEXT SEARCH DICTIONARY changes the definition of a text search dictionary. You can change the dictionary's template-specific options, or change the dictionary's name or owner. You must be the owner of the dictionary to use ALTER TEXT SEARCH DICTIONARY. PARAMETERS
name The name (optionally schema-qualified) of an existing text search dictionary. option The name of a template-specific option to be set for this dictionary. value The new value to use for a template-specific option. If the equal sign and value are omitted, then any previous setting for the option is removed from the dictionary, allowing the default to be used. new_name The new name of the text search dictionary. new_owner The new owner of the text search dictionary. new_schema The new schema for the text search dictionary. Template-specific options can appear in any order. EXAMPLES
The following example command changes the stopword list for a Snowball-based dictionary. Other parameters remain unchanged. ALTER TEXT SEARCH DICTIONARY my_dict ( StopWords = newrussian ); The following example command changes the language option to dutch, and removes the stopword option entirely. ALTER TEXT SEARCH DICTIONARY my_dict ( language = dutch, StopWords ); The following example command "updates" the dictionary's definition without actually changing anything. ALTER TEXT SEARCH DICTIONARY my_dict ( dummy ); (The reason this works is that the option removal code doesn't complain if there is no such option.) This trick is useful when changing configuration files for the dictionary: the ALTER will force existing database sessions to re-read the configuration files, which otherwise they would never do if they had read them earlier. COMPATIBILITY
There is no ALTER TEXT SEARCH DICTIONARY statement in the SQL standard. SEE ALSO
CREATE TEXT SEARCH DICTIONARY (CREATE_TEXT_SEARCH_DICTIONARY(7)), DROP TEXT SEARCH DICTIONARY (DROP_TEXT_SEARCH_DICTIONARY(7)) PostgreSQL 9.2.7 2014-02-17 ALTER TEXT SEARCH DICTIONARY(7)