package block

2014-02-05 Thread Manfred Lotz
Hi all, Perl 5.14 allows package blocks. Assume i have a file Hello.pm package Hello; { ... 1; } # or better here # 1; My question is: Would I put 1; inside the { } or should I put it outside the { }. -- Manfred -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For

Re: package block

2014-02-05 Thread Shlomi Fish
Hi Manfred, On Wed, 5 Feb 2014 10:51:56 +0100 Manfred Lotz manfred.l...@arcor.de wrote: Hi all, Perl 5.14 allows package blocks. Assume i have a file Hello.pm package Hello; { ... 1; } I think the syntax is «package Hello { ... }» without the semicolon. # or better here # 1;

Re: package block

2014-02-05 Thread Manfred Lotz
Hi Shlomi, On Wed, 5 Feb 2014 14:20:55 +0200 Shlomi Fish shlo...@shlomifish.org wrote: Hi Manfred, On Wed, 5 Feb 2014 10:51:56 +0100 Manfred Lotz manfred.l...@arcor.de wrote: Hi all, Perl 5.14 allows package blocks. Assume i have a file Hello.pm package Hello; { ...

Re: Replacing the first line of a text file

2014-02-05 Thread Nathan Hilterbrand
See below the quoted text On 02/03/2014 08:12 PM, SSC_perl wrote: I'm having a problem with the script below. I want to alter just the first line of a CSV file, removing the prefix tag_ from each value in that line. However, because the new line is shorter than the original, the

Re: package block

2014-02-05 Thread Manfred Lotz
Hi Paul, On Wed, 5 Feb 2014 11:37:08 + Paul Johnson p...@pjcj.net wrote: On Wed, Feb 05, 2014 at 10:51:56AM +0100, Manfred Lotz wrote: Hi all, Perl 5.14 allows package blocks. Assume i have a file Hello.pm package Hello; { ... 1; } # or better here # 1;

multiplier in replacement string

2014-02-05 Thread Jorge Almeida
$s=ab; $s=~s/a/AA/; # $s is now AAb I would like to achieve the same with something similar to the x multiplier: $n=2; $s=Ax$n.b; # $s is AAb $s=ab; $n=2; $s=~s/a/Ax$n/; # doesn't work, of course; $s is Ax2b Is it possible at all? Thanks Jorge Almeida -- To unsubscribe, e-mail:

Re: multiplier in replacement string

2014-02-05 Thread Shawn H Corey
On Wed, 5 Feb 2014 19:52:07 + Jorge Almeida jjalme...@gmail.com wrote: $s=ab; $s=~s/a/AA/; # $s is now AAb I would like to achieve the same with something similar to the x multiplier: $n=2; $s=Ax$n.b; # $s is AAb $s=ab; $n=2; $s=~s/a/Ax$n/; # doesn't work, of course; $s is

Re: multiplier in replacement string

2014-02-05 Thread Uri Guttman
On 02/05/2014 02:52 PM, Jorge Almeida wrote: $s=ab; $s=~s/a/AA/; # $s is now AAb I would like to achieve the same with something similar to the x multiplier: $n=2; $s=Ax$n.b; # $s is AAb $s=ab; $n=2; $s=~s/a/Ax$n/; # doesn't work, of course; $s is Ax2b you need the /e modifier on s///. it

Re: multiplier in replacement string

2014-02-05 Thread Jorge Almeida
On Wed, Feb 5, 2014 at 8:11 PM, Uri Guttman u...@stemsystems.com wrote: On 02/05/2014 02:52 PM, Jorge Almeida wrote: $s=ab; $s=~s/a/AA/; # $s is now AAb I would like to achieve the same with something similar to the x multiplier: $n=2; $s=Ax$n.b; # $s is AAb you need the /e modifier

OO perl programming

2014-02-05 Thread kavita kulkarni
Can somebody suggest me good book to learn/practice object oriented Perl programming. Regards, Kavita :-)

Re: OO perl programming

2014-02-05 Thread Shlomi Fish
Hi Kavita, welcome aboard. On Wed, 5 Feb 2014 14:30:53 -0800 kavita kulkarni kavitahkulka...@gmail.com wrote: Can somebody suggest me good book to learn/practice object oriented Perl programming. First of all see: http://perl-begin.org/topics/object-oriented/ (Note: I originated and

Re: OO perl programming

2014-02-05 Thread Omega -1911
I really think the quoting that you own a resource for beginners is outdated. Why should you have to reveal you own a site that helps people? I wish all the Perl guru's would put down their differences and get this list back to JUST HELPING PEOPLE... If TIMTOWTDO is a TRUE concept, WHY are there

Re: OO perl programming

2014-02-05 Thread Omega -1911
TIMTOWTDO = There is more than one way to do than otherwise (told) On Wed, Feb 5, 2014 at 7:00 PM, Omega -1911 1911...@gmail.com wrote: I really think the quoting that you own a resource for beginners is outdated. Why should you have to reveal you own a site that helps people? I wish all

Re: OO perl programming

2014-02-05 Thread Charles DeRykus
On Wed, Feb 5, 2014 at 2:30 PM, kavita kulkarni kavitahkulka...@gmail.comwrote: Can somebody suggest me good book to learn/practice object oriented Perl programming. With a recently modern perl, I'd start with perl's own tutorial to get a short overview. See: perldoc perlootut And,

Re: OO perl programming

2014-02-05 Thread Sam
On 02/05/2014 04:30 PM, kavita kulkarni wrote: Can somebody suggest me good book to learn/practice object oriented Perl programming. Regards, Kavita :-) Beginning Perl by Curtis Poe is a really good read. Also there are many tutorials for perl moose online. Sam -- To unsubscribe,