Thanks for the tips, I think a combination of the two will be my best chance
for this one.
Store the bulk on disk or in a DB and use several smaller hashes to do the
merging. After which I can retreive the bulk from disk/db while looping over
the resulting combined hash. (note to self: must not fo
John W. Krahn wrote:
Chad Perrin wrote:
On Fri, Apr 21, 2006 at 12:48:51PM -0700, John W. Krahn wrote:
print/.*/g,$"while<>
Yeah, that's it.
Woah, that's pretty short.
You can make it even shorter:
print/.*/g,$"for<>
They aren't quite the same though. 'while' loops if the condition is
sti
Brent Clark wrote:
Hi all
Hi there
I seem to be having a few run ins with the "Project Leader", in terms of
my coding style.
Im very much for modularizing my work - hence the OO concept. That is
creating packages using return in my subroutine etc (Oh and using strict)
But the ex Cobol Projec
"M. Kristall" schreef:
> John W. Krahn:
>> Chad Perrin:
>>> John W. Krahn:
print/.*/g,$"while<>
>
> Yeah, that's it.
>>> Woah, that's pretty short.
>>
>> You can make it even shorter:
>>
>> print/.*/g,$"for<>
>
> They aren't quite the same though. 'while' loops if the condition is
> still tr
On Sun, 2006-23-04 at 05:03 -0400, M. Kristall wrote:
> John W. Krahn wrote:
> > You can make it even shorter:
> >
> > print/.*/g,$"for<>
> They aren't quite the same though. 'while' loops if the condition is
> still true (scalar context). 'for' loops if there are more items in the
> array (arra
-Original Message-
From: John W. Krahn [mailto:[EMAIL PROTECTED]
Sent: Friday, April 21, 2006 7:04 PM
To: Perl Beginners
Subject: Re: golf
Chad Perrin wrote:
> On Fri, Apr 21, 2006 at 12:48:51PM -0700, John W. Krahn wrote:
>>print/.*/g,$"while<>
>
> Woah, that's pretty short.
You can m
I want to use truncate to delete a matched line out a named.conf file on
my DNS box.
Here is my code
use strict;
use warnings;
my $file = qq(/usr/local/admin/perl/derek_perl/test);
open (FH, "+< $file");
while ( ) {
unless (/\Acheck\-names/) {
print $_;
On Sun, 2006-23-04 at 13:29 -0400, Smith, Derek wrote:
> use strict;
>
> use warnings;
>
>
>
> my $file = qq(/usr/local/admin/perl/derek_perl/test);
>
> open (FH, "+< $file");
>
>while ( ) {
>
> if (/\Acheck\-names/) {
>
> my $addr=tell(FH);
if( $addr < 0
On Sun, Apr 23, 2006 at 12:30:40PM -0400, Smith, Derek wrote:
>
> What is perl golf?
It's like normal golf, only with Perl. You try to finish the program
(or the 18-hole golf course) in as few (key)strokes as possible. In
other words, Perl golf is the game of shortening a program without
losing
M. Kristall wrote:
> John W. Krahn wrote:
>> Chad Perrin wrote:
>>> On Fri, Apr 21, 2006 at 12:48:51PM -0700, John W. Krahn wrote:
print/.*/g,$"while<>
> Yeah, that's it.
>>> Woah, that's pretty short.
>>
>> You can make it even shorter:
>>
>> print/.*/g,$"for<>
> They aren't quite the same th
Smith, Derek wrote:
I want to use truncate to delete a matched line out a named.conf file on
my DNS box.
Here is my code
use strict;
use warnings;
my $file = qq(/usr/local/admin/perl/derek_perl/test);
open (FH, "+< $file");
while ( ) {
unless (/\Acheck\-names/) {
"Mr. Shawn H. Corey" schreef:
> The expression 'while(<>)' is in scalar context.
> It reads the file one line at a time.
Rather one piece (or record) at a time, which by default is a line.
The value of "$/" is the record separator; see `perldoc perlvar`
for more information, such as special v
-Original Message-
From: Mr. Shawn H. Corey [mailto:[EMAIL PROTECTED]
Sent: Sunday, April 23, 2006 1:51 PM
To: Perl Beginners
Subject: Re: truncate
On Sun, 2006-23-04 at 13:29 -0400, Smith, Derek wrote:
> use strict;
>
> use warnings;
>
>
>
> my $file = qq(/usr/local/admin/perl/derek
On Sun, 2006-23-04 at 13:23 -0700, John W. Krahn wrote:
> "array context"?? There is no "array context".
See `perldoc perlsyn` and search 'Foreach Loops'. All foreach loops
iterate over a list. So you are right, it's not "array context", it's
list context. For details, see `perldoc -q 'What is th
On Sun, 2006-23-04 at 17:07 -0400, Smith, Derek wrote:
> This does not work as my file still contains both lines.
> check-names warn;
> fooy
>
> when I want it to only contain
> fooy
That's not what truncate does. It chops off the end of the file. What
you have to do is copy the contents to a tem
Please don't top post.
On 4/23/06, Rob Coops <[EMAIL PROTECTED]> wrote:
> Thanks for the tips, I think a combination of the two will be my best chance
> for this one.
>
> Store the bulk on disk or in a DB and use several smaller hashes to do the
> merging. After which I can retreive the bulk from
Hi All,
I was unable to resolvet the following lines.Could any one please
help me resolve the same? I could not find any user defined module named
"system".
System->get_renv();
System->get_receiver_dir();
Thanks in advance,
Praveena
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For add
Hi Folks,
i have written down a code in perl which is used as a file
analyser. I need to run the same on Windows 2000. Should i need to install
Active State Perl on the same.
Is there any other alternative for running the same without installation of
Active State Perl on the machine.
Tha
Hai,
There is only one way to do this, converting 'pl' to 'exe' file.
Here is the link u can download the per2exe package,
http://www.indigostar.com/perl2exe.htm
Best Rgds,
Santhosh Yuvaraj.
On 4/24/06, Mazhar <[EMAIL PROTECTED]> wrote:
>
> Hi Folks,
> i have written down a code in pe
With while(), the $_ is already local. Wouldn't using that 'local'
explicitly, add another local-layer?
my $i = 5;
$_ = 'Hi there!!!';
while ($_ = $i--) { print }
print
543210
my $i = 5;
$_ = 'Hi there!!!';
while (local $_ = $i--) { print }
print
54321Hi there!!!
for (<>) is the same as for (r
Mazhar wrote:
Hi Folks,
i have written down a code in perl which is used as a file
analyser. I need to run the same on Windows 2000. Should i need to install
Active State Perl on the same.
Is there any other alternative for running the same without installation of
Active State Perl on t
21 matches
Mail list logo