Re: Freebsd + cron job +perl script

2007-11-30 Thread patmarbidon
Patrick MARION a écrit : Can you tell more about your script. The first thing about difference between command line dand cron is about environment or perhaps STDIN. Perhaps you can make a trace with several "print tracexxx" at several critical places in your script. Without redirection to

Re: seek and tell

2007-11-30 Thread John W . Krahn
On Friday 30 November 2007 09:07, Beginner wrote: > > Hi, Hello, > Can someone spot and explain what I am doing wrong. > > I have a script that should read the contents of a CD (on Win32). I > want a summary at the top of the page of what I've found. I use find > to count the files and dirs and I

Re: test if nth sign of a string is a number

2007-11-30 Thread Jeff Pang
On Nov 30, 2007 10:56 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hello, > > how can I test if the nth (n=2) sign of a string is a number [0-9]? > Thank you. > Hello, Given you have this string: $str = "a9d0"; you can check if the 2nd character is a number or not by: my $c = substr($str,

Re: Trouble with Email::MIME modules

2007-11-30 Thread Celejar
On Tue, 27 Nov 2007 22:21:06 +0100 "Filip Sneppe" <[EMAIL PROTECTED]> wrote: > I am calling this code like this: > > my $parser = new MIME::Parser; > $entity = $parser->parse_data($lines); > $convertedstring = convert_mime_to_8bit($log_fh, $loglevel, > $entity, ""); > > w

test if nth sign of a string is a number

2007-11-30 Thread [EMAIL PROTECTED]
Hello, how can I test if the nth (n=2) sign of a string is a number [0-9]? Thank you. Guenter -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Question abount counting the total number of lines and put to an variable?

2007-11-30 Thread Marco
Hi Ruud, your script is fantastic..this is the data I really need. Thank you... -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: seek and tell

2007-11-30 Thread Beginner
On 30 Nov 2007 at 10:35, John W.Krahn wrote: > On Friday 30 November 2007 09:07, Beginner wrote: > Hello, > [ SNIP ] > > > $| = 1; > > You never print to STDOUT so that line is superfluous. > > my $in = 0; > > > > my $sRootPath = 'e:/'; > > > > my > > ($osVolName,$lVolName,$ouSerialNum,$ouMaxN

Re: seek and tell

2007-11-30 Thread [EMAIL PROTECTED]
On Nov 30, 5:07 pm, [EMAIL PROTECTED] (Beginner) wrote: > Can someone spot and explain what I am doing wrong. Yes. > I have a script that should read the contents of a CD (on Win32). I > want a summary at the top of the page of what I've found. I use find > to count the files and dirs and I want

Re: Comparing Regular Expression in Perl vs Python

2007-11-30 Thread John W . Krahn
On Friday 30 November 2007 06:58, yitzle wrote: > > I've been using Perl for only about 1.5 years, and never touched > Python. About 16 months ago, I decided to learn a "scripting > language" that I've heard mentioned so many times. I was debating > between Perl and Python. I'm not quite sure why I

seek and tell

2007-11-30 Thread Beginner
Hi, Can someone spot and explain what I am doing wrong. I have a script that should read the contents of a CD (on Win32). I want a summary at the top of the page of what I've found. I use find to count the files and dirs and I want the total files ($in) to be a the top before I list the files.

Re: Comparing Regular Expression in Perl vs Python

2007-11-30 Thread John W . Krahn
On Friday 30 November 2007 08:00, Jenda Krynicky wrote: > > You can write Perl with good style ... it's just that there are > several or even many equaly good styles. So everyone's code doesn't > look the same. Or just use perltidy to make everyone's code look the same. :-) John -- use Perl;

Re: Comparing Regular Expression in Perl vs Python

2007-11-30 Thread yitzle
On Nov 30, 2007 9:18 AM, Jeff Pang <[EMAIL PROTECTED]> wrote: > both you and Paul mentioned that perl is maybe easier to learn than python. > but from many ppl's experience (including mine), python is easier to > get begin with. > > One of the advantages of python is that it can write code with goo

Re: Comparing Regular Expression in Perl vs Python

2007-11-30 Thread Jenda Krynicky
!toppost not do Please I'll one more. Maybe there are more places to ask about Perl than Python. So the community is spread out around more lists and forums. (Say perlmonks.org) To get a meaningful number we'd have to to total the numbers of posts in all Python and all Perl lists&forums. Jen

Re: Comparing Regular Expression in Perl vs Python

2007-11-30 Thread Jeff Pang
both you and Paul mentioned that perl is maybe easier to learn than python. but from many ppl's experience (including mine), python is easier to get begin with. One of the advantages of python is that it can write code with good style, everyone's code looks the same.but for perl's code style, oops

Re: Comparing Regular Expression in Perl vs Python

2007-11-30 Thread Paul Johnson
On Wed, Nov 28, 2007 at 07:54:14AM -0800, JBallinger wrote: > I recently heard about Python. They claimed that it is easier to learn > and to program in Python than in Perl. On Fri, Nov 30, 2007 at 09:00:59PM +0800, Jeff Pang wrote: > I also subscribed to python list, found that python list's me

Re: Question abount counting the total number of lines and put to an variable?

2007-11-30 Thread patmarbidon
Try this : my $number = 0 ; open (MYFILE, '123.txt'); while () { if ($_ =~ /^User:/) { ++$number ; print $_; } } close (MYFILE); print "Number:$number\n" ; Marco a écrit : Hi.. I have a question about how to count the total of line that shows on the screen. Here below is my code

Re: Comparing Regular Expression in Perl vs Python

2007-11-30 Thread Jeff Pang
I also subscribed to python list, found that python list's message amount is much larger than perl beginner's. I almost got 100 messages each day in that list. Does this indicate that python has more users than perl? On Nov 30, 2007 5:17 PM, Purohit, Bhargav <[EMAIL PROTECTED]> wrote: > > Thanks T

Re: Question abount counting the total number of lines and put to an variable?

2007-11-30 Thread Marco
Here blow is the code I did.. open (MYFILE, '123.txt'); while () { if ($_ =~ /^User:/){ $count = $_+1; print "$count\n"; } } close (MYFILE); But it shows the result below, 1 1 1 How can I add those together become 3 ? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional com

RE: Comparing Regular Expression in Perl vs Python

2007-11-30 Thread Purohit, Bhargav
Thanks Tom for describing perl in very short but very sweet way! "In a perfect world, you would learn every possible programming language, then you could always choose the best one for each task. If you did that, you'd probably write most of your programs in Perl." -Original Message- Fr

Re: fixed list combinatorics

2007-11-30 Thread Xavier Noria
On Nov 29, 2007, at 2:06 AM, Xavier Noria wrote: Indeed, the iterator provided by Algorithm::Combinatorics is faster only for lists of sizes >= 7. (And gets to be twice as fast for size 16.) Certainly there's room for improvement here. For the archives, I copied the iterator in List::Power

Re: Comparing Regular Expression in Perl vs Python

2007-11-30 Thread hwigoda
it may mean that fewer people ask questions about perl because 1) perl is easier to use 2) perl is more mature and people are more versed in it 3) python is newer so more people are unfamiliar with it 4) people are afraid to ask questions on the perl list for fear of being told to RTFM -Orig

Re: Comparing Regular Expression in Perl vs Python

2007-11-30 Thread Jenda Krynicky
From: "Jeff Pang" <[EMAIL PROTECTED]> > both you and Paul mentioned that perl is maybe easier to learn than python. > but from many ppl's experience (including mine), python is easier to > get begin with. > > One of the advantages of python is that it can write code with good > style, everyone's c

Re: test if nth sign of a string is a number

2007-11-30 Thread Tom Phoenix
On 11/30/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > how can I test if the nth (n=2) sign of a string is a number [0-9]? It sounds as if you want to examine a particular character indexed in a string; in Perl that's generally done with the substr() function. You can check whether it's a di

readdir formulated badly? gives wrong count

2007-11-30 Thread reader
Sorry to plop so much shabby code up here but I think I've stared at this a little too long and am now incapable of catching my error. This started out as just a helper script to help solve this problem: Needing to cp files with number names from one directory to another. Sometimes there might be