Technology, Web & Business Forum

You are here: Technology, Web & Business Forum : Web Development : Programming : Perl programming???


Welcome to the Technology, Web & Business Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.


Programming Discuss programming languages such as .NET, PHP, PERL, ASP, ColdFusion, C++


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-07-2008
Junior Member
 
Join Date: May 2008
Posts: 3
Default Perl programming???

$file = 'C:\PERL\BIN\ABC.XML';
open(INFO, $file) or die "Can't Open the File";

while (<INFO>)
{
chomp; #works on $_ by default
print $_,"\n"; #Don't need the "\n" if you don't chomp
if ($_ =~ /Prostate Cancer/)
{
print "ALRIGHT";
close (INFO);
}
else
{
print "NOOOOOOOOOOO";
}
}
close (INFO);

Above program reads the entire file and finds the word /prostate cancer/. However I want to is copy the data of the from the beginning up to the word 'prostate cancer' and save it to another file and th other half to another file.

Please help I'm new in perl???
__________________
Powered by Yahoo! Answers
Reply With Quote
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT -5. The time now is 09:38 AM.