[29714] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 958 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Oct 21 00:10:14 2007

Date: Sat, 20 Oct 2007 21:09:06 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sat, 20 Oct 2007     Volume: 11 Number: 958

Today's topics:
    Re: a nice little perl utility <someone@example.com>
    Re: a nice little perl utility <zaxfuuq@invalid.net>
    Re: a nice little perl utility <rkb@i.frys.com>
    Re: ACM SIGAPL / APL2007 Conference / Montreal / one we <bernecky@gmail.com>
    Re: cgi_bin <stoupa@practisoft.cz>
    Re: cgi_bin <wheeledBob@yahoo.com>
    Re: Distributed RVS, Darcs, tech love <java.oke@gmail.com>
    Re: Distributed RVS, Darcs, tech love <llothar@web.de>
    Re: Distributed RVS, Darcs, tech love <googlegroupie@coloraura.com>
    Re: Distributed RVS, Darcs, tech love <gneuner2/@/comcast.net>
    Re: Distributed RVS, Darcs, tech love <lew@lewscanon.com>
        Help: Count characters <openlinuxsource@gmail.com>
    Re: Help: Count characters <tadmc@seesig.invalid>
    Re: Help: Count characters <rkb@i.frys.com>
    Re: Is perl a good candidate for Data Mining <wheeledBob@yahoo.com>
    Re: perl standard sln@netherlands.co
    Re: perl standard sln@netherlands.co
    Re: perl standard sln@netherlands.co
    Re: perl standard <benkasminbullock@gmail.com>
    Re: perl standard <benkasminbullock@gmail.com>
    Re: perl standard <RedGrittyBrick@SpamWeary.foo>
    Re: perl standard <tadmc@seesig.invalid>
    Re: Using IDL from a perl script <kevin@vexona.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Sat, 20 Oct 2007 21:50:49 GMT
From: "John W. Krahn" <someone@example.com>
Subject: Re: a nice little perl utility
Message-Id: <ZKuSi.45435$%B2.13099@edtnps82>

Michele Dondi wrote:
> On Fri, 12 Oct 2007 11:15:35 -0700, "Wade Ward" <zaxfuuq@invalid.net>
> wrote:
> 
>>I find myself, as a perl learner on windows, always doing the same thing in 
>>order to get a script's output.  I finally decided to remember some dos and 
>>automate the process with a batch file.  You place it in the directory where 
>>windows always opens a dos window, go back to the root, then up to where 
>>perl.exe lives:
>>perl1.bat:
>>echo on
>>cd ..
>>cd ..
>>cd perl
>>cd bin
> 
> I'm ASTONISHED!! Why on hell do you need to do that?!?
> 
>>http://www.zaxfuuq.net/perl6.htm
> 
> You're assuming wrong that for all users the DOS windows will open in
> that directory as you can set it to what you like. I, for one, set it
> to C:\temp.
> 
> Incidentally you don't need 4 different cd's where one would suffice:
> 
>   cd \perl\bin
> 
> this is also better in that it will not depend on the starting
> directory to be "C:\Documents and Settings\Merl".

If I remember my DOS correctly (and it has been a while) that will change to
the \perl\bin directory on the current drive so if the current drive is E: for
example that will try to cd to E:\perl\bin.

The correct answer is to install Unix/Linux and don't worry about drive
letters.   :-)



John
-- 
Perl isn't a toolbox, but a small machine shop where you can special-order
certain sorts of tools at low cost and in short order.       -- Larry Wall


------------------------------

Date: Sat, 20 Oct 2007 18:48:40 -0700
From: "Wade Ward" <zaxfuuq@invalid.net>
Subject: Re: a nice little perl utility
Message-Id: <G4GdnW99CpV-PIfanZ2dnUVZ_g-dnZ2d@comcast.com>




"John W. Krahn" <someone@example.com> wrote in message 
news:ZKuSi.45435$%B2.13099@edtnps82...
> Michele Dondi wrote:
>> On Fri, 12 Oct 2007 11:15:35 -0700, "Wade Ward" <zaxfuuq@invalid.net>
>> wrote:
>>
>>>I find myself, as a perl learner on windows, always doing the same thing 
>>>in
>>>order to get a script's output.  I finally decided to remember some dos 
>>>and
>>>automate the process with a batch file.  You place it in the directory 
>>>where
>>>windows always opens a dos window, go back to the root, then up to where
>>>perl.exe lives:
>>>perl1.bat:
>>>echo on
>>>cd ..
>>>cd ..
>>>cd perl
>>>cd bin
>>
>> I'm ASTONISHED!! Why on hell do you need to do that?!?
>>
>>>http://www.zaxfuuq.net/perl6.htm
>>
>> You're assuming wrong that for all users the DOS windows will open in
>> that directory as you can set it to what you like. I, for one, set it
>> to C:\temp.
>>
>> Incidentally you don't need 4 different cd's where one would suffice:
>>
>>   cd \perl\bin
>>
>> this is also better in that it will not depend on the starting
>> directory to be "C:\Documents and Settings\Merl".
>
> If I remember my DOS correctly (and it has been a while) that will change 
> to
> the \perl\bin directory on the current drive so if the current drive is E: 
> for
> example that will try to cd to E:\perl\bin.
>
> The correct answer is to install Unix/Linux and don't worry about drive
> letters.   :-)
Why would I put C's red-headed stepchild on a completely clean xp 
installation?

I've been working with the hints that have been given on how to make 
ActivePerl, and I've got a long way to go.

I now put s cript at the end of a sript that becomes what I feed my dos 
window.  As in this:

I can't shake these warnings, and I don't know what they're coming from:
Use of uninitialized value in concatenation (.) or string at jabba5.pl line 
65.
Use of uninitialized value in concatenation (.) or string at jabba5.pl line 
67.
Use of uninitialized value in concatenation (.) or string at jabba5.pl line 
75.

Here's the full script:
#!/usr/bin/perl

use strict;
use warnings;
use Net::NNTP ();

use constant NUMBER_OF_ARTICLES    => 1;
use constant GROUP_NAME        => 'comp.lang.perl.misc';
use constant SERVER_NAME    => 'newsgroups.comcast.net';
use constant NNTP_DEBUG        => 0;

my $nntp = Net::NNTP->new(SERVER_NAME, 'Debug' => NNTP_DEBUG) or die;
my $USER = '';
my $PASS = '';

$nntp->authinfo($USER,$PASS) or die $!;


my($article_count, $first_article, $last_article) =

$nntp->group(GROUP_NAME) or die;


# Which XOVER fields contain Subject: and From:?
my $count = 0;
my %xover_fmt = map( ($_, $count++), @{ $nntp->overview_fmt or die} );
die unless exists $xover_fmt{'Subject:'};
my $subject_offset = $xover_fmt{'Subject:'};
my $from_offset = $xover_fmt{'From:'};

my(@xover, $start_article);
RETRIEVE: while ($#xover+1 < NUMBER_OF_ARTICLES and $last_article >=

$first_article) {

    # How many articles do we need?  Stop retrieving if we have enough
    my $articles_required = NUMBER_OF_ARTICLES - ($#xover+1) or last

RETRIEVE;


    # Fetch overview information for the articles
    $start_article = $last_article - ($articles_required-1);
    $start_article = $start_article > $first_article ? $start_article :

$first_article;

    my $xover_query = $start_article == $last_article ?
    $start_article :
    [$start_article, $last_article];
    my $xover_ref = $nntp->xover($xover_query) or die;

    # Store headers for the articles we've retrieved
    foreach (sort {$b <=> $a} keys %$xover_ref) {
        push @xover, $xover_ref->{$_};
    }
} continue {
    # Move the pointer forward to fetch previous articles
    $last_article = $start_article - 1;
}

# Disconnect from the NNTP server
$nntp->quit;
# this isUseless use of a constant in void context at jabba5.pl line

#57.
#Use of uninitialized value in concatenation (.) or string at jabba5.pl

#line 64.
my $s4 = join("\n", map ($_->[$subject_offset],@xover));
# fucksyntax error at jabba4.pl line 59, near "fuck
print STDOUT " s4 is $s4\n";

my @words = split " ", $s4;

print STDOUT " first word is $words[1]";
print STDOUT " third word is $words[3]";
$words[0] = reverse $words[0];
print STDOUT " third word is $words[3]\n";
#Useless use of a constant in void context at jabba5.pl line 58.
#Use of uninitialized value in concatenation (.) or string at jabba5.pl

#line 65.


#big finish

print STDOUT " $words[1] $words[2]";
print STDOUT " $words[0] \n";

__END__

# perl jabba5.pl 2>text27.txt >text26.txt
Output is:
 s4 is Re: perl standard
 first word is perl third word is  third word is
 perl standard :eR
-- 
wade ward






-- 
wade ward
"Nicht verzagen, Bruder Grinde fragen."




------------------------------

Date: Sat, 20 Oct 2007 20:09:09 -0700
From:  Ron Bergin <rkb@i.frys.com>
Subject: Re: a nice little perl utility
Message-Id: <1192936149.250861.44970@e9g2000prf.googlegroups.com>

On Oct 20, 6:48 pm, "Wade Ward" <zaxf...@invalid.net> wrote:
>
[snip unrelated stuff]

> I've been working with the hints that have been given on how to make
> ActivePerl, and I've got a long way to go.
>
> I now put s cript at the end of a sript that becomes what I feed my dos
> window.  As in this:

You do a very good job of making yourself incomprehensible.
>
> I can't shake these warnings, and I don't know what they're coming from:
> Use of uninitialized value in concatenation (.) or string at jabba5.pl line
> 65.
> Use of uninitialized value in concatenation (.) or string at jabba5.pl line
> 67.
> Use of uninitialized value in concatenation (.) or string at jabba5.pl line
> 75.
You need to clearly point out to us those lines of code so we can help
you.
>
> Here's the full script:
> #!/usr/bin/perl
>
> use strict;
> use warnings;
> use Net::NNTP ();
>
> use constant NUMBER_OF_ARTICLES    => 1;
> use constant GROUP_NAME        => 'comp.lang.perl.misc';
> use constant SERVER_NAME    => 'newsgroups.comcast.net';
> use constant NNTP_DEBUG        => 0;
>
> my $nntp = Net::NNTP->new(SERVER_NAME, 'Debug' => NNTP_DEBUG) or die;
> my $USER = '';
> my $PASS = '';
>
> $nntp->authinfo($USER,$PASS) or die $!;
>
> my($article_count, $first_article, $last_article) =
>
> $nntp->group(GROUP_NAME) or die;
>
> # Which XOVER fields contain Subject: and From:?
> my $count = 0;
> my %xover_fmt = map( ($_, $count++), @{ $nntp->overview_fmt or die} );
> die unless exists $xover_fmt{'Subject:'};
> my $subject_offset = $xover_fmt{'Subject:'};
> my $from_offset = $xover_fmt{'From:'};
>
> my(@xover, $start_article);
> RETRIEVE: while ($#xover+1 < NUMBER_OF_ARTICLES and $last_article >=
>
> $first_article) {
Why did you break up that while declaration across 3 lines?  The only
reason that I can think of is that you wanted to keep the line length
below 80 characters, but then you would only need 2 lines, the blank
line in the middle doesn't make sense.  If you wanted to keep the line
length below 80 chars, you could have put the label on its own line.

RETRIEVE:
while ($#xover+1 < NUMBER_OF_ARTICLES and $last_article >=
$first_article) {

>
>     # How many articles do we need?  Stop retrieving if we have enough
>     my $articles_required = NUMBER_OF_ARTICLES - ($#xover+1) or last
>
> RETRIEVE;
>
>     # Fetch overview information for the articles
>     $start_article = $last_article - ($articles_required-1);
>     $start_article = $start_article > $first_article ? $start_article :
>
> $first_article;

Here, you did the same type of line splitting and several more times
further down for no real good reason.
>
>     my $xover_query = $start_article == $last_article ?
>     $start_article :
>     [$start_article, $last_article];
>     my $xover_ref = $nntp->xover($xover_query) or die;
>
>     # Store headers for the articles we've retrieved
>     foreach (sort {$b <=> $a} keys %$xover_ref) {
>         push @xover, $xover_ref->{$_};
>     }} continue {
>
>     # Move the pointer forward to fetch previous articles
>     $last_article = $start_article - 1;
>
> }
>
> # Disconnect from the NNTP server
> $nntp->quit;
> # this isUseless use of a constant in void context at jabba5.pl line
>
> #57.
> #Use of uninitialized value in concatenation (.) or string at jabba5.pl
>
> #line 64.
> my $s4 = join("\n", map ($_->[$subject_offset],@xover));
> # fucksyntax error at jabba4.pl line 59, near "fuck
> print STDOUT " s4 is $s4\n";
>
> my @words = split " ", $s4;
>
> print STDOUT " first word is $words[1]";
> print STDOUT " third word is $words[3]";
> $words[0] = reverse $words[0];
> print STDOUT " third word is $words[3]\n";
> #Useless use of a constant in void context at jabba5.pl line 58.
> #Use of uninitialized value in concatenation (.) or string at jabba5.pl
>
> #line 65.
>
> #big finish
>
> print STDOUT " $words[1] $words[2]";
> print STDOUT " $words[0] \n";
>
> __END__
>
> # perl jabba5.pl 2>text27.txt >text26.txt
> Output is:
>  s4 is Re: perl standard
>  first word is perl third word is  third word is
>  perl standard :eR
> --
> wade ward
>
> --
Due to your addition of the comments after the fact that don't fully
correspond with the line numbers stated at the beginning, I can't be
sure, but I'd say that the printing of $words[3] is the cause of the
"Use of uninitialized value in concatenation".  Your print statement
that outputs the $s4 var clearly shows that it holds 3 "words".
$words[3] would be the 4th word, if there was one.



------------------------------

Date: Sat, 20 Oct 2007 15:46:20 -0700
From:  rbe <bernecky@gmail.com>
Subject: Re: ACM SIGAPL / APL2007 Conference / Montreal / one week away
Message-Id: <1192920380.625668.221960@i13g2000prf.googlegroups.com>

On Oct 15, 5:22 am, Mike Kent <mk...@acm.org> wrote:
> Conference page
>         // with links to program details //
>                 (updated Friday 10/12)
>
>        http://www.sigapl.org/apl2007.html...

At APL2007, I'll be announcing the release of the APEX APL compiler,
version 0.0.0, under GPL Version 2.
If you can't wait until then, you can download it for Dyalog Linux at
www.snakeisland.com.

Bob



------------------------------

Date: Sat, 20 Oct 2007 18:18:11 +0200
From: "Petr Vileta" <stoupa@practisoft.cz>
Subject: Re: cgi_bin
Message-Id: <ffe2e4$1us9$1@ns.felk.cvut.cz>

Jürgen Exner wrote:
> Nick Wedd wrote:
>> When I first wrote Perl cgi scripts to run on web sites, I was told
>> to put them in a directory called cgi_bin.  I did so, assuming either
>> that the name of the directory was significant, or that the cgi_bin
>> provided by the web host has some magic property.
>>
>> As I have written more scripts and used more servers, I have come to
>> realise that this is not at all necessary.  I can put a cgi script
>> wherever I like, just as I can a .gif file.  There is no magic
>> involved.
>> So why did books and web hosts once encourage the use of a directory
>> called cgi_bin?  Have things changed, or was it always irrelevant
>> where you kept your cgi scripts?
>
> This is a question about which webserver you are using, how it is
> configured, and best practices for structuring web sites.
> It has nothing to do with Perl and you may get much better responses
> asking a NG that actually deals with web servers and web sites.
>
I want to throw in that in cgi-bin directory can be stored native _binary_ 
files, executabe of course. For example "cgiecho", "cgimail", "webcounter" 
or some similar utilities ready-to-use on web pages.
-- 

Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your mail 
from another non-spammer site please.)





------------------------------

Date: Sun, 21 Oct 2007 03:35:46 GMT
From: still me <wheeledBob@yahoo.com>
Subject: Re: cgi_bin
Message-Id: <olhlh3dpeb15trpq9bc1m14j3k308cktbt@4ax.com>

On Sat, 20 Oct 2007 12:36:25 GMT, "Jürgen Exner"
<jurgenex@hotmail.com> wrote:

>This is a question about which webserver you are using, how it is 
>configured, and best practices for structuring web sites.
>It has nothing to do with Perl and you may get much better responses asking 
>a NG that actually deals with web servers and web sites.

Or, more directly, if you can put cgi programs in any directory on
your web server and they execute, the web server is very poorly
configured. I'd have serious questions about the abilities of the
people running the web server. In addition, There are also a lot of
aspects of having executable programs running from only one directory
that you can use to your advantage in laying out your web site (that
go away in a loose structure). 



------------------------------

Date: Sat, 20 Oct 2007 13:43:14 -0700
From:  "j.oke" <java.oke@gmail.com>
Subject: Re: Distributed RVS, Darcs, tech love
Message-Id: <1192912994.023039.180120@v29g2000prd.googlegroups.com>

On 20 Ott, 05:28, Xah Lee <x...@xahlee.org> wrote:
>

yes-and-no.



------------------------------

Date: Sat, 20 Oct 2007 14:04:06 -0700
From:  llothar <llothar@web.de>
Subject: Re: Distributed RVS, Darcs, tech love
Message-Id: <1192914246.208743.94870@y27g2000pre.googlegroups.com>


> I love math. I respect Math. I'm nothing but a menial servant to
> Mathematics.

Programming and use cases are not maths. Many mathematics are
the worst programmers i've seen because they want to solve things and
much more often you just need heuristics. Once they are into exact
world they loose there capability to see the factor of relevance in
algorithms.

And they almost never match the mental model that the average
user has about a problem.



------------------------------

Date: Sun, 21 Oct 2007 01:20:47 -0000
From:  Daniel Pitts <googlegroupie@coloraura.com>
Subject: Re: Distributed RVS, Darcs, tech love
Message-Id: <1192929647.405490.318720@v29g2000prd.googlegroups.com>

On Oct 20, 2:04 pm, llothar <llot...@web.de> wrote:
> > I love math. I respect Math. I'm nothing but a menial servant to
> > Mathematics.
>
> Programming and use cases are not maths. Many mathematics are
> the worst programmers i've seen because they want to solve things and
> much more often you just need heuristics. Once they are into exact
> world they loose there capability to see the factor of relevance in
> algorithms.
>
> And they almost never match the mental model that the average
> user has about a problem.

I read somewhere that for large primes, using Fermat's Little Theorem
test is *good enough* for engineers because the chances of it being
wrong are less likely than a cosmic particle hitting your CPU at the
exact instant to cause a failure of the same sort.  This is the
primary difference between engineers and mathematicians.



------------------------------

Date: Sat, 20 Oct 2007 22:41:04 -0400
From: George Neuner <gneuner2/@/comcast.net>
Subject: Re: Distributed RVS, Darcs, tech love
Message-Id: <kjelh35gcbhbs49hg33tsc5iojaep9c817@4ax.com>

On Sun, 21 Oct 2007 01:20:47 -0000, Daniel Pitts
<googlegroupie@coloraura.com> wrote:

>On Oct 20, 2:04 pm, llothar <llot...@web.de> wrote:
>> > I love math. I respect Math. I'm nothing but a menial servant to
>> > Mathematics.
>>
>> Programming and use cases are not maths. Many mathematics are
>> the worst programmers i've seen because they want to solve things and
>> much more often you just need heuristics. Once they are into exact
>> world they loose there capability to see the factor of relevance in
>> algorithms.
>>
>> And they almost never match the mental model that the average
>> user has about a problem.
>
>I read somewhere that for large primes, using Fermat's Little Theorem
>test is *good enough* for engineers because the chances of it being
>wrong are less likely than a cosmic particle hitting your CPU at the
>exact instant to cause a failure of the same sort.  This is the
>primary difference between engineers and mathematicians.

An attractive person of the opposite sex stands on the other side of
the room.  You are told that your approach must be made in a series of
discrete steps during which you may close half the remaining distance
between yourself and the other person.

Mathematician: "But I'll never get there!"

Engineer: "I'll get close enough."


--
for email reply remove "/" from address


------------------------------

Date: Sat, 20 Oct 2007 22:42:26 -0400
From: Lew <lew@lewscanon.com>
Subject: Re: Distributed RVS, Darcs, tech love
Message-Id: <pN6dnVf5bfEPIYfanZ2dnUVZ_gGdnZ2d@comcast.com>

George Neuner wrote:
> An attractive person of the opposite sex stands on the other side of
> the room.  You are told that your approach must be made in a series of
> discrete steps during which you may close half the remaining distance
> between yourself and the other person.
> 
> Mathematician: "But I'll never get there!"
> 
> Engineer: "I'll get close enough."

Mechanician (to the researcher): Hey, you look pretty good.  What's your sign?

-- 
Lew


------------------------------

Date: Sun, 21 Oct 2007 11:20:10 +0800
From: Amy Lee <openlinuxsource@gmail.com>
Subject: Help: Count characters
Message-Id: <pan.2007.10.21.03.20.08.989453@gmail.com>

Hello,

I make a small perl script to count how many sequences in a fasta
formation file. In fasta formation file every sequence starts with a ">",
so I can count how many ">" in a file.

There's my code:

if (@ARGV != 0)
{
  foreach $file (@ARGV)
  {
    unless (-e $file)
    {
      print "***Error: $file dose not exist.\n";
      next;
    }
    unless (open $FILE_IN, '<', $file)
    {
      print "***Error: Cannot read $file.\n";
      next;
    }
    $full_size = (stat($file))[7];
    while (<$FILE_IN>)
    {
      s/>//g;
    }
    $mod_size = (stat($FILE_IN))[7];
    $num = $full_size-$mod_size;
    close $FILE_IN;
    print "$file ==> $num seq.\n"
  }
}

However, when I run this script, it always shows "0 seqs". I don't know
what happened. And is there any better way to count ">"?

Thank you very much~

Regards,

Amy Lee


------------------------------

Date: Sun, 21 Oct 2007 04:02:08 GMT
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: Help: Count characters
Message-Id: <slrnfhlj0s.ir1.tadmc@tadmc30.sbcglobal.net>

Amy Lee <openlinuxsource@gmail.com> wrote:


> I make a small perl script to count how many sequences in a fasta
> formation file. In fasta formation file every sequence starts with a ">",
> so I can count how many ">" in a file.


You can do that with a one-liner:

   perl -ne '$cnt += tr/>//; END{print "$cnt\n"}' file1 file2


> There's my code:
>
> if (@ARGV != 0)
> {
>   foreach $file (@ARGV)
>   {
>     unless (-e $file)
>     {
>       print "***Error: $file dose not exist.\n";
>       next;
>     }
>     unless (open $FILE_IN, '<', $file)


You open the file for reading.


>     {
>       print "***Error: Cannot read $file.\n";
>       next;
>     }
>     $full_size = (stat($file))[7];
>     while (<$FILE_IN>)
>     {
>       s/>//g;
>     }
>     $mod_size = (stat($FILE_IN))[7];


Why do you expect that a file you opened for reading would
change its file size?


>     $num = $full_size-$mod_size;
>     close $FILE_IN;
>     print "$file ==> $num seq.\n"
>   }
> }
>
> However, when I run this script, it always shows "0 seqs". I don't know
> what happened. 


You never wrote the modified lines anywhere.


> And is there any better way to count ">"?


See above.


-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"


------------------------------

Date: Sat, 20 Oct 2007 21:08:40 -0700
From:  Ron Bergin <rkb@i.frys.com>
Subject: Re: Help: Count characters
Message-Id: <1192939720.412963.200380@q5g2000prf.googlegroups.com>

On Oct 20, 8:20 pm, Amy Lee <openlinuxsou...@gmail.com> wrote:
> Hello,
>
> I make a small perl script to count how many sequences in a fasta
> formation file. In fasta formation file every sequence starts with a ">",
> so I can count how many ">" in a file.
>
> There's my code:
>
> if (@ARGV != 0)
> {
>   foreach $file (@ARGV)
>   {
>     unless (-e $file)
>     {
>       print "***Error: $file dose not exist.\n";
>       next;
>     }
>     unless (open $FILE_IN, '<', $file)
>     {
>       print "***Error: Cannot read $file.\n";
>       next;
>     }
>     $full_size = (stat($file))[7];
>     while (<$FILE_IN>)
>     {
>       s/>//g;
>     }
You're not maintaining a count of the number of substitutions.

>     $mod_size = (stat($FILE_IN))[7];
>     $num = $full_size-$mod_size;
>     close $FILE_IN;
>     print "$file ==> $num seq.\n"
>   }
Since the file was opened in read only mode, its size will not have
been changed.
>
> }
>
> However, when I run this script, it always shows "0 seqs". I don't know
> what happened. And is there any better way to count ">"?
perldoc -q "how do I count the number of lines in a file"
>
> Thank you very much~
>
> Regards,
>
> Amy Lee



------------------------------

Date: Sun, 21 Oct 2007 03:44:10 GMT
From: still me <wheeledBob@yahoo.com>
Subject: Re: Is perl a good candidate for Data Mining
Message-Id: <pbilh3daarls65d4mbaebhotau9vljf9p0@4ax.com>

On Thu, 18 Oct 2007 14:12:10 +0200, "Petr Vileta"
<stoupa@practisoft.cz> wrote:

>Yes, Perl is a good candidate to this type of job. You can use any other 
>language which know RegExp but perl script is all time source code and you 
>must not to compile it before running. This is a big advantage in debug time 
>;-)
>Possible other candidates are C (C++), Python, PHP, but PHP is not a good 
>idea for long run time.

Perl is much better at playing with text strings than the others. 


------------------------------

Date: Sat, 20 Oct 2007 15:07:37 -0700
From: sln@netherlands.co
Subject: Re: perl standard
Message-Id: <ejtkh3d969fnitv4rk92qf3dd62ac13jm1@4ax.com>

On Sat, 20 Oct 2007 00:51:41 +0000 (UTC), Ben Bullock <benkasminbullock@gmail.com> wrote:

>On Sat, 20 Oct 2007 01:32:53 +0200, Michele Dondi wrote:
>
>> On Fri, 19 Oct 2007 22:10:13 +0000 (UTC), Ben Bullock
>> <benkasminbullock@gmail.com> wrote:
>> 
>>>You are claiming that Perl is "defined by its implementation" while at the
>>>same time failing to define clearly what "implementation" means. If
>>>the documentation which comes with Perl is inconsistent with the behaviour
>>>of the computer program "perl", is the documentation correct and the
>>>program faulty, or vice-versa? Or what if "perl" has some abilities which
>> 
>> It depends: p5p's can tell. Someone must take care of making them
>> agree.
>
>In other words you're admitting that the language isn't actually defined
>anywhere.


Perl is a "hack" script language, defined by some "implementation", on some
day, at some point in time. As such, it doesen't rise, and will not rise to,
a level of a needing a standard. This is what won't be said here.
Its no different than any other "hack" scripting language out there, that
are born, live a half-life, then die (or evolve before its death) a disinterrested
death.

Ask Microsoft why they don't do a flavor of Perl. Is it because Larry (and a few
others) said no? Surely Microsoft could make a much more POWERFULL Perl.
They do have thier own "flavor" of regular expression processing and hashing isin't something
unique to Perl, its been around since the beginning of (?), ahh, well along time now.
And language constructs distill down to boolean logic still, I may be wrong, Perl may
be doing something different.

Perl is cryptic in its syntax though, have to give it to Larray (and the gang) there.
The there's the trendy saying "why reinvent the wheel", use a CPAN module to do it.
But unfortunately, CPAN is a CSPAM and not so "quality", but hey, what do you wan't
for free (a relative term). If its good, they will even include it in the distribution.

Bottom line, Perl does not have, nor never will have a Standard. It's nothing special
at all. It is cryptic, I'll give u that though.





------------------------------

Date: Sat, 20 Oct 2007 15:13:13 -0700
From: sln@netherlands.co
Subject: Re: perl standard
Message-Id: <8avkh3hhfci9okkg9qn8su9f5tl8112i8c@4ax.com>

On Sat, 20 Oct 2007 15:39:58 +0200, Michele Dondi <bik.mido@tiscalinet.it> wrote:

>On Fri, 19 Oct 2007 23:03:26 -0700, "Wade Ward" <zaxfuuq@invalid.net>
>wrote:
>
>>I'm embarrassed now, because I thought for sure that Perl had been admitted 
>>to computer languages for grown-ups.  Apparently not.
>
>Don't be embarassed: if you feel like abandoning it altogether, then
>please don't shy away from your inspiration or you may regret it
>later!
>
>
>Michele

Thats some excellent advice, your an inspiration for me!



------------------------------

Date: Sat, 20 Oct 2007 16:55:34 -0700
From: sln@netherlands.co
Subject: Re: perl standard
Message-Id: <q75lh3tbq19f966ef4q946o4l2g6s86kk9@4ax.com>

On Fri, 19 Oct 2007 20:29:52 +0200, Michele Dondi <bik.mido@tiscalinet.it> wrote:

>On Fri, 19 Oct 2007 17:42:14 GMT, Uri Guttman <uri@stemsystems.com>
>wrote:
>
>>seem to work so who knows!? anyone seen the antiscam commercials
>>(sponsored by the post office!) which show a f2f nigerian style scam and
>>how silly they seem in person?
>
>Occasionally seen some services off a very popular satyrical news
>program of Italian television, in which a fake victim contacts them
>and pretends to be going to give the money... until the spokeperson
>pops out with microphone and cameras.
>
>
>[*] Not technical English and thus some terms may be lexically
>inaccurate. If people understand nontheless, then please correct me.
>
>
>Michele

Hey we all can't be from the Land of the Brave, and Home of the Free.
Its a pity you can't define English, or ah, technical English (wtf is that?).




------------------------------

Date: Sun, 21 Oct 2007 09:27:07 +0900
From: "Ben Bullock" <benkasminbullock@gmail.com>
Subject: Re: perl standard
Message-Id: <ffe6cp$6ge$1@ml.accsnet.ne.jp>


"Michele Dondi" <bik.mido@tiscalinet.it> wrote in message 
news:511kh3hqhn9lcm03v2igptht7eottduhqf@4ax.com...
> On Sat, 20 Oct 2007 05:40:02 +0000 (UTC), Ben Bullock
> <benkasminbullock@gmail.com> wrote:
>
>>> Amazing, it still works better than anything else I have used.
>>
>>I agree that it works, but does that necessarily mean we shouldn't ask
>>questions about how the language is defined?
>
> No you can just fine. In fact you did, and you were answered, even
> though you didn't like the answer. Happens...

No, you did not answer the question. Happens...

>>> As uncertainties arise, Larry and
>>> others try to agree on what changes are necessary to make the
>>> implementation do what people think it should do.
>>
>>So Perl is defined by what Larry and others think that people think it
>>should do.
>
> Do you find that so disserviceable to the community? FWIW my personal
> experience is the Larry and others mostly got it right: occasionally
> this is not the case, but I can live with it.

I don't remember questioning Larry Wall's decision-making powers anywhere, 
but I suppose when you've been defeated by someone in a discussion you have 
to try to change the subject.





------------------------------

Date: Sun, 21 Oct 2007 09:40:48 +0900
From: "Ben Bullock" <benkasminbullock@gmail.com>
Subject: Re: perl standard
Message-Id: <ffe76e$6kl$1@ml.accsnet.ne.jp>


<sln@netherlands.co> wrote in message 
news:ejtkh3d969fnitv4rk92qf3dd62ac13jm1@4ax.com...
> Perl is a "hack" script language, defined by some "implementation", on 
> some
> day, at some point in time. As such, it doesen't rise, and will not rise 
> to,
> a level of a needing a standard. This is what won't be said here.
> Its no different than any other "hack" scripting language out there, that
> are born, live a half-life, then die (or evolve before its death) a 
> disinterrested
> death.

Well, I don't see it dying soon, since a lot of people still use Perl. Even 
if it has been mostly abandoned by the younger generation of programmers in 
favour of Python and PHP, it's still in wide use.

> Ask Microsoft why they don't do a flavor of Perl. Is it because Larry (and 
> a few
> others) said no? Surely Microsoft could make a much more POWERFULL Perl.

I have doubts about this. Microsoft can't get seem to get even 
multiplication right:

http://www.theregister.co.uk/2007/09/26/excel_2007_bug/

I don't think they could make a "much more powerful Perl".

> They do have thier own "flavor" of regular expression processing

Have you ever tried to use the "regular expressions" which come with 
Microsoft Word?





------------------------------

Date: Sun, 21 Oct 2007 02:16:25 +0100
From: RedGrittyBrick <RedGrittyBrick@SpamWeary.foo>
Subject: Re: perl standard
Message-Id: <4--dnVF-ArbtNYfanZ2dneKdnZydnZ2d@bt.com>

sln@netherlands.co wrote:

> Its a pity you can't define English

Does he need to?

http://www.oed.com/
"News
English Defined"


------------------------------

Date: Sun, 21 Oct 2007 04:02:08 GMT
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: perl standard
Message-Id: <slrnfhljao.ir1.tadmc@tadmc30.sbcglobal.net>

sln@netherlands.co <sln@netherlands.co> wrote:


> Ask Microsoft why they don't do a flavor of Perl. 


People capable of thinking for themselves will not care
what Microsoft's opinion is.


> Is it because Larry (and a few
> others) said no? 


It is likely because they are unwilling to live by its licensing terms.


-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"


------------------------------

Date: Sat, 20 Oct 2007 16:16:08 -0700
From:  jkj <kevin@vexona.com>
Subject: Re: Using IDL from a perl script
Message-Id: <1192922168.279297.181960@v29g2000prd.googlegroups.com>

On Oct 19, 1:02 pm, James Everton <james.ever...@gmail.com> wrote:
> Hi everybody,
>
> I'm developing some web scripts in perl that interact with a database
> through various pre-written IDL procedures here at my work.  The
> problem I'm having is getting arguments passed between the two.
> Passing from the perl into the IDL code is easy enough because I'm
> using the open( ) procedure and simply writing the strings as a block:
>

I've done this a bunch and found it to be very useful... here's a bit
more of what I find works:

use IPC::Open2;

$progName = "idl";
open2(READIDL, WRITEIDL, $progName) or die "Could not begin \"$progName
\"\n";

# Then you can cause IDL to execute commands like this:
print WRITEIDL "value = 13\n";

# I find that output coming back from IDL is cluttered, so before
#   asking IDL to return a value I ask it to spit out "junk":
print WRITEIDL "print, \"junk\"\n";
while(!(<READIDL> =~ /junk/)){
}

# Now I can get the value I want back asking IDL to output it:
print WRITEIDL "print, value\n";
$value = <READIDL>;
chomp($value);

 ...hope that helps,
-Kevin



------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V11 Issue 958
**************************************


home help back first fref pref prev next nref lref last post