"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,

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 "

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_

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 b

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 per

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 ret

Help with local install - not "root"

2004-07-16 Thread Moon, John
After installing I run a "test" and get the following error... Below is the install ... which I tried several times... I am trying to have the dir Crypt end up in the dir Library Any help or suggestions will be appreciated. DEV,SUN2>pwd /opt/common/html/td_dev/cgi-bin DEV,SUN2>./foo Can't loca

RE: Processing files in Multiple directories (Bash or Perl?)

2004-07-19 Thread Moon, John
Original Message- From: Edward WIJAYA [mailto:[EMAIL PROTECTED] Sent: Monday, July 19, 2004 11:37 AM To: [EMAIL PROTECTED] Subject: Processing files in Multiple directories (Bash or Perl?) Hi, I have a perl code, with usage: mycode.pl file.txt > file1.out Now I would like to execute this c

RE: search and replace array variables contents

2004-07-20 Thread Moon, John
Dear sir, I have two array variables. I want to find $a[1] and replace $b[1] in a file. ($a[1],$b[1] are array variables) How to find and replace the variable contents. for ($i=0;$i<$totalnum;$i++){ s/$a[i]/$b[i]/g; } Is it possible to do search and replace or kindly suggest me an idea Thanki

RE: use lib - not known at compile time

2004-07-29 Thread Moon, John
You may wish to look at "BEGIN" ... Hope that gives you some ideas... Thanks, jwm -Original Message- From: Thompson, Glenn [mailto:[EMAIL PROTECTED] Sent: Thursday, July 29, 2004 10:54 AM To: [EMAIL PROTECTED] Subject: use lib - not known at compile time I'm trying to add my own modu

RE: Sorting an array of hashes

2004-08-05 Thread Moon, John
-Original Message- From: Chris Mortimore [mailto:[EMAIL PROTECTED] Sent: Thursday, August 05, 2004 5:19 PM To: [EMAIL PROTECTED] Subject: Sorting an array of hashes I want to sort an AoH. Not each hash by its keys, but the array by the value of one of the keys in each hash. I know how to

RE: checking all pieces of split data for NULL

2004-08-10 Thread Moon, John
-Original Message- From: Tim McGeary [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 10, 2004 10:01 AM To: [EMAIL PROTECTED] Subject: checking all pieces of split data for NULL I have a file of data that I want to safety check to ensure that there is data for each piece of the line being

RE: using data return from DBI SELECT statement

2004-08-16 Thread Moon, John
This is probably a very newbie-type of question, but I have this code which a question noted by the ** below. my $sth = $dbh->prepare("SELECT * FROM patrons WHERE patron_id=$patron_id"); $sth -> execute(); # check to see if record is in database if (my $ref = $sth->fetchrow_hashr

RE: shift question

2004-08-30 Thread Moon, John
Subject: RE: shift question [EMAIL PROTECTED] wrote: > Ok fantastic, I totally understand that, and if there were going to be > more than one thing passed, just insert $par2 = shift; on the next > line and then the second argument is in $par2, I assume.right?? Yes. You might also see it this

RE: Need help with creating a GUI

2004-10-19 Thread Moon, John
->-Original Message- ->From: Knazik, Kimberly [mailto:[EMAIL PROTECTED] ->Sent: Tuesday, October 19, 2004 8:40 AM ->To: '[EMAIL PROTECTED]' ->Subject: Need help with creating a GUI -> ->I have been given an assignment at work to develop a users interface using ->Perl/Tk. Unfortunately for m

RE: check STDIN

2004-10-27 Thread Moon, John
-Original Message- From: E.Horn [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 27, 2004 7:53 AM To: [EMAIL PROTECTED] Subject: check STDIN Hello!! My question is,how to check the STDIN! I want that it is ONLY possible to give in words!(a-z,A-Z) #!/usr/bin/perl -w use LWP::Simple

RE: check STDIN

2004-10-27 Thread Moon, John
-Original Message- From: Gunnar Hjalmarsson [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 27, 2004 9:06 AM To: [EMAIL PROTECTED] Subject: Re: check STDIN John Moon wrote: > E.Horn wrote: >> I want that it is ONLY possible to give in words!(a-z,A-Z) > > [jwm] Try this and see if it

RE: start http request and move on

2004-11-03 Thread Moon, John
-Original Message- From: JupiterHost.Net [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 03, 2004 4:23 PM To: [EMAIL PROTECTED] Subject: start http request and move on Hey group, Not sure how I'd go about doing a url (via LWP probably) but not wait for it to return. print "Starti

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 troub

Help with cookies

2004-12-08 Thread Moon, John
Does anyone know if I should be able to write a cookie like : $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', -value=>\%secu

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 w

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 #!usr/loc

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(), b

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: #!/us

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 $ei

RE: Cgi Modul

2004-12-21 Thread Moon, John
output 56711265     56706919     Content-Type: text/html Daten QueryrasAutor:  hallo The problem is i always write NOT in the Htmlcode! Just before it starts or behind it ends!how can i solve this problem? i did it that way!   print

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 pas

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 tha

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: 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='usr',-checked=>1), checkbox(-name=>'sys',-checked=>0), checkbox(-name=>'wio',-checked=>0), checkbox(-name=>'idle',-checked=>0), reset(-nam

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 didn't

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: 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. H

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: 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 -param2 Now my requirement is , if value is also has and hyphen "-" then script should accept it and what ever i giv

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 i

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] F

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

2005-03-15 Thread Moon, John
essage- From: Chris Devers [mailto:[EMAIL PROTECTED] 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

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

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 s

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 fil

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 reg

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... > > > open MAILMAN, "| rmail $To_Address"; > print MAILMAN "Subject: Some subject\n"; > print MAILMAN "From: $Reply_to\n\n"; > print MAILMAN "some message.";

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 m

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 string

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: 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 ge

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 DEV,S

RE: capture a carriage return from

2005-04-20 Thread Moon, John
Subject: capture a carriage return from 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 complains whe

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 hash

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: m

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. p

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 match

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), "\

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: :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 connectio

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: 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 t

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-PRODWEB>more foo #! /usr/local/bin/perl use strict; my %t; my ($a, $c); my ($aa, $cc); $a=$a

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; >

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 a

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: 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]

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 va

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");prin

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;}

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/; prin

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","

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]

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]

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 the

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. This

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-PRODWEB>perl Makefile.PL > SUN83-PRODWEB>/usr/ccs/bin/make You have to be root (or use

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: 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]/)

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/

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, TF_M

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 ju

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 http://som

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. some

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{

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 kno

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 P

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 log

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. >

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: >&g

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 4023

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 (){ #---# #

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 () { chomp; my ($amt_gj, $amt_adj) = split /,/;

RE: Sum not producing zero

2008-03-12 Thread Moon, John
$formated . ' '; } } John W Moon http://dmspulsesurvey.myflorida.com/is -Original Message----- From: John W. Krahn [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 12, 2008 9:05 AM To: Perl Beginners Subject: Re: Sum not producing zero Mo

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 $seco

regex problem

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

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

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; us

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 thr

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; m

  1   2   >