Re: Print to new file for each results

2006-08-29 Thread John W. Krahn
Ron McKeever wrote: > I am tring to use part of someones elses code that creates a data file which > prints > out like this: > > ip|result|deptA|data > ip|result|deptB|data > ip|result|deptC|data > > My goal instead of having all the data in one big file is to loop this and > create > a file fo

Print to new file for each results

2006-08-29 Thread Ron McKeever
I am tring to use part of someones elses code that creates a data file which prints out like this: ip|result|deptA|data ip|result|deptB|data ip|result|deptC|data My goal instead of having all the data in one big file is to loop this and create a file for each result. So I would have a deptA.o

Re: Time::Local let me faint

2006-08-29 Thread John W. Krahn
Jeff Pang wrote: >>So if you want to translate 31 August 2006 you have to subtract one from the >>month and 1900 from the year: >> >>$ perl -Mstrict -MTime::Local -le 'print timelocal(0,0,0,31,7,106)' >>1157007600 > > John, > > For the instance described by you,both '2006' and '106' are right. >

Re: STDOUT and STDERR to same file

2006-08-29 Thread Jeff Pang
Hello, In your daemon script,you can re-direct the STDIN/STDOUT/STDERR to the null device like '/dev/null'. open (STDIN, "/dev/null"); open (STDERR,">&STDOUT"); Then you can redefine the 'warn' and 'die' handler to the subroutines written by yourself.In these subroutines,you log all ev

Re: Time::Local let me faint

2006-08-29 Thread Jeff Pang
> >So if you want to translate 31 August 2006 you have to subtract one from the >month and 1900 from the year: > >$ perl -Mstrict -MTime::Local -le 'print timelocal(0,0,0,31,7,106)' >1157007600 John, For the instance described by you,both '2006' and '106' are right. $ perl -Mstrict -MTime::Loca

Fwd: WAP development from perl

2006-08-29 Thread luke devon
i need your help , could you please reply on this mail ?Note: forwarded message attached. Send instant messages to your online friends http://uk.messenger.yahoo.com --- Begin Message --- Hi , as a beginner , if i asked , how can i develop WAP sites by based on perl language ? , do u have any possib

Re: splitting strings

2006-08-29 Thread Dr.Ruud
"Mumia W." schreef: > Dr.Ruud: >> Mumia W.: >>> my @bar2 = grep length, split (/([a-z]{5})/, $foo); >>> >>> Any substrings with a length of zero will be removed by "grep >>> length." >> >> Huh? Why not just remove the capturing "()"? > > Without the capturing parentheses, split will remove every >

Re: Switch, Ranges and Memory

2006-08-29 Thread John W. Krahn
Barron Snyder (CE CEN) wrote: > When using the range operator, is the list actually created with all the > elements? It depends. :-) In general, yes it does. See the "Range Operators" section of perlop: perldoc perlop > For example, if I create a list like (123..456754), does it take up the

Re: Can't create 2d array in Perl

2006-08-29 Thread Jeff Pang
> >while() >{ > >push @arr , split /\t/ ; > >} > > Hello, Here you don't create a 2d array.Maybe you want this: while() { push @arry,[split/\t/]; } Then each element of @arry is a anonymous array.You can access the anonymous array's elements as: print $arry[0]->[0]; Hope this helps. --

Re: Can't create 2d array in Perl

2006-08-29 Thread Mumia W.
On 08/29/2006 07:01 PM, Gregg Allen wrote: Hi: I would like to read a tab delimited text file created in Excel into a 2d array. I don't understand why the following doesn't work. The $i and $j, along with the print statement, are only for debugging purposes. It prints: Can't use string

Re: splitting strings

2006-08-29 Thread Mumia W.
On 08/29/2006 05:02 PM, Dr.Ruud wrote: "Mumia W." schreef: Hien Le: [...] # Method 2 print( "\nMethod 2\n" ); my @bar2 = split( /([a-z]{5})/, $foo );# Captures white-spaces ?!? [...] The comments made by Dr. Ruud and John W. Krahn are correct. Split is returning the empty strings between

Re: Print to new file for each results

2006-08-29 Thread Mumia W.
On 08/29/2006 06:32 PM, Ron McKeever wrote: I am try to use part of someones elses code that creats the data file which prints out like this: ip|result|deptA|data ip|result|deptB|data ip|result|deptC|data My goal instead of having all the data in one big file is to loop this and create a file

Re: Switch, Ranges and Memory

2006-08-29 Thread Tom Phoenix
On 8/29/06, Barron Snyder (CE CEN) <[EMAIL PROTECTED]> wrote: For example, if I create a list like (123..456754), does it take up the same amount of memory as if I actually entered all those in between numbers? Generally, yes. I'm asking because I want to use ranges in a switch statement and

Can't create 2d array in Perl

2006-08-29 Thread Gregg Allen
Hi: I would like to read a tab delimited text file created in Excel into a 2d array. I don't understand why the following doesn't work. The $i and $j, along with the print statement, are only for debugging purposes. It prints: Can't use string ("") as an ARRAY ref while "strict refs"

Re: called too early?

2006-08-29 Thread John W. Krahn
Bryan Harris wrote: > > I'm getting this warning in a simple script I'm writing: > > ** > main::overlap() called too early to check prototype at > /Users/bh/Library/perl/popdef line 272. > ** > > The subroutine "overlap" is

Switch, Ranges and Memory

2006-08-29 Thread Barron Snyder \(CE CEN\)
When using the range operator, is the list actually created with all the elements? For example, if I create a list like (123..456754), does it take up the same amount of memory as if I actually entered all those in between numbers? I'm asking because I want to use ranges in a switch statement

Re: called too early?

2006-08-29 Thread Owen Cook
On Tue, 29 Aug 2006, Bryan Harris wrote: > > > I'm getting this warning in a simple script I'm writing: > > ** > main::overlap() called too early to check prototype at > /Users/bh/Library/perl/popdef line 272. > ** > > Th

called too early?

2006-08-29 Thread Bryan Harris
I'm getting this warning in a simple script I'm writing: ** main::overlap() called too early to check prototype at /Users/bh/Library/perl/popdef line 272. ** The subroutine "overlap" is at the bottom of the script, but so a

Re: splitting strings

2006-08-29 Thread Dr.Ruud
"Mumia W." schreef: > Hien Le: >> [...] >> # Method 2 >> print( "\nMethod 2\n" ); >> my @bar2 = split( /([a-z]{5})/, $foo );# Captures white-spaces >> ?!? [...] > > The comments made by Dr. Ruud and John W. Krahn are correct. > Split is returning the empty strings between delimiter > segments

RE: Reading Excel spreadsheet into variables

2006-08-29 Thread Timothy Johnson
One more thing: If you're not already doing so, you should probably start putting use strict; use warnings; at the top of your scripts. It will be a pain in the short term but will help you out later on. -Original Message- From: Stephan Gross [mailto:[EMAIL PROTECTED] Sent: M

Re: Totally lost - need a starting point

2006-08-29 Thread Tom Phoenix
On 8/29/06, Helen <[EMAIL PROTECTED]> wrote: Is the problem that your program still has syntax errors? print "Content-type: text/exp\n\n; When you run your program from the command line with the -c (check syntax) option, you can catch errors like missing quote marks without actually running t

Re: splitting strings

2006-08-29 Thread Mumia W.
On 08/29/2006 06:52 AM, Hien Le wrote: [...] # Method 2 print( "\nMethod 2\n" ); my @bar2 = split( /([a-z]{5})/, $foo );# Captures white-spaces ?!? [...] The comments made by Dr. Ruud and John W. Krahn are correct. Split is returning the empty strings between delimiter segments in the ori

Re: help with awk command in perl

2006-08-29 Thread Mumia W.
On 08/29/2006 10:40 AM, Sayed, Irfan (Irfan) wrote: Hi All, I have a following script in perl in which i am using awk command but it is not getting executed properly. # /usr/atria/bin/Perl -w use strict; use warnings; my $fname = "/tmp/checkvob_log"; open(FILE,">>$fname"); Check

Re: hash lookup table

2006-08-29 Thread Mumia W.
On 08/29/2006 01:46 PM, Derek B. Smith wrote: [...] If I change $number to $word is obviously does the copy correctly, but what is the point of my $number = $subdir_for{$word}; ??? Forget it. Do what works. :-) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail

Re: Cgi with GD grap, and displaying graphs

2006-08-29 Thread Mumia W.
On 08/29/2006 11:05 AM, Patrick Rice wrote: Hi all I'd like some advice, set up; Red hat Enterprise 4 Perl 5.8 I am trying to create a web page, which takes data from a file and builds a graph with GD, these are then saved as pictures, I then use the cgi script to call the pics using dynamic

Re: Cgi with GD grap, and displaying graphs

2006-08-29 Thread Tom Phoenix
On 8/29/06, Patrick Rice <[EMAIL PROTECTED]> wrote: When I do this, I get a 500 internal error and I've traced this down to a permissions problem, as the apache user doesn't have the permissions to write the pic's in the /var/www/html file. Which is as it should be, I would imagine. For secu

Re: STDOUT and STDERR to same file

2006-08-29 Thread Muttley Meen
On 8/29/06, Ken Foskey <[EMAIL PROTECTED]> wrote: I have a daemon process that works but I am currently running it with script.pl > error.log 2>&1 and I want to do the same thing without using the redirection,, remove the human error when starting the program. I can `open( STDERR, '>', 'error

Totally lost - need a starting point

2006-08-29 Thread Helen
I am trying to use an html script that will select an expect script, run it and display the output as text back into the html page. I get a very brief box showing up, it is so fast I am not sure what is in it. The expect script is very slow to execute so it will require time. The error_log shows "

Re: STDOUT and STDERR to same file

2006-08-29 Thread Mumia W.
On 08/29/2006 09:06 AM, Ken Foskey wrote: I have a daemon process that works but I am currently running it with script.pl > error.log 2>&1 and I want to do the same thing without using the redirection,, remove the human error when starting the program. I can `open( STDERR, '>', 'error.log') .

Re: hash lookup table

2006-08-29 Thread Derek B. Smith
> > # This might come closer to what you want. > > foreach my $log (@NBlogs2) { >if ($log =~ m{([[:alpha:]]+)/log.\d+}) { > my $word = $1; > my $number = $subdir_for{$word}; > qx(echo cp $log $oldir/$number); >} > }

Re: loop throw perl regexp selection

2006-08-29 Thread D. Bolliger
Meir Yanovich am Dienstag, 29. August 2006 11:41: > e > > hello all Hello Meir Yanovich > i have string that i need to parse something list that : > method="post"<$if(blah)%> name="<% env.get("StatusList") %>" ><% hello > %>" value=""> > > now im selecting the the string part with lazy regexp s

Re: question about CGI module

2006-08-29 Thread Tom Phoenix
On 8/29/06, chen li <[EMAIL PROTECTED]> wrote: What are the differences between these two code lines: use CGI; and use CGI qw/:standard/; When you 'use CGI', you get the default exports (nothing, I believe). When you 'use CGI qw/:standard/', you get the ':standard' exports, which are listed

Re: help with awk command in perl

2006-08-29 Thread John W. Krahn
John W. Krahn wrote: > Sayed, Irfan (Irfan) wrote: >>Hi All, > > Hello, > >>I have a following script in perl in which i am using awk command but it >>is not getting executed properly. >> >> >># /usr/atria/bin/Perl -w >> >>use strict; >>use warnings; >> >>my $fname = "/tmp/checkvob_log"; >>o

Re: STDOUT and STDERR to same file

2006-08-29 Thread Tom Phoenix
On 8/29/06, Ken Foskey <[EMAIL PROTECTED]> wrote: I can `open( STDERR, '>', 'error.log') ...` but is there a piece of magic to duplicate that to STDOUT as well (ie same file output) open(STDERR, '>', 'error.log') or die "Can't redirect stderr: $!"; open(STDOUT, ">&STDERR") or die "Can't

Re: Time::Local let me faint

2006-08-29 Thread John W. Krahn
Practical Perl wrote: > Hello,lists, Hello, > Please see these two lines' output: > > [$ perl -Mstrict -MTime::Local -le 'print timelocal(0,0,0,31,8,2006)' > Day '31' out of range 1..30 at -e line 1 > > $ perl -Mstrict -MTime::Local -le 'print timelocal(0,0,0,31,7,2006)' > 1156953600 > > > I

Re: Time::Local let me faint

2006-08-29 Thread Flemming Greve Skovengaard
Practical Perl wrote: Hello,lists, Please see these two lines' output: [$ perl -Mstrict -MTime::Local -le 'print timelocal(0,0,0,31,8,2006)' Day '31' out of range 1..30 at -e line 1 $ perl -Mstrict -MTime::Local -le 'print timelocal(0,0,0,31,7,2006)' 1156953600 I translate the time of '2006-

Re: Time::Local let me faint

2006-08-29 Thread Practical Perl
Thank you,:-) For the intuition I treated '8' as August in Time::Local's method...A low-level mistake. 2006/8/30, Lawrence Statton XE1/N1GAK <[EMAIL PROTECTED]>: Because SEPTEMBER only has thirty days. 0 - January; 1 - February; 2 - March; ... --L -- To unsubscribe, e-mail: [EMAIL PROTEC

Re: Time::Local let me faint

2006-08-29 Thread Adriano Ferreira
On 8/29/06, Practical Perl <[EMAIL PROTECTED]> wrote: But when I translate the time of '2006-8-31 00:00:00' to unix timestamp,it said '31 out of range'. I'm so faint that August doesn't have 31th day?Please tell me why this happen and how to resolve it. from "perldoc Time::Local" It is w

Re: Time::Local let me faint

2006-08-29 Thread Lawrence Statton XE1/N1GAK
Because SEPTEMBER only has thirty days. 0 - January; 1 - February; 2 - March; ... --L -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: help with awk command in perl

2006-08-29 Thread John W. Krahn
Sayed, Irfan (Irfan) wrote: > Hi All, Hello, > I have a following script in perl in which i am using awk command but it > is not getting executed properly. > > > # /usr/atria/bin/Perl -w > > use strict; > use warnings; > > my $fname = "/tmp/checkvob_log"; > open(FILE,">>$fname"); > >

Time::Local let me faint

2006-08-29 Thread Practical Perl
Hello,lists, Please see these two lines' output: [$ perl -Mstrict -MTime::Local -le 'print timelocal(0,0,0,31,8,2006)' Day '31' out of range 1..30 at -e line 1 $ perl -Mstrict -MTime::Local -le 'print timelocal(0,0,0,31,7,2006)' 1156953600 I translate the time of '2006-7-31 00:00:00' to unix

Re: splitting strings

2006-08-29 Thread John W. Krahn
Hien Le wrote: > Hello, Hello, > Given the string 'abcdefghijklmnopq', I wish to add a line break every > 5 characters: > > abcde > fghij > klmno > pq $ perl -e' my $foo = q[abcdefghijklmnopq]; print "$foo\n"; $foo =~ s/(.{0,5})/$1\n/g; print $foo; ' abcdefghijklmnopq abcde fghij klmno pq >

Re: splitting strings

2006-08-29 Thread Dr.Ruud
Hien Le schreef: > my @bar2 = split( /([a-z]{5})/, $foo );# Captures white-spaces ?!? Because of the capturing (), split also returns the separators. See perldoc -f split. Suggestion: my @bar2 = split( /./, $foo ); -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-

Cgi with GD grap, and displaying graphs

2006-08-29 Thread Patrick Rice
Hi all I'd like some advice, set up; Red hat Enterprise 4 Perl 5.8 I am trying to create a web page, which takes data from a file and builds a graph with GD, these are then saved as pictures, I then use the cgi script to call the pics using dynamically generated HTML page, using a system cal

Re: help with awk command in perl

2006-08-29 Thread Hal Wigoda
you have to execute the awk statement on the operating system level with the system, that is: system ("$cmd1"); On Aug 29, 2006, at 10:40 AM, Sayed, Irfan ((Irfan)) wrote: Hi All, I have a following script in perl in which i am using awk command but it is not getting executed properly.

help with awk command in perl

2006-08-29 Thread Sayed, Irfan \(Irfan\)
Hi All, I have a following script in perl in which i am using awk command but it is not getting executed properly. # /usr/atria/bin/Perl -w use strict; use warnings; my $fname = "/tmp/checkvob_log"; open(FILE,">>$fname"); my $CT = "/usr/atria/bin/cleartool"; my @vob_list = `$CT lsvo

Re: split function help

2006-08-29 Thread Dr.Ruud
Ken Foskey schreef: > split( /\s+/, $vob_list ) There is a difference between that and split( ' ', $vob_list ) The latter skips whitespace at the start. perl -e ' $_ = qq{ abc def\tghi\njkl} ; @_ = split /\s+/ ; $" = qq{>\n<} ; print [EMAIL PROTECTED] ' [> \n<} ; print [EMAIL P

splitting strings

2006-08-29 Thread Hien Le
Hello, Given the string 'abcdefghijklmnopq', I wish to add a line break every 5 characters: abcde fghij klmno pq Method 1 below works, but my split() in method 2 captures 'something unexpected' at each match. Could someone please tell me what is split capturing that I am not seeing? Th

question about CGI module

2006-08-29 Thread chen li
Hi guys; What are the differences between these two code lines: use CGI; and use CGI qw/:standard/; Thanks, Li __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- To unsubscribe, e-mail

STDOUT and STDERR to same file

2006-08-29 Thread Ken Foskey
I have a daemon process that works but I am currently running it with script.pl > error.log 2>&1 and I want to do the same thing without using the redirection,, remove the human error when starting the program. I can `open( STDERR, '>', 'error.log') ...` but is there a piece of magic to duplica

Re: split function help

2006-08-29 Thread Mumia W.
On 08/29/2006 08:23 AM, Sayed, Irfan (Irfan) wrote: Hi All, I need to use the split function in perl script. * /vobs/apache_log4j /usr/add-on/puccase_vob01/ccvob01/apache_log4j.vbs public (replicated) Above line i need to split in following order * /vobs/apache_log4j /usr/add-on/puccase

Re: split function help

2006-08-29 Thread Dr.Ruud
"Sayed, Irfan (Irfan)" schreef: > my @vob_path = split(/ /, $vob_list); Maybe you need split(' ', $vob_list) See perldoc -f split. -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: split function help

2006-08-29 Thread Ken Foskey
On Tue, 2006-08-29 at 21:23 +0800, Sayed, Irfan (Irfan) wrote: > my @vob_path = split(/ /, $vob_list); where $vob_list contains the I am not crash hot on the split yet, but try split( /\s+/, $vob_list ) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTEC

split function help

2006-08-29 Thread Sayed, Irfan \(Irfan\)
Hi All, I need to use the split function in perl script. * /vobs/apache_log4j /usr/add-on/puccase_vob01/ccvob01/apache_log4j.vbs public (replicated) Above line i need to split in following order * /vobs/apache_log4j /usr/add-on/puccase_vob01/ccvob01/apache_log4j.vbs public (replicated)

Re: PDF::API2 and content index

2006-08-29 Thread Beginner
On 28 Aug 2006 at 9:37, Daniel Kasak wrote: > Hi all. Olla > Does anyone know if it's possible to create a content index with > PDF::API2, so people viewing the PDF can click in the index and go > straight to the corresponding page of the PDF document? If your referring to the thumbnails sideb

loop throw perl regexp selection

2006-08-29 Thread Meir Yanovich
e hello all i have string that i need to parse something list that : name="<% env.get("StatusList") %>" ><% hello %>" value=""> now im selecting the the string part with lazy regexp selection : some thing like that : (<%.*?%>) but now im stack if say i like to loop throw all the matchin

RE: Image split....

2006-08-29 Thread Nagasamudram, Prasanna Kumar
-Original Message- From: Gretar Mar Hreggvidsson [mailto:[EMAIL PROTECTED] Sent: Monday, August 28, 2006 6:41 PM To: Nagasamudram, Prasanna Kumar Cc: beginners@perl.org Subject: Re: Image split > > But If I change the following line > > $img->read(file=>'p.bmp', type=>'bmp') or di

Re: Reading Excel spreadsheet into variables

2006-08-29 Thread Emil Perhinschi
I don't know about Win32::OLE, but you could use Data::Dumper to print $everything to STDERR and see how it looks inside. print STDERR Dumper $everything; On Mon, 28 Aug 2006 18:43:35 -0400 [EMAIL PROTECTED] ("Stephan Gross") wrote: > I'm reading in an Excel spreadsheet using Win32::OLE. I