Re: stopping global substituion under MACOSX

2012-02-21 Thread John W. Krahn
s...@missionstclare.com wrote: I'm running PERL under the MACOSX. It is spelled Perl, not PERL. :-) The line $text=~s/george/tim/; causes a global substituion of "george" with "tim" How can I limit the substituion to the first instance only? Global substitution only works if you use t

stopping global substituion under MACOSX

2012-02-21 Thread sb
I'm running PERL under the MACOSX. The line $text=~s/george/tim/; causes a global substituion of "george" with "tim" How can I limit the substituion to the first instance only? Thanks! -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...

Re: perl and pattern

2012-02-21 Thread John W. Krahn
Shlomi Fish wrote: On Tue, 21 Feb 2012 23:47:39 +0400 Vyacheslav wrote: I'm new in perl and have many questions. This my first programm. #!/usr/bin/perl use strict; use warnings; That's good. my $number = 0; my $_ = 0; You shouldn't use my with "$_" and you should avoid using $_ in

Re: perl and pattern

2012-02-21 Thread John SJ Anderson
Gentlemen, you're both running towards the line marked "on topic for perl-beginners" at a rapid pace. I urge you to consider further messages in this thread carefully, lest that line be crossed. thanks, the list mom. -- John SJ Anderson / geneh...@genehack.org

Re: perl and pattern

2012-02-21 Thread Shlomi Fish
Hello Rob, On Tue, 21 Feb 2012 20:32:19 + Rob Dixon wrote: > On 21/02/2012 19:57, Shlomi Fish wrote: > > Hi, > > > > On Tue, 21 Feb 2012 23:47:39 +0400 > > Vyacheslav wrote: > > > >> Hello. > >> > >> I'm new in perl and have many questions. > >> > >> This my first programm. > >> > >> #!/usr

Re: perl and pattern

2012-02-21 Thread Rob Dixon
On 21/02/2012 19:57, Shlomi Fish wrote: Hi, On Tue, 21 Feb 2012 23:47:39 +0400 Vyacheslav wrote: Hello. I'm new in perl and have many questions. This my first programm. #!/usr/bin/perl use strict; use warnings; That's good. my $number = 0; my $_ = 0; You shouldn't use my with "$_"

Re: perl and pattern

2012-02-21 Thread Rob Dixon
On 21/02/2012 19:47, Vyacheslav wrote: Hello. I'm new in perl and have many questions. This my first programm. #!/usr/bin/perl use strict; use warnings; my $number = 0; my $_ = 0; print "Enter number:"; chomp($number = <>); if ( $number = /[0-9]/) { print "you number $number\n" } ./firsh.pl

Re: perl and pattern

2012-02-21 Thread Lawrence Statton
On 02/21/2012 01:47 PM, Vyacheslav wrote: Hello. I'm new in perl and have many questions. This my first programm. #!/usr/bin/perl use strict; use warnings; EXCELLENT START! my $number = 0; my $_ = 0; print "Enter number:"; chomp($number = <>); if ( $number = /[0-9]/) { You want the matc

Re: perl and pattern

2012-02-21 Thread Shlomi Fish
Hi, On Tue, 21 Feb 2012 23:47:39 +0400 Vyacheslav wrote: > Hello. > > I'm new in perl and have many questions. > > This my first programm. > > #!/usr/bin/perl > > use strict; > use warnings; > That's good. > my $number = 0; > my $_ = 0; You shouldn't use my with "$_" and you should avoid

perl and pattern

2012-02-21 Thread Vyacheslav
Hello. I'm new in perl and have many questions. This my first programm. #!/usr/bin/perl use strict; use warnings; my $number = 0; my $_ = 0; print "Enter number:"; chomp($number = <>); if ( $number = /[0-9]/) { print "you number $number\n" } ./firsh.pl Enter number: 23 I thought, what print

Re: search and replace with an array

2012-02-21 Thread Shawn H Corey
On 12-02-21 11:37 AM, Adams Paul wrote: Sent from my LG phone Is this is what is called a bum dial? -- Just my 0.0002 million dollars worth, Shawn Programming is as much about organization and communication as it is about coding. It's Mutual Aid, not fierce competition, that's the dom

Re: search and replace with an array

2012-02-21 Thread Adams Paul
Sent from my LG phone "John W. Krahn" wrote: >Chris Stinemetz wrote: >> I am trying ot find a way to use an array as a reference to remove >> lines from a file. >> The array @keyFields has the elements "rcsm and cdmno". My objective >> is to remove any line from the input that matches the regex

Re: Keyboard scan codes with Term::Screen

2012-02-21 Thread Sean Murphy
Hi Igor, Any time you have suggestions on improving my code. Please comment. I am always trying to improve. Thanks for the tip I will try it out. It has been over 7 years since I have done any real serious programming. So I am very rusty. I had written a program in C from memory which got th