Perl Newbee

2005-06-03 Thread Yuga Chodagam
Hi all, I am newbee to Perl. Could anybody please give me head start with Perl programming? I am interested in playing with some CGI stuff and want to sese the Perl's data manipulation power. Thanks all. I appreciate any help. Yuga. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

Re: Perl Newbee

2005-06-03 Thread Wiggins d'Anconia
Yuga Chodagam wrote: Hi all, I am newbee to Perl. Could anybody please give me head start with Perl programming? I am interested in playing with some CGI stuff and want to sese the Perl's data manipulation power. Thanks all. I appreciate any help. Yuga. Though he lurks

Re: Perl Newbee

2005-06-03 Thread Yuga Chodagam
Thanks all for quick replies. I will go for them. Yuga. On 6/3/05, Yuga Chodagam [EMAIL PROTECTED] wrote: Hi all, I am newbee to Perl. Could anybody please give me head start with Perl programming? I am interested in playing with some CGI stuff and want to sese the Perl's data

hash array sorting

2005-06-03 Thread Mike Blezien
Hello, ran into a strange problem when doing a sort. we have a file like this: 0::Accounts;Local Language 1::Anatomy;Local Language 2::Arabic;Local Language .. 26::German;Local Language 27::Governmentpolitics;Local Language . 3::Architecture;Local Language

Re: hash array sorting

2005-06-03 Thread Sean Davis
Look at using lc (lower case). It can make your sort case-insensitive. On Jun 3, 2005, at 7:17 PM, Mike Blezien wrote: Hello, ran into a strange problem when doing a sort. we have a file like this: 0::Accounts;Local Language 1::Anatomy;Local Language 2::Arabic;Local Language

Re: hash array sorting

2005-06-03 Thread Mike Blezien
How that apply to our code: foreach $key (sort { $lang-{$a}-[0] cmp $lang-{$b}-[0] } keys(%{$lang})) { # do stuff here } Sean Davis wrote: Look at using lc (lower case). It can make your sort case-insensitive. On Jun 3, 2005, at 7:17 PM, Mike Blezien wrote: Hello, ran into

checking for a sequence of numbers

2005-06-03 Thread Mike Blezien
Hello, got another hair puller here. we have script setup to process small messages posted, less the 250 words, and it goes through the message content and runs each word and checks for various unwanted words. It also is setup to check for possible numerical values, like a phone number or a

Re: Argument passing between perl and a C function.

2005-06-03 Thread J aperlh
Siegfried, Thank you. I am sure it's a dispatch interface. On 6/3/05, Siegfried Heintze [EMAIL PROTECTED] wrote: J, Is this a custom interface or a dispatch interface? I assumed it was a dispatch interface. Perl and many other languages like VB and javascript work well with dispatch

Re: Search Pattern for Roman Numerals?

2005-06-03 Thread Jeff 'japhy' Pinyan
On Jun 2, Siegfried Heintze said: How do I write a pattern for removing roman numerals? The first 10 is enough. Well, the first ten roman numerals are: I, II, III, IV, V, VI, VII, VIII, IX, X Just put those in a regex. s/\b(I|II|...)\b//g; would remove roman numerals, provided they

using open3 to interact with external program

2005-06-03 Thread D. J. Birkett
Hi, I'm trying to use open3 to control input to an external program (in this case gpg). I would use Expect, but I need to use packages that are installed as standard with perl as this script will be running on many platforms. I simply want to enter interactive mode of gpg, pass it 3

XML::Twig exception handling

2005-06-03 Thread Peter Rabbitson
Hello, I am interfacing an XML file with a database, much like the last example at http://www.xmltwig.com/xmltwig/tutorial/yapc_twig_s5.html What I am actually doing is checking if the table already got such a record, if so - updating it, otherwise inserting it, but this is not relevant.

file parsers

2005-06-03 Thread lance w
Hello all, I have a ms access db that spits out all the zip codes of our subscribers. I'd like to write a program that can parse, group, and count like numbers, eventually for relay to a graphic interface. Being new to perl, where is a good place to start? I'm sure there are many programs

MIME::Lite send_by_smtp cant change the default port

2005-06-03 Thread Ramprasad A Padmanabhan
Hi ALL, I am trying to send a mail using MIME::Lite I am trying to connect to port 26 of smtp server instead of 25 , but no luck I am not able to see anything wrong in this script , I hope I could get some inputs Thanks Ram -- My script is here #!/usr/bin/perl use strict;

Re: file parsers

2005-06-03 Thread Chris Devers
On Fri, 3 Jun 2005, lance w wrote: I have a ms access db that spits out all the zip codes of our subscribers. I'd like to write a program that can parse, group, and count like numbers, eventually for relay to a graphic interface. Being new to perl, where is a good place to start? Try DBI and

Re: Favorite packages for benchmarking?

2005-06-03 Thread Dave Gray
On 6/2/05, John W. Krahn [EMAIL PROTECTED] wrote: Siegfried Heintze wrote: There are lots of packages for date-time computations. What is the best one for timing computations for benchmarks? I'm thinking I want to fetch the time in 64 bit format instead of year, mo, day, hour, min, sec,

Re: Search Pattern for Roman Numerals?

2005-06-03 Thread Jay Savage
On 6/3/05, Jeff 'japhy' Pinyan [EMAIL PROTECTED] wrote: On Jun 2, Siegfried Heintze said: How do I write a pattern for removing roman numerals? The first 10 is enough. Well, the first ten roman numerals are: I, II, III, IV, V, VI, VII, VIII, IX, X Just put those in a regex.

Re: Search Pattern for Roman Numerals?

2005-06-03 Thread Jeff 'japhy' Pinyan
On Jun 3, Jay Savage said: On 6/3/05, Jeff 'japhy' Pinyan [EMAIL PROTECTED] wrote: s/\b(I|II|...)\b//g; This isn't going to get them all; it says to match (between word boundaries) I or II or any three non-newlines. So it will catch I, II, III, and VII. It will also catch I where it's

Re: Re: file parsers (fwd)

2005-06-03 Thread Chris Devers
This was really annoying. Please, please, please: do not sign up for a mailing list using one of these challenge/response email systems. It's a waste of everyone's time. Thank you. -- Chris Devers who is not the listmom, but doesn't think he'll be in the minority opinion on this point

Re: problem with $1

2005-06-03 Thread toolscripts
Perhaps the following applies. Usually this name is a single identifier, that is, a string beginning with a letter or underscore, and containing letters, underscores, and digits. -ts - Original Message - From: Nischi [EMAIL PROTECTED] To: beginners@perl.org Sent: Thursday, June 02, 2005

Re: Re: file parsers (fwd)

2005-06-03 Thread Dave Gray
On 6/3/05, Chris Devers [EMAIL PROTECTED] wrote: This was really annoying. Please, please, please: do not sign up for a mailing list using one of these challenge/response email systems. It's a waste of everyone's time. +1 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,

Re: XML::Twig exception handling

2005-06-03 Thread Peter Rabbitson
Either way I can't figure out how to raise an exception in the insert_row subroutine so that the parsefile() will die as well. Since I am working with records totalling several gigabytes, I am checking every SQL operation by evaling them with RaiseError turned on. This doesn't help me much,

Two Dimensional Array Problem

2005-06-03 Thread ahuber
I am trying to send the output of a mysql query to a two dimensional array. This is what I've tried using push. while (@results = $sth-fetchrow_array ()) { $x = $results[0]; $y = $results[1]; push (@data,[$x],[$y]); } However, I don't get back a two dimensional array, I get back a

RE: Two Dimensional Array Problem

2005-06-03 Thread brian . barto
Looks like you're pushing a list on to another list. In effect, appending one to the other. @data would be the first list. The second list would be '$x, $y'. Variables in a comma delimited fashion is the same as a list or an array. I usually deal with multidimensional arrays this way: $i = 0;

RE: Two Dimensional Array Problem

2005-06-03 Thread Wagner, David --- Senior Programmer Analyst --- WGO
[EMAIL PROTECTED] wrote: I am trying to send the output of a mysql query to a two dimensional array. This is what I've tried using push. while (@results = $sth-fetchrow_array ()) { $x = $results[0]; $y = $results[1]; push (@data,[$x],[$y]); push( @data, [ $x , $y

Re: Two Dimensional Array Problem

2005-06-03 Thread Wiggins d'Anconia
[EMAIL PROTECTED] wrote: I am trying to send the output of a mysql query to a two dimensional array. This is what I've tried using push. while (@results = $sth-fetchrow_array ()) { $x = $results[0]; $y = $results[1]; push (@data,[$x],[$y]); } However, I don't get back a

RE: Two Dimensional Array Problem

2005-06-03 Thread brian . barto
That's much better than my method. Didn't know you could push blocks of data like that. Cool :) -Original Message- From: Wagner, David --- Senior Programmer Analyst --- WGO [mailto:[EMAIL PROTECTED] Sent: Friday, June 03, 2005 3:01 PM To: [EMAIL PROTECTED]; beginners@perl.org Subject:

Pattern Question: One or both, but not neither

2005-06-03 Thread Siegfried Heintze
Can I write a pattern that matches Tampa or Florida, or Tampa Florida? Thanks, Siegfried -Original Message- From: Jeff 'japhy' Pinyan [mailto:[EMAIL PROTECTED] Sent: Friday, June 03, 2005 8:44 AM To: Jay Savage Cc: Perl Beginners List Subject: Re: Search Pattern for Roman Numerals? On

Re: Pattern Question: One or both, but not neither

2005-06-03 Thread Chris Devers
On Fri, 3 Jun 2005, Siegfried Heintze wrote: Can I write a pattern that matches Tampa or Florida, or Tampa Florida? I'm sure someone can. What happened when you tried it? You did try, right? -- Chris Devers -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail:

RE: Two Dimensional Array Problem

2005-06-03 Thread Wagner, David --- Senior Programmer Analyst --- WGO
[EMAIL PROTECTED] wrote: That's much better than my method. Didn't know you could push blocks of data like that. Cool :) Easiest way to see is use Data::Dumper and then print Dumper ( [EMAIL PROTECTED] ). Then you can see the setup. Especially nice when you tell the Dumper to sort

RE: Pattern Question: One or both, but not neither

2005-06-03 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Siegfried Heintze wrote: Can I write a pattern that matches Tampa or Florida, or Tampa Florida? Thanks, Siegfried You would have to order it so that if wanted Tampa Florida that would have priority over Tampa or Florida /(Tampa Florida|Tampa|Florida)/ one method. Wags ;)

Re: Pattern Question: One or both, but not neither

2005-06-03 Thread Jeremy Vinding
Wagner, David --- Senior Programmer Analyst --- WGO wrote: Siegfried Heintze wrote: Can I write a pattern that matches Tampa or Florida, or Tampa Florida? Thanks, Siegfried You would have to order it so that if wanted Tampa Florida that would have priority over Tampa or

Re: Two Dimensional Array Problem

2005-06-03 Thread Chris Charley
[snip] Hi Brian, I usually deal with multidimensional arrays this way: $i = 0; while (@results = $sth-fetchrow_array ()) { $x = $results[0]; $y = $results[1]; @points = ($x, $y); $data[$i] = [EMAIL PROTECTED]; $i++; } Just a note about a possible problem with the statement:

Getting started with Curses

2005-06-03 Thread Stuart Adams
Hello. I'm trying to get started with curses, so I wrote some code. The first printw statement works fine, but it doesn't accept any input afterwords. Is there a special method needed to get input from the keyboard when using curses? Your help is greatly appreciated. Here is my script.

hashes and arrarys

2005-06-03 Thread The Ghost
First here's my code: while (my $ref = $dblist - fetchrow_arrayref ()) { $surveyQuestions{question}[$counter]= $ref-[0]; $surveyQuestions{displayType}[$counter]=$ref- [1]; $surveyQuestions{saveValue}[$counter]=$ref-[2];

Re: hashes and arrarys

2005-06-03 Thread Xavier Noria
On Jun 3, 2005, at 23:56, The Ghost wrote: [EMAIL PROTECTED]; print Answers:$surveyQuestions{answers}[$x]\n; # --- Prints the number of answers instead My problem is that I always get the number of answers instead of the answers. What am I doing wrong? Perl

Re: Pattern Question: One or both, but not neither

2005-06-03 Thread Ing. Branislav Gerzo
Jeremy Vinding [JV], on Friday, June 03, 2005 at 13:31 (-0600) typed the following: Can I write a pattern that matches Tampa or Florida, or Tampa Florida? JV you could also do: JV /(?:Tampa? Florida)|Tampa/ this will not match Florida, I think you meant: /(?:Tampa )?Florida|Tampa/ --

question about appending spaces to each line of a file

2005-06-03 Thread Nupur Pande
Hi, I have a weird problem in perl. I want to read each line from a file, chomp off the newline character, append 6694 spaces to the end of each line and then output the line into a new file. The code I have is this: while ($line = Filehandle1) { chomp $line; $lengthofLine =

Re: question about appending spaces to each line of a file

2005-06-03 Thread Jeff 'japhy' Pinyan
On Jun 3, Nupur Pande said: I want to read each line from a file, chomp off the newline character, append 6694 spaces to the end of each line and then output the line into a new file. while ($line = Filehandle1) { chomp $line; $lengthofLine = length($line); Ok so far... for ($i = 0; $i

Re: question about appending spaces to each line of a file

2005-06-03 Thread Chris Devers
On Fri, 3 Jun 2005, Nupur Pande wrote: I want to read each line from a file, chomp off the newline character, append 6694 spaces to the end of each line and then output the line into a new file. The code I have is this: [...] for ($i = 0; $i 6694; $i++) { $line = $line.' '; }

slackware package from CPAN module ?

2005-06-03 Thread Michael Gale
Hello, I need to install perl and some perl modules on a ram disk. Which is fine, currently I am installing the slackware perl package. How ever there are some modules I would like to install from CPAN. Is there away to create packages for them ? or could I some how mirror the CPAN modules

How to get the sendmail path

2005-06-03 Thread Anish Kumar K
Hi I wrote a program using send mail for a mail application. In the server I was testing it sendmail was installed in /usr/bin/sendmail. But in a different server the path is different. Isn;t there a easy way for this. Like I need to get the path of the send mail and then assign it. Please

Re: How to get the sendmail path

2005-06-03 Thread Chris Devers
On Sat, 4 Jun 2005, Anish Kumar K wrote: Isn't there a easy way [to find sendmail] [question-mark] If you're on a Unix-ish platform, and the sendmail program is installed somewhere in your $PATH, the `which` command can help. For instance: $ which sendmail /usr/sbin/sendmail $

Re: How to get the sendmail path

2005-06-03 Thread Anish Kumar K
yeah this isfine. But In the Program I have given like my $sendmailPath=PATH WHERE IT IS INSTALLED. In the perl program itself I need to finfd it out As I don;t want to do it everytime I change it to a new server... Anish - Original Message - From: Chris Devers [EMAIL PROTECTED] To:

Re: How to get the sendmail path

2005-06-03 Thread John W. Krahn
Chris Devers wrote: If you don't have the `locate` database on your system, you're going to have to walk the while filesystem, using something like `find`. Here's one way to do it, but it will be very, very, very slow: $ find / -type f | grep -v '/.*/.*/.*/.*/'