Re: a way to make this more secured and better written?

2004-06-15 Thread Wiggins d'Anconia
Please bottom post and group reply so everyone can help and be helped, and you run less risk of being accidentally ignored... Jason Gray wrote: What do you exactly mean by passing $q as an argument? In general you want to avoid the use of globals, and "encapsulate" your subroutines such that the

Re: MIME::Entity fills my memory

2004-06-15 Thread Randy W. Sims
On 6/15/2004 6:34 PM, Papo Napolitano wrote: Hi, I just discovered this code: [CODE SNIPPED] makes my script eat all the available system memory (and swap!) So my question is how do destroy $msg so the memory is freed? 'undef $msg' or '$msg = undef' inside the loop aren't working. my variables are

Re: Time

2004-06-15 Thread Wiggins d'Anconia
Your script appears to break every 4th year http://danconia.org Chris Welch wrote: The attached text file is an example of a calendar I've used for CGI purposes (I should point out this is not entirely my script, it's modified by me but the original was by a friend of mine.) -Original Mess

RE: Time

2004-06-15 Thread Chris Welch
The attached text file is an example of a calendar I've used for CGI purposes (I should point out this is not entirely my script, it's modified by me but the original was by a friend of mine.) > -Original Message- > From: Mandar Rahurkar [mailto:[EMAIL PROTECTED] > Sent: 15 June 2004 23:22

MIME::Entity fills my memory

2004-06-15 Thread Papo Napolitano
Hi, I just discovered this code: #!/usr/bin/perl use warnings; use strict; use MIME::Entity; while (1) { my $msg = MIME::Entity->build( From => 'TEST <[EMAIL PROTECTED]>', Sender => '[EMAIL PROTECTED]', To => '[EMAIL PROTECTED]', Subject => 'TEST', Encoding =

Re: Time

2004-06-15 Thread Randy W. Sims
On 6/15/2004 6:21 PM, Mandar Rahurkar wrote: Hello All, I was wondering if there any module in perl which will let me add dates taking care of all the complications (i.e.,) if day is greater than 30 change month and so on. The upcoming standard is the DateTime family of modules. Howeve

Re: Time

2004-06-15 Thread Wiggins d Anconia
> Hello All, >I was wondering if there any module in perl which will let me > add dates taking care of all the complications (i.e.,) if day is greater > than 30 change month and so on. > Check CPAN for, Date::Calc Date::Manip Depending on how fancy you need to get, you can also us

Time

2004-06-15 Thread Mandar Rahurkar
Hello All, I was wondering if there any module in perl which will let me add dates taking care of all the complications (i.e.,) if day is greater than 30 change month and so on. Thanks, Mandar -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL P

RE: I can't build a sane perl (floating-point numbers go funny)

2004-06-15 Thread Deneb Meketa
Thanks for the perlnumber reference. But the problem is more severe than just inexact numbers. I was writing about the inexact numbers because that seemed like an easy thing to discuss :) The more serious problems start whenever anything (including stuff in the perl libraries) says something lik

how to sort certain pattern from a file

2004-06-15 Thread Naser Ali
Below is a sample report. I have been able to only capture lines between "Intance Name" and "System totals", but here is my delima. The menus on the report are repeated several times. For example, the line starts with "Instance Name" appears twice. I only want to capture the lines between first o

Re: Link refresh

2004-06-15 Thread JupiterHost.Net
Werner Otto wrote: Sorry this might be off the topic. Is there anything that I can do in perl to: when I click on a link to refresh the page as I click on the hyperlink Like imaitate the browser's refresh button with a link? How about this: #!/usr/bin/perl use strict use warnings; use CGI; print

Re: Is an Array

2004-06-15 Thread James Edward Gray II
On Jun 15, 2004, at 2:24 PM, Angie Ahl wrote: Hi Howdy. Scouring the books to try and find this, but it's evading me. How can I test whether something is an array. For some definition of "something" that includes references, use ref(). :) ie I have a hash and some values are anon arrays and some

Re: Is an Array

2004-06-15 Thread Jeff 'japhy' Pinyan
On Jun 15, Angie Ahl said: >ie I have a hash and some values are anon arrays and some are strings. >I want to test to see whether one is an array and then traverse it. if (ref $hash{$key}) { # do something with @{ $hash{$key} } } perldoc -f ref -- Jeff "japhy" Pinyan [EMAIL PROTEC

Is an Array

2004-06-15 Thread Angie Ahl
Hi Scouring the books to try and find this, but it's evading me. How can I test whether something is an array. ie I have a hash and some values are anon arrays and some are strings. I want to test to see whether one is an array and then traverse it. Cheers Angie -- To unsubscribe, e-mail: [EMAIL

Re: Parsing binary file.

2004-06-15 Thread Jeff 'japhy' Pinyan
On Jun 15, Rod Za said: >I am trying to read a binary file (HP-PCL file >(windows printer)) to count the number of pages and >copies. You probably want to look at the unpack() function, which allows you to convert binary data into the stuff it represents. For instance, if you have read a string

Parsing binary file.

2004-06-15 Thread Rod Za
Hello all, I am trying to read a binary file (HP-PCL file (windows printer)) to count the number of pages and copies. Can someone help me? I got a C code that works good - but i want to do that in Perl to learn. thank you very much. Rod Za __

Link refresh

2004-06-15 Thread Werner Otto
Sorry this might be off the topic. Is there anything that I can do in perl to: when I click on a link to refresh the page as I click on the hyperlink -- Kind Regards, Otto -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: How to open a file for read as well as write

2004-06-15 Thread James Edward Gray II
On Jun 15, 2004, at 10:02 AM, Ramprasad A Padmanabhan wrote: No that is not what I wanted I found that out anyways thanks Want to bet? Guess how the code you posted works, behind the scenes. ;) Seriously, I'm glad you found your answer. James -- To unsubscribe, e-mail: [EMAIL PROTECTED] For add

Re: How to open a file for read as well as write

2004-06-15 Thread Ramprasad A Padmanabhan
No that is not what I wanted I found that out anyways thanks { local(@ARGV)=($filename); local($^I)=".BAK"; while(<>){ if(){ s/$oldvar/$newvar/; } print; } } On Tue, 2004-06-15 at 19:02, Stephan Hochhaus wrote: > Am 15.06.2004 um 12:48 schrieb Ramprasad A Padmanabhan

Re: I can't build a sane perl (floating-point numbers go funny)

2004-06-15 Thread Wiggins d Anconia
> I have some experience using perl, but I'm having a hard time finding or > building a sane perl interpreter for my particular machine. For example, > perl -e "print 1.1" yields something like 1.10833. This was true both > of the 5.8.0 that came with my Red Hat 8.0 distro, and the 5.8.2 that

Re: a way to make this more secured and better written?

2004-06-15 Thread Wiggins d Anconia
> > > my @fields = qw(name email city state message); > > foreach my $field (@fields) { > > $blanks++ if !$q->param($field); > > } > for(@fields) { $blanks ++ if $q->param($_) eq ''; } > IMO, I disagree that removing whitespace and switching a named variable such as $field to $_ is an

Re: a way to make this more secured and better written?

2004-06-15 Thread Wiggins d Anconia
> #!/usr/bin/perl -w > > use strict; > use warnings; You probably don't want both -w and 'use warnings'. Personally I would stick with the 'use warnings' unless you have to deal with older versions of Perl which is not terribly likely. The -w turns on warnings for the whole script, which will in

Re: loop jumping

2004-06-15 Thread Jeff 'japhy' Pinyan
On Jun 15, [EMAIL PROTECTED] said: >I am trying to make subroutine which asks (via a regular expr) where some >files are and then list them - but I would like it to jump back to the >start of the loop if it does not find any files. > >The jumping part works if there are only files in the folder, a

Re: weird

2004-06-15 Thread Jeff 'japhy' Pinyan
On Jun 14, Randy W. Sims said: >I've always thought that behaviour kinda weird myself (though now it's >become second nature). I like the way Ruby has two versions for chop/chomp: > >newstring = str.chomp; # leave original untouched >str.chomp!;# update original inplace > >Of course, m

Re: How to open a file for read as well as write

2004-06-15 Thread James Edward Gray II
On Jun 15, 2004, at 5:48 AM, Ramprasad A Padmanabhan wrote: I want to open a file using a perl script and change a particular variable in it. I think by setting the $^I variable I can open a file for read and write, But I am not getting any examples anywhere You CAN open a file for read and write,

Re: a way to make this more secured and better written?

2004-06-15 Thread JupiterHost.Net
Jason Gray wrote: #!/usr/bin/perl -w use strict; use warnings; use CGI(); use Mail::Mailer; my $q = CGI->new(); print $q->header(); #- # * startup methods -> global variables. check_fields(); #- sub check_fields { my

How to open a file for read as well as write

2004-06-15 Thread Ramprasad A Padmanabhan
I want to open a file using a perl script and change a particular variable in it. I think by setting the $^I variable I can open a file for read and write, But I am not getting any examples anywhere Thanks Ram -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAI

RE: loop jumping

2004-06-15 Thread Charles K. Clarkson
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: : I am trying to make subroutine which asks (via a regular : expr) where some files are and then list them - but I : would like it to jump back to the start of the loop if : it does not find any files. : : The jumping part works if there are only files

I can't build a sane perl (floating-point numbers go funny)

2004-06-15 Thread Deneb Meketa
I have some experience using perl, but I'm having a hard time finding or building a sane perl interpreter for my particular machine. For example, perl -e "print 1.1" yields something like 1.10833. This was true both of the 5.8.0 that came with my Red Hat 8.0 distro, and the 5.8.2 that I built

I can't build a sane perl (floating-point numbers go funny)

2004-06-15 Thread Deneb Meketa
I have some experience using perl, but I'm having a hard time finding or building a sane perl interpreter on my particular machine. For example, perl -e "print 1.1" yields something like 1.10833. This was true both of the 5.8.0 that came with my Red Hat 8.0 distro, and the 5.8.2 that I built

a way to make this more secured and better written?

2004-06-15 Thread Jason Gray
#!/usr/bin/perl -w use strict; use warnings; use CGI(); use Mail::Mailer; my $q = CGI->new(); print $q->header(); #- # * startup methods -> global variables. check_fields(); #- sub check_fields { my $blanks; m

Re: loop jumping

2004-06-15 Thread Edward Wijaya
On Tue, 15 Jun 2004 09:39:31 +0200, <[EMAIL PROTECTED]> wrote: The jumping part works if there are only files in the folder, as soon as there are files and folders it does not jump out of the loop. Can any body give me an idea how to break this one?? Use "last" function. perldoc -f last Regards

loop jumping

2004-06-15 Thread kof
Hi All, I am trying to make subroutine which asks (via a regular expr) where some files are and then list them - but I would like it to jump back to the start of the loop if it does not find any files. The jumping part works if there are only files in the folder, as soon as there are files and