RE: numeric and string conversions

2007-03-29 Thread Craig Rodgers
Thanks, The chr function was what I needed. It seems like there are a lot of stone cutter functions/operators in perl, I don't suppose you could recommend somewhere in the docs, on the web or in a book that would be useful in getting up to speed with these functions? At the moment it seems to

RE: perl -s and use strict

2007-03-29 Thread Sarthak Patnaik
Sorry I missed out. # ./test.pl -k=hello Variable $k is not imported at ./test.pl line 4. Global symbol $k requires explicit package name at ./test.pl line 4. Execution of ./test.pl aborted due to compilation errors. # Regards, Sarthak -Original Message- From: Sarthak Patnaik

Re: sending output to file and terminal

2007-03-29 Thread Jason Novinger
I've never used the Tee module, so I don't know. But IO::Handle seems to be a built-in module on most distros. Try taking the IO:Tee out and trying the code I sent. Let me know if that doesn't work, Jason On 3/29/07, lakshmi priya [EMAIL PROTECTED] wrote: Hi, Thanks for your prompt

Re: Exiting loops

2007-03-29 Thread Dr.Ruud
Karyn Williams schreef: #!/usr/bin/perl -w Make that: #!/usr/bin/perl use strict; use warnings; my $a = 1; while ($a 7) { Alternative: foreach my $a (1..7) { if ($ext_mon = 9) { $ext = $ext_year . '0' . $ext_mon; } else {

Re: perl -s and use strict

2007-03-29 Thread Chas Owens
On 3/29/07, Sarthak Patnaik [EMAIL PROTECTED] wrote: snip Is there any workaround for this, so that I can use strict and -s together. snip Short answer: yes, the vars pragma #!/usr/bin/perl -ws use strict; use vars qw($k); print $k\n Long answer: It is however a bad idea. -s does not do

Re: sending output to file and terminal

2007-03-29 Thread lakshmi priya
Hi, Thanks for your prompt reply, I have no idea how to use perl modules. Could you please help. I tried using use IO::Tee; use IO::Handle; but i got an error saying Can't locate IO/Tee.pm in @INC () please help On 3/29/07, Boga Srinivas [EMAIL PROTECTED] wrote: Hi lakshmi, I

Re: sending output to file and terminal

2007-03-29 Thread Boga Srinivas
Hi, I think you do not have that perl module installed. You can install it from the following link http://search.cpan.org/~dagolden/Tee-0.13/lib/Tee.pod http://search.cpan.org/%7Edagolden/Tee-0.13/lib/Tee.pod You can download the Tee-0.13.tar.gz

numeric and string conversions

2007-03-29 Thread Craig Rodgers
Hi, Please bear with me for a bit, I'm not realy sure how to explaine my problem so I'll try to give you an example of what's going wrong and what the desired behaviour is. I'm trying to calculate the CRC-8 checksum for the numbers 0~16 using the Digest::CRC perl module. The crc8 function takes

RE: sending output to file and terminal (in Unix use tee)

2007-03-29 Thread Tilley, Matthew B
If you are on a Unix platform, you can use tee in your script to direct output to two places at the same time. - Matt -Original Message- From: John W. Krahn [mailto:[EMAIL PROTECTED] Sent: Thursday, March 29, 2007 2:17 AM To: Perl Beginners Subject: Re: sending output to file and

XML parsing REST responses

2007-03-29 Thread Beginner
Hi, I might be in above my head here so bear with me if I am not making sense. I have to retrieve and extract an xml fragment from a REST server. I have followed some examples from the Web Services book. I am able to retrieve the data via LWP::UserAgent but I am baffled by the hash ref

To Reference or not to reference

2007-03-29 Thread Dukelow, Don
I've written a Perl program that declares a hash at the top of the program %myHask;. It has worked great until now when one sub program seams to be making its own copy of the hash. I can find no typo's or anything but there my still be one there. My question is would it be better to pass the

Re: To Reference or not to reference

2007-03-29 Thread Chas Owens
On 3/29/07, Dukelow, Don [EMAIL PROTECTED] wrote: I've written a Perl program that declares a hash at the top of the program %myHask;. It has worked great until now when one sub program seams to be making its own copy of the hash. I can find no typo's or anything but there my still be one

Re: To Reference or not to reference

2007-03-29 Thread Beginner
Hi On 29 Mar 2007 at 12:51, Dukelow, Don wrote: I've written a Perl program that declares a hash at the top of the program %myHask;. It has worked great until now when one sub program seams to be making its own copy of the hash. I can find no typo's or anything but there my still be one

Re: XML parsing REST responses - RESOLVED

2007-03-29 Thread Beginner
On 29 Mar 2007 at 12:39, Beginner wrote: Hi, I might be in above my head here so bear with me if I am not making sense. I have to retrieve and extract an xml fragment from a REST server. I have followed some examples from the Web Services book. I am able to retrieve the data via

Re: Making a HTTP POST

2007-03-29 Thread Peter Scott
On Thu, 29 Mar 2007 09:00:02 +0800, Jeff Pang wrote: What's the best way to go about making an HTTP POST? I want to retrieve a dynamic page that is only accessable via a POST. Is there a module (simple one?) that deals with this? From 'perldoc lwpcook', use HTTP::Request::Common

Re: XML parsing REST responses

2007-03-29 Thread Mumia W.
On 03/29/2007 06:39 AM, Beginner wrote: Hi, I might be in above my head here so bear with me if I am not making sense. I have to retrieve and extract an xml fragment from a REST server. I have followed some examples from the Web Services book. I am able to retrieve the data via

RE: Exiting loops

2007-03-29 Thread Wagner, David --- Senior Programmer Analyst --- WGO
-Original Message- From: Karyn Williams [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 28, 2007 17:54 To: beginners@perl.org Subject: RE: Exiting loops At 04:10 PM 3/28/07 -0700, Wagner, David --- Senior Programmer Analyst --- WGO wrote: take the o off the /o This is in

Re: To Reference or not to reference

2007-03-29 Thread Marilyn Sander
Chas, You mention an issue that i've been pondering for a while. When and why should you use an OO style instead of a hash? If your basic data structure (or several) is a hash, what is to be gained by refactoring as OO? Isn't OO just a large amount of syntactic sugar surrounding some

Prepend + to search words

2007-03-29 Thread Grant
Hello, how can I prepend a + character to each of the words in a string? For example, big blue widgets should be changed to +big +blue +widgets. - Grant -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: To Reference or not to reference

2007-03-29 Thread Chas Owens
On 3/29/07, Marilyn Sander [EMAIL PROTECTED] wrote: Chas, You mention an issue that i've been pondering for a while. When and why should you use an OO style instead of a hash? If your basic data structure (or several) is a hash, what is to be gained by refactoring as OO? Isn't OO just a

Re: Prepend + to search words

2007-03-29 Thread Tom Phoenix
On 3/29/07, Grant [EMAIL PROTECTED] wrote: Hello, how can I prepend a + character to each of the words in a string? For example, big blue widgets should be changed to +big +blue +widgets. I'd probably use an s/// (substitution) on the string. Match a word, replace it with the plus sign and

Re: sending output to file and terminal

2007-03-29 Thread tom arnall
On Thursday 29 March 2007 01:31, Boga Srinivas wrote: Hi, I think you do not have that perl module installed. You can install it from the following link http://search.cpan.org/~dagolden/Tee-0.13/lib/Tee.pod http://search.cpan.org/%7Edagolden/Tee-0.13/lib/Tee.pod You can download the

Re: Prepend + to search words

2007-03-29 Thread Grant
Hello, how can I prepend a + character to each of the words in a string? For example, big blue widgets should be changed to +big +blue +widgets. I'd probably use an s/// (substitution) on the string. Match a word, replace it with the plus sign and the word. Have you tried that? Hi Tom, I

RE: Exiting loops

2007-03-29 Thread Karyn Williams
At 09:48 AM 3/29/07 -0700, Wagner, David --- Senior Programmer Analyst --- WGO wrote: -Original Message- From: Karyn Williams [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 28, 2007 17:54 To: beginners@perl.org Subject: RE: Exiting loops At 04:10 PM 3/28/07 -0700, Wagner, David

create gui

2007-03-29 Thread xavier mas
Hi list, I want to create an interface with Per,l like a form for a database. Searching in cpan.org I found many Qtk and Tk modules, but I really don't know what I need in order to create Perl programs that can be handled through an interface. Can you advise me on that? Greetings, --

Re: Prepend + to search words

2007-03-29 Thread John W. Krahn
Grant wrote: Hello, how can I prepend a + character to each of the words in a string? For example, big blue widgets should be changed to +big +blue +widgets. I'd probably use an s/// (substitution) on the string. Match a word, replace it with the plus sign and the word. Have you tried

Re: Prepend + to search words

2007-03-29 Thread Dr.Ruud
John W. Krahn schreef: Grant: ?: ?: Hello, how can I prepend a + character to each of the words in a string? For example, big blue widgets should be changed to +big +blue +widgets. I'd probably use an s/// (substitution) on the string. Match a word, replace it with the plus sign and the

Re: Prepend + to search words

2007-03-29 Thread Grant
Hello, how can I prepend a + character to each of the words in a string? For example, big blue widgets should be changed to +big +blue +widgets. I'd probably use an s/// (substitution) on the string. Match a word, replace it with the plus sign and the word. Have you tried that? Hi

Re: Exiting loops

2007-03-29 Thread D. Bolliger
Karyn Williams am Donnerstag, 29. März 2007 20:27: [snip] It varies greatly. Often one or two. Sometimes 70. The size of the files is fairly substantial: -rw-r--r-- 1 root other249595095 Sep 1 2006 maillog.200608 I am getting Out of memory errors while running the script. [snip]

Re: numeric and string conversions

2007-03-29 Thread Alan
On Wednesday 28 March 2007 23:46, Craig Rodgers wrote: Thanks, The chr function was what I needed. It seems like there are a lot of stone cutter functions/operators in perl, I don't suppose you could recommend somewhere in the docs, on the web or in a book that would be useful in getting up

RE: numeric and string conversions

2007-03-29 Thread Craig Rodgers
Thank you, I can't believe I hadn't found this before! -Original Message- From: Alan [mailto:[EMAIL PROTECTED] Sent: Friday, 30 March 2007 11:39 AM To: beginners@perl.org Subject: Re: numeric and string conversions On Wednesday 28 March 2007 23:46, Craig Rodgers wrote: Thanks, The

how to pass double quotes in a url from CGI script

2007-03-29 Thread Ravi Malghan
Hi: I am having trouble passing double quotes when passing a url string. Everything after the double quotes does not go through. For example in the perl script below, the browser ends up going to

Re: how to pass double quotes in a url from CGI script

2007-03-29 Thread yitzle
$url = http://...=\1406746\;; print 'META HTTP-EQUIV=refresh content=1;URL=$url'; Plugging in the variable gives: META HTTP-EQUIV=refresh content=1;URL=http://...=\1406746\;' Should there be a after the URL=? That may be screwing it up. You also probably want to call a function (don't of its

Fwd: perl

2007-03-29 Thread mani kandan
Hai all Get me to help this problem solved. - Never miss an email again! Yahoo! Toolbar alerts you the instant new Mail arrives. Check it out.---BeginMessage--- sir I would much appreciate if you help me in finding the problem I am using apache

Re: perl

2007-03-29 Thread yitzle
Are you sure the file is at that location? Try running perl c:\programfiles\apahce2\cgi-bin\first.pl I suspect it ought to be: - program files opposed to programfiles - apache2 opposed to apahce2 On 3/30/07, mani kandan [EMAIL PROTECTED] wrote: Hai all Get me to help this problem solved.

Re: perl

2007-03-29 Thread mani kandan
The location is perl c:\program files\apahce2\cgi-bin\first.pl I am sure about it shows very clear in error message The system cannot find the path specified : couldn't spawn processes: c:\programfiles\apahce2\cgi-bin\first.pl. Instead of programfiles in my system it is program files

Re: perl

2007-03-29 Thread yitzle
That means that it is looking in that location for the file and it can't find the file there. Did you try running perl c:\programfiles\apahce2\cgi-bin\first.pl? That will execute the script if the script is there (ie the path is correct). If that does not work, then there is nothing wrong with

Re: perl

2007-03-29 Thread mani kandan
Dear all Earlier i did not see the error message properly sorry! I found my apache installed in the C:\Program Files\Apache Group\Apache2, Is that,it is correct or it should be read as C:\Program Files\Apache2\ Please read my error message: [error] client [127.0.0.1] OS3

Re: perl

2007-03-29 Thread yitzle
Go to the folder that first.pl is in (should be cgi-bin). Press backspace to go up one folder. It should be Apache2. Press backspace to go up a second folder. Is it Apache Group or is it Program Files? On 3/30/07, mani kandan [EMAIL PROTECTED] wrote: Dear all Earlier i did not see the error