Re: Octal code for ^L

2008-09-11 Thread Moon, John
Please start a new thread when needed in this list. You have replied to a thread titled HTML::TreeBuilder help which was in turn a reply to Can not mix output of STDERR and STDOUT and those of us who have a threading email client, or can see the NNTP feed, see those topics as nested and

RE: Octal code for ^L

2008-09-08 Thread Moon, John
Moon, John wrote: Does anyone know the octal code for what vi is showing as ^L? I tried \n\r \r\n but that does not seem to be the same... I am on a UNIX box... I need the octal code to add to the beginning of first record written from my perl script... I'm using write and format and need

Octal code for ^L

2008-09-05 Thread Moon, John
Does anyone know the octal code for what vi is showing as ^L? I tried \n\r \r\n but that does not seem to be the same... I am on a UNIX box... I need the octal code to add to the beginning of first record written from my perl script... I'm using write and format and need ALL headers to be

format problem

2008-08-28 Thread Moon, John
Does anyone see the problem with the following format? Thank you in advance for any help... John W Moon 127 128 format ADJRPT = 129 @... @ @| @ @... @... @ 130 $account_num, $adj_id, $adj_type, $adj_period, $requested_by_name, $product_title, IFormat_num($adj_qty,6) 131

RE: use constant as hash key

2008-08-25 Thread Moon, John
How can I use a constant as a hash key? $ perl -e 'use constant CAT=A; $hash{CAT} = q{Bobby}; $hash{CAT} = q{Muffy}; $hash{'CAT'} = q{Fluffy}; $hash{qq{CAT}} = q{Tuffy}; print $_ = $hash{$_}\n foreach (keys %hash);' CAT = Tuffy $ Want... A=Bobby See the Not-so-symbolic references

use constant as hash key

2008-08-22 Thread Moon, John
How can I use a constant as a hash key? $ perl -e 'use constant CAT=A; $hash{CAT} = q{Bobby}; $hash{CAT} = q{Muffy}; $hash{'CAT'} = q{Fluffy}; $hash{qq{CAT}} = q{Tuffy}; print $_ = $hash{$_}\n foreach (keys %hash);' CAT = Tuffy $ Want... A=Bobby John W Moon -- To unsubscribe, e-mail:

Sum not producing zero

2008-03-12 Thread Moon, John
Below is a small script and results... Can someone example what I am doing wrong - the sum should produce zero but does not. #!/usr/local/bin/perl use vars qw($this_account_total $this_customer_total $this_run_total); while (main::DATA) { chomp; my ($amt_gj, $amt_adj) =

RE: Sum not producing zero

2008-03-12 Thread Moon, John
:[EMAIL PROTECTED] Sent: Wednesday, March 12, 2008 9:05 AM To: Perl Beginners Subject: Re: Sum not producing zero Moon, John wrote: Below is a small script and results... Can someone example what I am doing wrong - the sum should produce zero but does not. http://perlmonks.org/?node_id=665673

RE: insert and query a db

2008-01-07 Thread Moon, John
[] ... Please try (not tested). Placeholders help me a lot: my $sth_insert = $dbh-prepare('Insert into info (id, name, grade, phone, cell, house, car) values (?,?,?,?,?,?,?)') or die DBI-errstr; while (DATA){ #---#

RE: How to add commas to a number?

2007-11-28 Thread Moon, John
Subject: How to add commas to a number? Hi! I am trying to get this to work, but I am not having any luck? use strict; use warnings; sub commify { local($_) = shift; 1 while s/^(-?\d+)(\d{3})/$1,$2/; return $_; } If I input these numbers: 6238.12 121150.98 104903.30 113569.26

RE: adding data to a file before it gets regexed

2007-09-13 Thread Moon, John
From: Pat Rice [mailto:[EMAIL PROTECTED] Sent: Thursday, September 13, 2007 11:14 AM To: Andrew Curry Cc: Chas Owens; beginners@perl.org; [EMAIL PROTECTED] Subject: Re: adding data to a file before it gets regexed thanks all for the replies, I'm trying to parse log files. so I got a bunch of

RE: adding data to a file before it gets regexed

2007-09-13 Thread Moon, John
-Original Message- From: John W. Krahn [mailto:[EMAIL PROTECTED] Sent: Thursday, September 13, 2007 12:42 PM To: Perl beginners Subject: Re: adding data to a file before it gets regexed Moon, John wrote: thanks all for the replies, I'm trying to parse log files. so I got a bunch

RE: adding data to a file before it gets regexed

2007-09-13 Thread Moon, John
From: John W. Krahn [mailto:[EMAIL PROTECTED] Sent: Thursday, September 13, 2007 2:01 PM To: Perl beginners Subject: Re: adding data to a file before it gets regexed Moon, John wrote: From: John W. Krahn [mailto:[EMAIL PROTECTED] Here is another way to do it: my $logs_total = () = *log

POD question

2007-09-11 Thread Moon, John
I'm trying to single space lines in a POD but without success... Removing the blank lines yields one line of text. Any help will be appreciated. =item d. The file looks like:$ $ =back$ $ =back$ $ =pod$ $ 200708_200709101429$ $ 10-09-07 14:29$ $ L1$ $ =cut$ gives d. The file looks like:

RE: POD question

2007-09-11 Thread Moon, John
Thank you... -Original Message- From: Chas Owens [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 11, 2007 1:53 PM To: Moon, John Cc: beginners@perl.org Subject: Re: POD question On 9/11/07, Moon, John [EMAIL PROTECTED] wrote: I'm trying to single space lines in a POD but without

RE: spliting

2007-09-04 Thread Moon, John
-Original Message- From: Pedro Soto [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 04, 2007 8:50 AM To: Andrew Curry Cc: beginners@perl.org Subject: Re: spliting Well, Sorry if I was not clear enough. I want to read lines from a file and I need to split the line into characters. I

Question about map

2007-08-10 Thread Moon, John
Does anyone see anything wrong with the following: -labels= {map ({$$_[0]=$$[1]0?$$_[0] *:$$_[0] _} @$servers)}, I can not get the map to return the _true_ value... $$_[1] is either 1 or 0... The following works... -labels= {map ({$$_[0]=imap($$_[0],$$_[1])} @$servers)}, sub imap{ my

RE: Dynamically assign the no.

2007-08-09 Thread Moon, John
-Original Message- From: Sayed, Irfan (Irfan) [mailto:[EMAIL PROTECTED] Sent: Thursday, August 09, 2007 9:52 AM To: beginners@perl.org Subject: Dynamically assign the no. Hi All, I am running one system command in my perl script. The output of this command is different every time.

RE: variable in cgi param

2007-07-23 Thread Moon, John
-Original Message- From: ubergoonz [mailto:[EMAIL PROTECTED] Sent: Monday, July 23, 2007 10:06 AM To: Perl Beginners Subject: variable in cgi param Hi, I am trying to parse a param in cgi script. basically how can i make use of a for loop to parse the variables, from the url

RE: Search and Replace

2007-07-11 Thread Moon, John
From: Joseph L. Casale [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 11, 2007 1:51 PM To: beginners@perl.org Subject: Search and Replace Hi, Know that I am learning perl, I am expected to use it at work :) Problem is I am still to green for the current problem I have. The data is always left

RE: Regarding pattern matching

2007-05-17 Thread Moon, John
Subject: Regarding pattern matching Hi All, I am trying to extract few strings from a text file. The pattern of the text stored in the file is as follows: #define MNSS_FACILITY_IND_ID (TF_MNSS_MESSAGE_CATEGORY + 0x01) /* @LOG MNSS_MESSAGE_T */ I need to extract MNSS_FACILITY_IND_ID,

Modeling for Tk

2007-05-07 Thread Moon, John
Does any one have suggestions how to model - give the end user - views of the windows and navigation of a Perl Tk application? John W Moon -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Help downloading a file

2007-05-01 Thread Moon, John
Below is code I presently use to download to clients and the generated html. One client objects to the generated html - the Content-Disposition ... Does any one have another method to download AND display the pdf with perl. sub Display_PDF { my ($pdf, $pdf_size) = @_; $|=0; print

RE: Using regular expressions with delimitaters

2007-04-11 Thread Moon, John
From: Rodrigo Tavares [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 11, 2007 9:31 AM To: beginners@perl.org Subject: Using regular expressions with delimitaters Hello, I need to use the delimiter , (one blank space). I read perdoc, i try to use this : if ( 8.1.8 =~ /[\d $versao \s]/)

Installing modules locally, how to

2007-02-20 Thread Moon, John
Looking for help installing modules to a local library... http://search.cpan.org/~jhi/perl-5.8.0/pod/perlmodinstall.pod says to do the install one way while README for the module gives other instructions. CPAN says a) Decompress, b) Unpack, c) Build, and d) Install. The Build step is different

RE: Re: Installing modules locally, how to

2007-02-20 Thread Moon, John
-Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Lin Sent: Tuesday, February 20, 2007 1:09 PM To: beginners@perl.org Subject: Re: Installing modules locally, how to Hi John, SUN83-PRODWEBperl Makefile.PL SUN83-PRODWEB/usr/ccs/bin/make You have to be root (or user

RE: Installing modules locally, how to

2007-02-20 Thread Moon, John
Thank you, Mumia W. The following ran... I would have preferred to have installed at ~/cgi-bin/Library _not_ at ~/cgi-bin/Library/lib/perl5/site_perl/5.8.5... following is the results. Now when I try to install Ajax it still says it can't find Class::Accessor I tried perl -I ~/cgi-bin/Library

RE: Opening multiple files for parsing

2007-02-07 Thread Moon, John
-Original Message- From: Tom Smith [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 07, 2007 5:09 PM To: beginners@perl.org Subject: Opening multiple files for parsing I'm writing a Perl script to parse 31 maillog files. The files are named maillog, maillog.1, and so on up to 31.

RE: Printing in preprinted invoice

2007-02-01 Thread Moon, John
-Original Message- From: Patricio A. Bruna [mailto:[EMAIL PROTECTED] Sent: Thursday, February 01, 2007 7:30 AM To: beginners@perl.org Subject: Printing in preprinted invoice Hi, Anyone knows a easier method, that guest and try, to print an invoice in a prepinted paper, i need to fill

RE: Line ending with Gary^M on UNIX

2006-12-08 Thread Moon, John
Thank you to all... jwm -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response

Line ending with Gary^M on UNIX

2006-12-07 Thread Moon, John
Can someone please give me the octal values or a method of removing ^M from the end of an input line, if present? Thank you in advance jwm -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response

RE: Help w/map function

2006-10-12 Thread Moon, John
Hi John Here's your code again, laid out a little more visibly: use strict; use warnings; my @a; @a = qw/frc.apmt frc_ff.apmt/; print join(q{,}, map(subt($_), @a)), \n\n; @a = qw/frc.apmt frc_ff.apmt/; print join(q{,}, map(s/^(.*)\..*/$1/, @a)), \n\n; @a = qw/frc.apmt frc_ff.apmt/; print

RE: Subroutine returning 2 arrays

2006-10-12 Thread Moon, John
-Original Message- From: Gallagher, Tim F (NE) [mailto:[EMAIL PROTECTED] Sent: Thursday, October 12, 2006 11:55 AM To: Perl Beginners Subject: Subroutine returning 2 arrays From a subroutine I would like to return 2 separate arrays like this sub TEST { @a = (a1,a2,a3,a4,a5,a6,a7); @b

Help w/map function

2006-10-11 Thread Moon, John
perl -e '@a=(frc.apmt,frc_ff.apmt);print join(q{,}, map(subt($_), @a)), \n; sub subt {my ($a) = @_; $a=~s/^(.*)\..*/$1/; print a=$a\n; return $a;}' perl -e '@a=(frc.apmt,frc_ff.apmt);print join(q{,}, map(s/^(.*)\..*/$1/, @a)), \n; ' perl -e '@a=(frc.apmt,frc_ff.apmt);print join(q{,},

RE: Help w/map function

2006-10-11 Thread Moon, John
On 10/11/06, Moon, John [EMAIL PROTECTED] wrote: perl -e '@a=(frc.apmt,frc_ff.apmt);print join(q{,}, map(subt($_), @a)), \n; sub subt {my ($a) = @_; $a=~s/^(.*)\..*/$1/; print a=$a\n; return $a;}' perl -e '@a=(frc.apmt,frc_ff.apmt);print join(q{,}, map(s/^(.*)\..*/$1/, @a)), \n

RE: Trouble with variable scoping

2006-08-31 Thread Moon, John
When I run this, I get an error Can't localize lexical variable. I understand that it's because the variable is declared using my; what I don't understand is why, or what I should declare the variable as, since if I leave out my I get an error using use strict. Maybe you want.. Use vars

RE: replace multiple tokens

2006-08-30 Thread Moon, John
Thank you Robin John for the help Jwm... -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response

replace multiple tokens

2006-08-25 Thread Moon, John
I have the follows code perl -e ' @a=(q{a...x name=taga_1 #...d name=tagb_1 f...r name=tagc_1 xxnn}, q{h...e name=taga_4 t...g name=tagb_4 k name=tagc_4 nn}); $ndx = 0; foreach $ln (@a) { print b4 = $ln\n; $ln =~s/(name=.*)\d+/\1$ndx/g; print af = $ln\n; $ndx++

RE: passing a list as a variable

2006-07-24 Thread Moon, John
-Original Message- From: Ryan Moszynski [mailto:[EMAIL PROTECTED] Sent: Monday, July 24, 2006 12:41 PM To: beginners@perl.org Subject: passing a list as a variable Is there a way to make my commented 'foreach line act the same as the line above it? Can I pass a list as a variable as I

RE: Can't use string (3862926) as a HASH ref while strict refs

2006-06-25 Thread Moon, John
From: Muma W. [mailto:[EMAIL PROTECTED] Sent: Friday, June 23, 2006 4:11 PM To: Beginners List Subject: Re: Can't use string (3862926) as a HASH ref while strict refs Moon, John wrote: [...] 150 $totals{$fund}{$service}{$acct}{AMT} += $amt; 151 $totals{$fund}{$service}{$acct

Can't use string (3862926) as a HASH ref while strict refs

2006-06-23 Thread Moon, John
I guess I'm not understanding what I'm doing (or have been reading in my web searches)... Can someone explain the difference between these two code snippets... SUN83-PRODWEBmore foo #! /usr/local/bin/perl use strict; my %t; my ($a, $c); my ($aa, $cc);

RE: I/O Question

2006-06-15 Thread Moon, John
-Original Message- From: Doug Adams [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 14, 2006 10:59 AM To: beginners@perl.org Subject: I/O Question I'm a first time perl user, jumping right into cgi on a mac, and I can't for the life of me figure out how to specify file paths other than

RE: Can any one tell me a better way to upload a file from the HTML form to a location in my home directorrt.

2006-04-07 Thread Moon, John
John W Moon Systems Project Analyst Enterprise Information Technology Services (EITS) Department of Management Services 4030 Esplanade Way, Suite 260G Tallahassee, Fl 32399-0950 Office: (850)922-7511 Email: [EMAIL PROTECTED] Please note: Florida has a very broad public records law. Most written

RE: Problem with regular expression

2005-12-14 Thread Moon, John
-Original Message- From: Andrej Kastrin [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 14, 2005 2:55 AM To: beginners@perl.org Subject: Problem with regular expression Hi all I have a list of terms and I have to find out, if any one of them occur in my text. Example: term is

RE: Skip then print

2005-12-05 Thread Moon, John
From: Ron McKeever [mailto:[EMAIL PROTECTED] Sent: Monday, December 05, 2005 11:50 AM To: beginners@perl.org Subject: Skip then print Hello, I would like to skip the first ten lines of output from tail, then print any new records matching my array, but I seem to be stuck, below will run but

Substitution problem

2005-09-06 Thread Moon, John
Does any one know how to do this with just a substitution? perl -e '$a=q{Data.m1234.D1234567890}; $a =~/\d+$/; $numbers = q{#} x length($); $a=~ s/\d+$/$numbers/; print $a\n;' What Data.m1234.D## as a result. John W Moon -- To unsubscribe, e-mail: [EMAIL

RE: splitting data stream

2005-08-18 Thread Moon, John
From: Octavian Rasnita [mailto:[EMAIL PROTECTED] Sent: Thursday, August 18, 2005 8:04 AM To: beginners perl Subject: splitting data stream Hi, I want to use regular expressions (or other techniques) to split a data stream which has the following format:

RE: $#{$array}

2005-07-29 Thread Moon, John
Subject: $#{$array} Hi, I don't not understand how the $#{$array_r} returns highest element as 4 and not 5??? #!/usr/bin/perl use warnings; use strict; my @array = (1,2,3,4,5); my $array_r = [EMAIL PROTECTED]; print the highest element is number $#{$array_r}\n; FYI ... SUN1-BATCHperl -e

RE: cool tricks for inserting element into array?

2005-07-20 Thread Moon, John
Subject: cool tricks for inserting element into array? I'd like to turn array @tmp from: (1,2,3) to (1,|,2,|,3) I'm using: @tmp = split(' ', join( | , @tmp)); ... but it seems like a waste to create a string and then split it back up again. As a sidenote, are questions like this

RE: cool tricks for inserting element into array?

2005-07-20 Thread Moon, John
Subject: RE: cool tricks for inserting element into array? Subject: cool tricks for inserting element into array? I'd like to turn array @tmp from: (1,2,3) to (1,|,2,|,3) I'm using: @tmp = split(' ', join( | , @tmp)); ... but it seems like a waste to create a string and then

RE: escaping @

2005-07-18 Thread Moon, John
Subject: escaping @ I'm sure this is very simple and I am overlooking something. I want to read a list of bad email addresses from a file and remove them from my database. If I print $_, the email addresses are correct, if I try to remove them from the db I get errors on just the characters

RE: array

2005-07-16 Thread Moon, John
Subject: array Hi: I want to write a code storing in memory a list of numerical values and then asking the user to guess a number, if that number matches one in memory, program should exit; otherwise keep asking... ** #!/usr/bin/perl use warnings; use strict; my

RE: $_ and split function...

2005-07-16 Thread Moon, John
To: beginners@perl.org Subject: $_ and split function... Hi In the following code #!/usr/bin/perl use warnings; use strict; my $found = 0; $_ = Nobody wants to hurt you... 'cept, I do hurt people sometimes, Case.; my $sought =

RE: question related to readdir function

2005-07-15 Thread Moon, John
Subject: question related to readdir function Dear all. I wrote a piece of code to read and open all files from a directory to do something with it. But I found that the variable assigned to @file_array split the file names into pieces. For example . . test.rpt file will be separated into

RE: [Fwd: fetchrow_arrayref()]

2005-07-13 Thread Moon, John
Subject:fetchrow_arrayref() Date: Wed, 13 Jul 2005 11:08:00 +0100 From: David Foley [EMAIL PROTECTED] To: beginners@perl.org Hi Guys, I need help with this. Please find below some code: #!/usr/bin/perl -w # Reduce scripting errors + call DBI module use strict; use

RE: Query about ssh from perl program

2005-07-08 Thread Moon, John
Subject: Query about ssh from perl program Hello All, I have a query about using ssh programmatically. I tried using both system and exec, but didn't work. I mean, I wanted some processing to happen on the remote machine to which i connect with ssh, which is not happening. I have copied the

regex problem

2005-07-01 Thread Moon, John
The following is not returning what I had expected... SUN1-BATCHperl -e '$a=q{/var/run}; $home=q{/var/123};print Yes - $a like $home\n if $a =~ /^$home/;' SUN1-BATCHperl -e '$a=q{/var/run}; $home=q{/var/ra};print Yes - $a like $home\n if $a =~ /^$home/;' SUN1-BATCHperl -e '$a=q{/var/run};

RE: change char, keep case

2005-06-18 Thread Moon, John
Sent: Saturday, June 18, 2005 12:58 PM To: beginners@perl.org Subject: change char, keep case Hi all, quite interesting, how you would write this without $temp: use strict; use warnings; my $first = 'B'; my $second = 'a'; ($first, $second) = ($second , $first); print $first, \n; print

RE: :Oracle problems

2005-05-31 Thread Moon, John
Subject: DBD::Oracle problems All, I am getting the following error while trying to use DBD::Oracle: DBD::Oracle::st execute failed: ORA-00900: invalid SQL statement (DBD ERROR: OCIStmtExecute) [for Statement describe ALL_USERS] at ./oracleTest.pl line 69. I have tested the connection

RE: :Oracle problems

2005-05-31 Thread Moon, John
Subject: RE: :Oracle problems Subject: DBD::Oracle problems All, I am getting the following error while trying to use DBD::Oracle: DBD::Oracle::st execute failed: ORA-00900: invalid SQL statement (DBD ERROR: OCIStmtExecute) [for Statement describe ALL_USERS] at ./oracleTest.pl line 69.

RE: search a file

2005-05-26 Thread Moon, John
Subject: search a file Hello, I'm writing a simple perl program. no CGI. * I need to make the program list all the files that have an extension of .v in the current directory. Do anyone know a function that makes that ?! Best Regards, Eliyah One way ... @a=glob('*.v'); print join(\n,@a), \n;

RE: search and replace confusion

2005-05-26 Thread Moon, John
Subject: search and replace confusion What I'm trying to do with the following code is convert some iCal files so that a specific application will read them. The problem is that this application can't deal with entries that have a date but no time. (Full examples below.) For example, if I have

RE: substituting variables in external file.

2005-05-11 Thread Moon, John
Subject: substituting variables in external file. I have a need to have 3 different templates of email text outside of my actual script, what I want to know is can I use variables in the templates then open the file for reading and substitute the variables in the text with some data saved in

RE: Help with substitution

2005-05-10 Thread Moon, John
To: 'Tham, Philip' Subject: RE: Help with substitution Subject: Help with substitution Hi I have a string which reoccuring patterns 1abc2abc3abc4abc567 How do I remove everything before the 1st occrence of abc to get the result 2abc3abc4abc567 s/^.*abc// Gives me 567 Thanks in advance.

RE: How to turn $_ into a hashref?

2005-05-05 Thread Moon, John
Subject: Re: How to turn $_ into a hashref? Philip, thank you very much. I overlooked the meaning of the second variable to selectrow_array entirely. Two follow up questions: 1. If I don't need or want DBI handle attributes (I'm happy with the defaults, for instance), how can I define a null

RE: transform array into hash

2005-05-05 Thread Moon, John
Subject: transform array into hash Hi all, just easy question, here is too much hours and my brain doesn't work any more. How to transform array into hash ? my @array = 1..4; I want to have: %hash = ( one = 1, two = 2, three = 3, four = 4 ); tried something like this, but it doesnt work: my

RE: capture a carriage return from STDIN

2005-04-20 Thread Moon, John
Subject: capture a carriage return from STDIN I have a script that pauses while the reader reads the intro text, and askes them to press return to continue. At the moment I capture the input from STDIN into a variable called $waste, do nothing with it, and continue anyway. The script

RE: 'format' puzzle

2005-04-14 Thread Moon, John
Subject: 'format' puzzle How can I create a perl 'format' string that begins with a comment (#)? Eg. format STDOUT_TOP = # Field1 Field2 @ @||| @||| . If I try '\#' then I see the backslash. I just want the pound char. TIA, -Sam I'm not sure where you want the # ... but

RE: Passing command line arguments

2005-04-13 Thread Moon, John
Subject: Passing command line arguments I have a script that is reading input from ARGV. The script is being passed a file name as follows: datefile.pl c:\program files\IBM\SQLLIB\DB2\db2diag.log The problem I am running into is that the space is not recognized in the argument. All that I

RE: How can I take subarray without second array (drop other elem ents)?

2005-04-07 Thread Moon, John
I have a function which prints array: sub print_array { my $array_ref = shift; for(@$array_ref){ print $_\n; } } And I have a big array, for example named @array. I want to print @array elements from N to N+100 using this function, but don't want to use second array (they are can be

RE: datetime comparisons

2005-04-05 Thread Moon, John
Subject: datetime comparisons hello all i am wondering a there is a module that do comparisons between two different datetime stamps for example 2/4/2005:15:20:20 and 4/4/2005:12:09:23 which date is bigger (namely earliest) You may wish to look at Time::Local. This will convert the strings

RE: Arguments in a program

2005-03-26 Thread Moon, John
-Original Message- From: Carlos Mantero [mailto:[EMAIL PROTECTED] Sent: Saturday, March 26, 2005 12:53 PM To: Beginners Perl Subject: Arguments in a program Hi folks! I'm really new with perl, but I practice making little programs or scripts. However, today I need a program that accepts

RE: How to read and delete mail from a cron job

2005-03-22 Thread Moon, John
Chris, Thank you for the suggestion but when I say process I mean that I need to read the reply, grep for user id and a confirmation number, update my database to say that the email I send was replied to as requested, and that the email address I was given was correct... I am registering

RE: how to mail ??

2005-03-22 Thread Moon, John
Subject: how to mail ?? #!/usr/bin/perl foreach (`df -h|grep /dev/hda11`) { split(); # our $total = $_[1]; # our $used = $_[2]; our $free = $_[3]; if ($free =~ /M/){ $free=~ s/M//; print $free.\n; if ($free = 10) {

RE: how to mail ??

2005-03-22 Thread Moon, John
Moon, John wrote: [snip] Here something that I do routinely... snip open MAILMAN, | rmail $To_Address; print MAILMAN Subject: Some subject\n; print MAILMAN From: $Reply_to\n\n; print MAILMAN some message.; close MAILMAN; /snip And routinely it is a bad idea...please don't

RE: platform independant log

2005-03-17 Thread Moon, John
Subject: platform independant log Hi : The following program needs to print the output of the cmd run to a log file, it takes care of the directory separator issue, so the log file could be created on any platform depending on where the program is run. But there is something missing ie the log

RE: Question on Arrays

2005-03-16 Thread Moon, John
@districts = qw/ elldev elldev2 icedev prodev /; $app = M:\\Path\\app.exe ; foreach $dist ( @districts ) { print $app, $dist,\n; # modifying this to a system call like system( $app, $dist ); } I am going to change the print statement above with a system one so that $app will run with the

RE: build perl modules

2005-03-16 Thread Moon, John
Hi, Can anybody let me know how to create our own modules in perl. Thanks in advance... Mahantesh V H The simple answer is: Create a file for the sub and save as a .pm... To include it in you main program... use lib where/you/saved/the/sub; use sub_you_saved; sub_use_saved; That should

How to read and delete mail from a cron job

2005-03-15 Thread Moon, John
Can someone please give me some suggestions (or pointers) as to how to read and delete emails from a cron job. I will be receiving conformation email and need to process it once then delete it - not process it again. Thank you in advance, John Moon -- To unsubscribe, e-mail: [EMAIL PROTECTED]

RE: How to read and delete mail from a cron job

2005-03-15 Thread Moon, John
] Sent: Tuesday, March 15, 2005 9:03 AM To: Moon, John Cc: Perl Beginners Subject: Re: How to read and delete mail from a cron job On Tue, 15 Mar 2005, Moon, John wrote: Can someone please give me some suggestions (or pointers) as to how to read and delete emails from a cron job. I

RE: Premature end of script headers

2005-02-08 Thread Moon, John
Subject: Premature end of script headers hello, I am getting following error. Premature end of script headers Can anybody plz tell me what is the cause of this. Have you tried to execute the script from the command line? That is sometimes helpful in finding the error... jwm -- To

RE: Reg parameters to a perl script

2005-02-08 Thread Moon, John
Subject: Reg parameters to a perl script Hi , I have a perl script which accepts few predefined parameters and values for them. It is like this : myscript.pl -param1 value1 -param2 value2 Now my requirement is , if value is also has and hyphen - then script should accept it and what

RE: Having trouble using strict

2005-02-08 Thread Moon, John
Subject: Having trouble using strict Hello there! I got a trouble (I think). I'd like to store some variables in a separated file ie vars.pl to have a possibility of using them in different scripts by 'require vars.pl'. So if I use some script using the variable $var1 = somevalue storing in

RE: Strange problem with cookie script

2005-02-07 Thread Moon, John
I am getting a strange problem with two cookie scripts I've written. The first, cookie_maker.cgi, creates two cookies containing a user id and a security key: #!/usr/bin/perl -w use strict; # creates cookies print Set-Cookie:user=cbfb\n; print Set-Cookie:secid=1234\n;

RE: Checking last character of string for punctuation

2005-02-02 Thread Moon, John
Subject: Checking last character of string for punctuation Howdy all. I'm a newbie with a newbie question. I assume that I'm in the right place. I need to update some code a developer programmed for my organization. The purpose of the code is really basic. It simply prints: $title. $subtitle.

RE: How to read this array?

2005-01-26 Thread Moon, John
Subject: How to read this array? I have this array and I am trying to figure out how to read $id in it. Any ideas? @history = ( { program = 'racer', version = '0.45', input = { '/home/' = undef, }, input_contents = ' $name= \'Jerry\'; $id =

RE: Dynamic pattern matching?

2005-01-18 Thread Moon, John
I've got a data file that for the most part, the entries look like: (The last 3 columns are data points...) LKG_535 P10X0.6 -2.00E-09 0.00E+00 amps -3.800E-13 -3.920E-12 -7.800E-13 VT_GM L0.8H40 -1.15E+00 -7.50E-01 volts-1.104E+00 -1.111E+00 -1.110E+00

RE: dynamically calling a subroutine

2005-01-18 Thread Moon, John
I have a program that generates a random number between 1 and 6. based on the outcome I want to run a subroutine that corresponds to the result. i.e if the result is 1 then the program should run sub F1. my question is how can I dynamically call the subroutine. i tried this but obviously it

RE: CGI.pm and form creation

2005-01-17 Thread Moon, John
I'm trying to create a little form usign CGI.pm but I get this error from apache: malformed header from script. Bad header=form method=post action=/c: /usr/lib/cgi-bin/make_graph_CPU_form.pl.cgi this is my perl code: #!/usr/bin/perl use CGI qw/:standard/; sub print_form { print

RE: complex data structure

2005-01-10 Thread Moon, John
Subject: complex data structure Hi pals, How can I add values to hash, when key is the same ? Example: my %ha = ( 'test1' = [ { 'test1_a' = 'a', 'test1_b' = 'b', }, {

RE: Converting a array to a scalar

2004-12-23 Thread Moon, John
Subject: Converting a array to a scalar Is there any good function to convert an array (this is the content of a file) to scalar (for email sending as the body) I am not sure I understand your questions but I have recently had success with the module Text-Template... You may wish to look at

RE: Cgi Modul

2004-12-21 Thread Moon, John
How can i call a function in cgi! i want to make a htmlsite which works with my main programm an gives the result out! if i use the functon name it does not work! wo can i involve a function into this cgi script? use CGI; my $cgi = new CGI; use CGI::Carp qw(fatalsToBrowser); my

RE: Cgi Modul

2004-12-21 Thread Moon, John
output 56711265 56706919 Content-Type: text/html !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN HTMLHEADTITLEDaten/TITLE /HEADBODYH2Query/H2H3ras/H3HR SIZE=1 NOSHADEH2 STYLE=color:blueAutor: Ihallo/I/H2/BODY/HTML The problem is i always write NOTin the

RE: Running a perl script thru a perl script

2004-12-21 Thread Moon, John
Subject: Running a perl script thru a perl script Hello, I have built a script that has 2 environment variables passed to it and it will take that data and return a value. This script works fine, but there are many possibilites that can be passed to it. I want to build a test case of sorts to

RE: Missing output on browser

2004-12-20 Thread Moon, John
I'm trying to execute a select query from a Perl script and display the results in IE. The script works fine from the command line, it displays the results of the query. However, when it runs from IE it only displays the word 'Start:'. Any ideas? Thanks in advance. -Paul Here's the script:

RE: Trouble with format

2004-12-14 Thread Moon, John
This is my code (something very simple): $variable = Ordenes\nServicios\nGarantias; format ORDENES = Text: ^* $variable ~~^* $variable . But I don't know how can I see or print the output of this, and send it bye email. I tried with write(),

RE: Why the if loop does not work??

2004-12-09 Thread Moon, John
I am trying to merge two file based on a SNP_A-## list in each file. For some reason, the regular expression in the if loop does not work and I can not match the key values generated from hash to the string from the input file. Could anybody help me detect the problem? Thanks, AG

Help with cookies

2004-12-08 Thread Moon, John
Does anyone know if I should be able to write a cookie like : snip $secure{USER}=$user-{USER_ID}; $secure{LEVEL}=$REQUEST{LEVEL}; %{$secure{USER_CATEGORIES}}=%USER_CATEGORIES; %{$secure{USER_ACCOUNTS}}=%USER_ACCOUNTS; @[EMAIL PROTECTED]; my $my_cookie = $q-cookie(-name='TechDirect',

RE: Help with cookies

2004-12-08 Thread Moon, John
Dear John, It is likely that you cannot store complex datastructures in cookies. (at least how the CGI module is currently written). You could try encoding the data to a string. Jonathan Paton [jwm] Thank you for the Dear John letter ;-)... I was afraid that may be the answer I got... but

RE: Working with Environment Variables

2004-12-02 Thread Moon, John
-Original Message- From: Dave Kettmann [mailto:[EMAIL PROTECTED] Sent: Thursday, December 02, 2004 11:14 AM To: Perl List (E-mail) Subject: Working with Environment Variables Hi List, I am trying to get an environment variable into another variable (for ease of use) and I am having

  1   2   >