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
Net::Hotline::FileInfoItem(3pm) 			User Contributed Perl Documentation			   Net::Hotline::FileInfoItem(3pm)

NAME
Net::Hotline::FileInfoItem - File object used internally by Net::Hotline::Client SYNOPSIS
use Net::Hotline::FileInfoItem; $file = new Net::Hotline::FileInfoItem; $file->name("smile"); $file->comments("A happy file."); ... DESCRIPTION
Net::Hotline::FileInfoItem is a simple class for storing and retrieving file information, You should never have to create your own Net::Hotline::FileInfoItem objects when using Net::Hotline::Client. Getting and (to a lesser extent) setting attributes is all that should be necessary. CONSTRUCTION
new Creates a new Net::Hotline::FileInfoItem object with all attributes set to undef. METHODS
All the Net::Hotline::FileInfoItem methods are simple attribute get/set routines. If given an argument, they set an attribute. In all cases, they return the current value of the attribute. comment TEXT The file comments (as seen in the Mac OS Finder). ctime NUM The creation time of the file, given as a Mac OS native time value. Add the constant Net::Hotline::Constants::HTLC_MACOS_TO_UNIX_TIME to it to change it to seconds since the Unix epoch. creator TEXT The file creator, given as a four-letter Mac OS creator code ("TTXT", "SIT!", etc.) name TEXT The file name. icon The file icon given as a four-letter code. mtime NUM The modification time of the file, given as a Mac OS native time value. Add the constant Net::Hotline::Constants::HTLC_MACOS_TO_UNIX_TIME to it to change it to seconds since the Unix epoch. ctime NUM The creation time of the file, given as a Mac OS native time value. Add the constant Net::Hotline::Constants::HTLC_MACOS_TO_UNIX_TIME to it to change it to seconds since the Unix epoch. size NUM The size of the file in bytes. type TEXT The file type, given as a four-letter Mac OS type code ("TEXT", "PICT", etc.), Net::Hotline::Constants::HTLC_INFO_FOLDER_TYPE for folders, and Net::Hotline::Constants::HTLC_INFO_FALIAS_TYPE for folder aliases. AUTHOR
John C. Siracusa (siracusa@mindspring.com) COPYRIGHT
Copyright(c) 1999 by John Siracusa. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.10.1 2002-11-27 Net::Hotline::FileInfoItem(3pm)