Re: CGI Header

2007-04-10 Thread Tom Phoenix
On 4/10/07, Jen mlists <[EMAIL PROTECTED]> wrote: How to judge whether I've output the http header or not where in cgi scripts?Thank you. I think you're asking how a programmer can know whether or not the header has already been output when it's time to produce output (in an error-handling sub

CGI Header

2007-04-10 Thread Jen mlists
Hi members, How to judge whether I've output the http header or not where in cgi scripts?Thank you. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: System call

2007-04-10 Thread Tom Phoenix
On 4/10/07, Nath, Alok (STSD) <[EMAIL PROTECTED]> wrote: Can somebody explain the difference between this 2 system calls ? system "grep 'fred flint' buff" This one asks the shell (/bin/sh) to run the command "grep 'fred flint' buff". system "grep", "fred flint", "buff" This one asks

System call

2007-04-10 Thread Nath, Alok (STSD)
Hi, Can somebody explain the difference between this 2 system calls ? system "grep 'fred flint' buff" system "grep", "fred flint", "buff" Thanks Alok -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Data Mungling - Address Book;

2007-04-10 Thread Stanislav Nedelchev
Chas Owens wrote: > On 4/10/07, Stanislav Nedelchev <[EMAIL PROTECTED]> wrote: >> Hi to all >> Here is my problem . I'm trying to export this data to SQL database . >> Here is example data.Don't pay attention on encoding. Every new record >> is starting --=NewRecord=-- >> delimiter between fields a

Re: Data Mungling - Address Book;

2007-04-10 Thread John W. Krahn
Stanislav Nedelchev wrote: > Hi to all Hello, > Here is my problem . I'm trying to export this data to SQL database . > Here is example data.Don't pay attention on encoding. Every new record > is starting --=NewRecord=-- > delimiter between fields and data is = . > Contact=�ГППМП-СЪ�ИМ

Re: Data Mungling - Address Book;

2007-04-10 Thread Chas Owens
On 4/10/07, Stanislav Nedelchev <[EMAIL PROTECTED]> wrote: Hi to all Here is my problem . I'm trying to export this data to SQL database . Here is example data.Don't pay attention on encoding. Every new record is starting --=NewRecord=-- delimiter between fields and data is = . Contact=АГППМП-СЪН

Data Mungling - Address Book;

2007-04-10 Thread Stanislav Nedelchev
Hi to all Here is my problem . I'm trying to export this data to SQL database . Here is example data.Don't pay attention on encoding. Every new record is starting --=NewRecord=-- delimiter between fields and data is = . Contact=АГППМП-СЪНИМЕД-ООД Manager= Region=РЗОК Бургас Municipality= НЕСЕБЪР Se

Re: Sorting dir output

2007-04-10 Thread John W. Krahn
John W. Krahn wrote: > Igor Sutton Lopes wrote: >> >>sub move_file { >> >># using -M is better than doing the calculation to obtain the >>difference >># from now and three days ago. >>return unless -M $_ < 3; > > Why not just use the modified( '>3' ) rule? Ok, modified( '>3' ) won't

Re: Sorting dir output

2007-04-10 Thread Chas Owens
On 4/10/07, John W. Krahn <[EMAIL PROTECTED]> wrote: Igor Sutton Lopes wrote: snip > return unless -M $_ < 3; Why not just use the modified( '>3' ) rule? snip There doesn't seem to be a performance issue either way: Raterule explict rule450/s -- -0% explict 450/s

Re: Sorting dir output

2007-04-10 Thread John W. Krahn
Igor Sutton Lopes wrote: > Sorry! I was testing and sent the last version -TextMate integrated > with Mail.app- :-( > > On Apr 10, 2007, at 4:40 PM, John W. Krahn wrote: > >> [...] >> Did you test this? Where do you distinguish between files "older >> than 3 days" >> and other files? Where is

Re: Sorting dir output

2007-04-10 Thread Igor Sutton Lopes
Sorry! I was testing and sent the last version -TextMate integrated with Mail.app- :-( On Apr 10, 2007, at 4:40 PM, John W. Krahn wrote: [...] Did you test this? Where do you distinguish between files "older than 3 days" and other files? Where is "name('trunk')" specified by the OP? Th

Re: Sorting dir output

2007-04-10 Thread John W. Krahn
Igor Sutton Lopes wrote: > > On Apr 10, 2007, at 3:27 PM, John W. Krahn wrote: > >> Craig Schneider wrote: >> >>> How could I exec a 'dir' command on a dos system and put the output in >>> an array, sort by date and the files that are older than 3 days be >>> moved into a folder called 'history

Re: Sorting dir output

2007-04-10 Thread Igor Sutton Lopes
Hi, On Apr 10, 2007, at 3:27 PM, John W. Krahn wrote: Craig Schneider wrote: Hi Guys Hello, How could I exec a 'dir' command on a dos system and put the output in an array, sort by date and the files that are older than 3 days be moved into a folder called 'history' # open the curre

Re: Sorting dir output

2007-04-10 Thread John W. Krahn
Craig Schneider wrote: > Hi Guys Hello, > How could I exec a 'dir' command on a dos system and put the output in > an array, sort by date and the files that are older than 3 days be moved > into a folder called 'history' # open the current directory opendir my $dh, '.' or die "Cannot open '.' $

Re: Trouble with backtracking in RE

2007-04-10 Thread Tom Phoenix
On 4/10/07, Jan Chorowski <[EMAIL PROTECTED]> wrote: I can't understand why the following regexp matches. It doesn't match for me. Are you sure that you posted the correct code? I'm using perl version 5.8.6. --Tom Phoenix Stonehenge Perl Training -- To unsubscribe, e-mail: [EMAIL PROTECTED]

Re: Sorting dir output

2007-04-10 Thread yaron
Hi, If you wish to select all files that are directly under given directory you can implement the following (in pure perl fashion): sub numerically { $b <=> $a;} $DIR = ; $THRESHOLD_IN_DAYS = 3; my %time_to_file; my $currTime = time(); #Store all file in hash with time as key. for each my $

Trouble with backtracking in RE

2007-04-10 Thread Jan Chorowski
Hi, I can't understand why the following regexp matches. It was part of a larger program transformig c++ files: When running: #!/usr/bin/perl "dummy dummy { ;" =~ m{( ^( [^;{}] (?> #<--- disable backtracking (\s|\\\n)* # treat escaped \n as space (// ([^

Re: Sorting dir output

2007-04-10 Thread Ken Foskey
On Tue, 2007-04-10 at 13:19 +0200, Craig Schneider wrote: > Hi Guys > > How could I exec a 'dir' command on a dos system and put the output in > an array, sort by date and the files that are older than 3 days be moved > into a folder called 'history' Look at module File::Find this should be abl

Re: Sorting dir output

2007-04-10 Thread Jeff Pang
Don't know much about dos. But under unix you may got the files older than 3 days by this way, chdir '/the/path'; @files = grep { time - (stat)[9] > 24*60*60*3 } glob "*"; 2007/4/10, Craig Schneider <[EMAIL PROTECTED]>: Hi Guys How could I exec a 'dir' command on a dos system and put the out

Sorting dir output

2007-04-10 Thread Craig Schneider
Hi Guys How could I exec a 'dir' command on a dos system and put the output in an array, sort by date and the files that are older than 3 days be moved into a folder called 'history' Thanks Craig -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] htt

Re: how these two variables are equal numerically?

2007-04-10 Thread Martin Barth
it's: 0 == 0 Hoffmann schrieb: > Dr.Ruud wrote: >> Hoffmann schreef: >> >>> Could some one explain how, in the example below, $name and $goodguy >>> are equal numerically? >>> >>> $name = 'Mar'; >>> >>> $goodguy = 'Tony'; >>> >>> if ($name == $goodguy) { >>> print "Hello, Sir.\n"; >>

Re: Perl: how these two variables are equal numerically?

2007-04-10 Thread Hoffmann
Boga Srinivas wrote: Hi Hoffman, When you are trying to do a numeric comparsion on strings. The interpreter will try to convert them to numbers and then do a comparsion. if it cannot convert to numbers they are made 0's and then it will compare. for more info please refer to this url: ht

Re: how these two variables are equal numerically?

2007-04-10 Thread Hoffmann
Dr.Ruud wrote: Hoffmann schreef: Could some one explain how, in the example below, $name and $goodguy are equal numerically? $name = 'Mar'; $goodguy = 'Tony'; if ($name == $goodguy) { print "Hello, Sir.\n"; } else { print "Begone, evil peon!\n"; } Try also with s

Re: how these two variables are equal numerically?

2007-04-10 Thread Dr.Ruud
Hoffmann schreef: > Could some one explain how, in the example below, $name and $goodguy > are equal numerically? > > $name = 'Mar'; > > $goodguy = 'Tony'; > > if ($name == $goodguy) { > print "Hello, Sir.\n"; > } else { > print "Begone, evil peon!\n"; > } Try also with some

Re: Perl: how these two variables are equal numerically?

2007-04-10 Thread Boga Srinivas
Hi Hoffman, When you are trying to do a numeric comparsion on strings. The interpreter will try to convert them to numbers and then do a comparsion. if it cannot convert to numbers they are made 0's and then it will compare. for more info please refer to this url: http://www.perlmeme.org/ho