Re: Exit subroutine on filehandle error

2011-07-28 Thread Kevin Spencer
On Wed, Jul 27, 2011 at 9:30 AM, Rob Dixon wrote: > What exactly is wrong with "or do {...}"? > > I believe it is the best option simply because is is comparable to the > common "open ... or die $!" idiom. The do is there only so that a > warning can be issued as well as the return There's nothin

Re: Any suggestion on how to "improve" this code? Malformed braces

2011-07-28 Thread John W. Krahn
newbie01 perl wrote: Hi all, Hello, I've written a Perl script below that check and report for malformed braces. I have a UNIX ksh version and it took a couple of minutes to run on a 1+ lines. With the Perl version it only took about 20 seconds so I decided to do it the Perl way. Besides

Re: Add line feed to line

2011-07-28 Thread Emeka
Timo, #!/usr/bib/perl -w What is "-w" doing here? Emeka On Wed, Jul 27, 2011 at 9:59 PM, timothy adigun <2teezp...@gmail.com> wrote: > Tim, > >>check this if it answers ur #1 question: > #!/usr/bib/perl -w > > $\="\n"; # with output record separator used you don't ve to use >

Re: Add line feed to line

2011-07-28 Thread Tim Lewis
Thanks! timothy adigun <2teezp...@gmail.com> wrote: > Tim, > >>check this if it answers ur #1 question: > #!/usr/bib/perl -w > > $\="\n"; # with output record separator used you don't ve to use ># $currentLine = $currentLine . "\x{0A}"; in ur code again > > my @arr=

substring first 100 words from a string in perl

2011-07-28 Thread Khabza Mkhize
I want to substring words, I might be using wrong terminology. But I tried the following example the only problem I have it cut word any where it likes. eg "breathtaking" on my string is only bre. $string = "This is an awe-inspiring tour to the towering headland known as Cape Point. Magnif

Re: substring first 100 words from a string in perl

2011-07-28 Thread Rob Coops
On Thu, Jul 28, 2011 at 3:23 PM, Khabza Mkhize wrote: > I want to substring words, I might be using wrong terminology. But I tried > the following example the only problem I have it cut word any where it > likes. eg "breathtaking" on my string is only bre. > > > $string = "This is an awe-in

Re: print output on console at runtime

2011-07-28 Thread Irfan Sayed
further, i am executing following command using open open $frk, "devenv /rebuild release ReusableU.sln /useenv 2>&1 |" or die "Couldn't execute program: $!"; now i need to capture the exit status of this command i tried with $? but it does not contain the exit status please suggest regar

Re: substring first 100 words from a string in perl

2011-07-28 Thread timothy adigun
Hi Rob Coops, " I want to substring words, I might be using wrong terminology. But I tried the following example the only problem I have it cut word any where it likes. eg "breathtaking" on my string is only bre." -- If you count your $string alphabeth by alphabeth from 0 to 100 including ev

Re: substring first 100 words from a string in perl

2011-07-28 Thread timothy adigun
Hello Khabza, " I want to substring words, I might be using wrong terminology. But I tried the following example the only problem I have it cut word any where it likes. eg "breathtaking" on my string is only bre." -- If you count your $string alphabeth by alphabeth from 0 to 100 including eve

Re: substring first 100 words from a string in perl

2011-07-28 Thread Rob Dixon
On 28/07/2011 14:23, Khabza Mkhize wrote: I want to substring words, I might be using wrong terminology. But I tried the following example the only problem I have it cut word any where it likes. eg "breathtaking" on my string is only bre. $string = "This is an awe-inspiring tour to the

Re: Parse HTML

2011-07-28 Thread Rob Dixon
On 26/07/2011 21:12, Jeffrey Joh wrote: > On 26 Jul 2011 16:48, Rob Dixon wrote: >> On 25/07/2011 21:17, Jeffrey Joh wrote: >>> >>> Hello, I'm trying to parse HTML files. I want to extract values from >>> tables (1) and from text fields (2). (1)>> src="/image.gif" alt="" width="1" height="1" border

End-of-Marker

2011-07-28 Thread Emeka
Hello All, Could someone explain what $\ (end-of-marker) is? I need something detail with simple and complex examples? Emeka -- *Satajanus Nig. Ltd *

Re: End-of-Marker

2011-07-28 Thread Rob Dixon
On 28/07/2011 22:36, Emeka wrote: Hello All, Could someone explain what $\ (end-of-marker) is? I need something detail with simple and complex examples? Take a look at perldoc perlvar for documentation on Perl's internal variables like this. This is what it says $\ The output r

Re: End-of-Marker

2011-07-28 Thread Rob Dixon
On 28/07/2011 22:58, Emeka wrote: Rob, Thanks... Could you also explain ... $/? Emeka Please look at the documentation I have indicated in perldoc perlvar and come back to this list if you still have questions. Rob -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For addition

bracket checker - http://pastebin.com/d8GNL0kx - Any clue on the error?

2011-07-28 Thread newbie01 perl
Hi, Am just trying out this bracket checker script but when I ran it, it is giving errors below. Just curious to know what the error is about? Please advise. Thanks Error below: http://pastebin.com/d8GNL0kx ./123.pl testfile01x.ora Malformed UTF-8 character (unexpected continuation byte 0xbb)

Re: End-of-Marker

2011-07-28 Thread timothy adigun
Hello Emeka, $/ is the input record separator. This variable holds a newline by default. When you read records from a file handle, $/ holds the record delimiter. e.g Usually, you only read one line at a time from a file, but if you undefine $/, you can read in a whole, multiline file at once: ##

Re: substring first 100 words from a string in perl

2011-07-28 Thread timothy adigun
Hi Rob, I get the point you are making here, if you check the subroutine "sub checkStr{}" you see dat it confirm what you are pointing out. However, I think the point there is the number of words the programmers wants! [Khabza, correct me if am wrong]. Since, split function as indicated will remov