RE: SQL question // date_format

2003-09-29 Thread Bob Showalter
David Gilden wrote: Good evening, The following mySQL query works fine, but the server is in California. I would like add 2 hours to %l, because the client is in Texas. I could just go to time in GMT and forget about it :) But I'm wondering if there is a simple solution here. SELECT

SQL -- getting one row problem

2003-09-29 Thread David Gilden
Good afternoon, Here is the output of my script, and cant understand why this is not working. Thanks for any and all pointers! Dave Gilden [EMAIL PROTECTED]:~/cgi-bin$ mail_guest_to_jk.cgi Use of uninitialized value in concatenation (.) or string at ./mail_guest_to_jk.cgi line 33. Use of

SQL -- getting one row problem -- clever mySQL trick

2003-09-29 Thread David Gilden
Hello out there... I wanted to thank everyone who has kindly offered their assistance with my current project. Of course I have more questions, But first I wanted to share how I solved my current issue. It's displays a clever mySQL trick! -- see script below: Dave Gilden ( kora musician /

calling other cgi's in PERL

2003-09-29 Thread David Gilden
Can anyone enlighten me on how to do this: Goal: call different PERL scripts from current PERL script. Below is what I am trying to accomplish, but I am not sure I have the syntax correct. (can't seem to find anything this in my PERL books) Thanks, Dave - #!/usr/bin/perl -w #some

Passing a variable to a package function vs. a local function

2003-09-29 Thread Dan Fish
I'm a bit new to this so please bear with me... I've written a script that uses CGI.pm something like this: use CGI::Carp qw(fatalsToBrowser); use CGI qw(:all); $query = new CGI; blah...blah... myfunc($query); blah...blah... sub myfunc{ my ($query) = @_; $foo=$query-param(foo);

Re: problem with Net::SSH::Perl using dsa key authentication

2003-09-29 Thread Haim Ashkenazi
Wiggins D'Anconia wrote: my %params = { protocol = 2, interactive = 1, identity_files = [EMAIL PROTECTED], }; Right here you are assigning a hash reference to a hash, which is essentially setting a key using the reference location with a value as undef. Then you pass the

RE: problem with Net::SSH::Perl using dsa key authentication

2003-09-29 Thread Haim Ashkenazi
Tn wrote: Hi, As far as I can tell you are doing it right according to the manpages. However, I noticed that in http://www.squarebox.co.uk/cgi-squarebox/manServer/usr/share/man/man3/Ne t::SSH::Perl.3pm that $ssh-login() requires a password that you aren't supplying: $ssh-login(user1,

Perl Beginners Portals

2003-09-29 Thread Shlomi Fish
Hi all! I believe learn.perl.org is very lacking: 1. Its design is ugly. 2. No links to many important online resources such as tutorials, books, article collections, mailing lists, web forums, etc. 3. Concentration on commercial books. 4. No source code for the site is available and [EMAIL

Re: problem with Net::SSH::Perl using dsa key authentication

2003-09-29 Thread Haim Ashkenazi
Wiggins D'Anconia wrote: my %params = {  protocol = 2,  interactive = 1,  identity_files =[EMAIL PROTECTED], }; Right here  you are assigning a hash reference to a hash, which is essentially setting a key using the reference location with a value as undef. Then you pass the hash

RE: problem with Net::SSH::Perl using dsa key authentication

2003-09-29 Thread Haim Ashkenazi
Tn wrote: Hi, As far as I can tell you are doing it right according to the manpages. However, I noticed that in http://www.squarebox.co.uk/cgi-squarebox/manServer/usr/share/man/man3/Ne t::SSH::Perl.3pm that $ssh-login() requires a password that you aren't supplying: $ssh-login(user1,

Re: Passing a variable to a package function vs. a local function

2003-09-29 Thread Ramprasad A Padmanabhan
Dan Fish wrote: I'm a bit new to this so please bear with me... I've written a script that uses CGI.pm something like this: use CGI::Carp qw(fatalsToBrowser); use CGI qw(:all); $query = new CGI; blah...blah... myfunc($query); blah...blah... sub myfunc{ my ($query) = @_;

Re: substr parsing mask

2003-09-29 Thread perl
I got it to work after adding a new var in apache modperl environment. This works: $acct_no = $xgi-param(acct_no); print substr($acct_no, 0, 4, x x (length($acct_no)-4)); This did NOT work: print substr($xgi-param(acct_no), length($xgi-param(acct_no))-4,4); Any explanation would be great.

RE: To quotes or not quotes parameter

2003-09-29 Thread Thomas Bätzler
[EMAIL PROTECTED] [EMAIL PROTECTED] asked: what is the proper way to pass a parameter for something like $cgi-param(username)? as far as i know it, this works for me: $cgi-param(username); Don't do that. Using barewords as strings can break your code if you later on introduce a sub with

Re: Perl - HowTo operating with large file?

2003-09-29 Thread Juris
Hi! Thanks, your solution is one way how solve this problem! I found other ... sub remove_ary_dupes{ my @[EMAIL PROTECTED]; #Define hash undef %saw; @[EMAIL PROTECTED] = (); #Hash owerwrite automaticly duplicated values! ;) my @out = sort keys %saw; # remove sort if undesired return @out; } sub

Objects, threads and so on

2003-09-29 Thread lists_perl_org
Hi all, I'm quite new to Perl so please bear with me :) I've experience in Delphi so I thought I knew about objects... it seems I don't :( I want to have a class I won't instanciate (static members and variables), with global vars so I can access them and change them from withing threads/forks.

Re: How to pass parameters to a module

2003-09-29 Thread Juris
Hi! It's easy! There is one sample: sub do_somethig { my @[EMAIL PROTECTED]; if (! ($passed_params[0])) { print Not passed parametrs } my @lines; #Do something ... return @lines; } On Thu, 25 Sep 2003 21:59:53 -0700, Rajesh Dorairajan [EMAIL PROTECTED]

Get email adress from AD or exchange?

2003-09-29 Thread Samuelsson, David
Has anyone done this in Perl, is there an module that can help me? I am aware of that I can use the Win32::Ole, but what I really want is an more easier way of asking: For $user Return mailadress This can be done in VB quite easy, but I want to try and stay perlish here. Any one have an clue?

Hylafax - Windows Client

2003-09-29 Thread Paul Kraus
For a project / learning exp. I am trying to create a windows client that will let me interact with a Hylafax server. I don't know enough about the special ftp protocol it uses so I am try to just parse the log files to get similar functionality using tk. Now how can attach to a share using login

Generic database access?

2003-09-29 Thread Rob Richardson
Greetings! Is there a Perl module -- Don't be silly!, I hear you reply. There's a Perl module for everything! OK, let me rephrase that. I would like a program, probably but not necessarily in Perl, that can run on a Perl-equipped Unix server that will give me remote access through the

Script runs once

2003-09-29 Thread rmck
Hello, I have a perl script that is to stop and start at midnight, and write to a new log file. The problem is it runs once then does not run again?? Below is the script that I am tring to use?? bash-2.03# #!/bin/perl -w use warnings; use strict; my ( $sec, $min, $hour, $day, $mon,

Re: Objects, threads and so on

2003-09-29 Thread Ramprasad A Padmanabhan
Lists Perl Org wrote: Hi all, I'm quite new to Perl so please bear with me :) I've experience in Delphi so I thought I knew about objects... it seems I don't :( I want to have a class I won't instanciate (static members and variables), with global vars so I can access them and change them from

Re: PERL DNS Lookup's using Socket

2003-09-29 Thread Dan Anderson
I don't know if you've been following the news but Verisign and some others have funneled *.com and *.net to their web site for expired and invalid domain names. You should correct for such things when looking up the IP. -Dan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

RE: Script runs once

2003-09-29 Thread TN
This problem looks familiar. What will kill the first snoop? The while loop at the bottom assumes snoop is running and tries to run another snoop on the same interface as the first. I don't think that can be done even from the command line because the first snoop will lock /dev/ge0 (in

RE: Generic database access?

2003-09-29 Thread TN
phpMyAdmin is great for managing MySQL databases remotely using a web browser interface. See http://www.phpmyadmin.net/ -tn -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Perl Newbie - Need good book recommendation

2003-09-29 Thread Dan Anderson
Big advice #2. Ebay. I buy all new books and expensive books through trusted sellers for about a 50-60% savings. Make sure you can pay media rate on the shipping. $4.00. I routinely buy books for $15-20 here. I do the same thing, and would add the following sites: http://www.alibris.com

Re: Objects, threads and so on

2003-09-29 Thread Rob Dixon
Fernando wrote: I'm quite new to Perl so please bear with me :) We have no choice: this is, after all, perl.beginners! I've experience in Delphi so I thought I knew about objects... it seems I don't :( Yes you do :) But you're confusing methodologies with implementations. I want to have a

Re: substr parsing mask

2003-09-29 Thread Jeff 'japhy' Pinyan
On Sep 29, [EMAIL PROTECTED] said: I got it to work after adding a new var in apache modperl environment. This works: $acct_no = $xgi-param(acct_no); print substr($acct_no, 0, 4, x x (length($acct_no)-4)); This did NOT work: print substr($xgi-param(acct_no), length($xgi-param(acct_no))-4,4);

Re: assigning a multi-dimensional array (mda) to an mda?

2003-09-29 Thread Kevin Pfeiffer
In article [EMAIL PROTECTED], R. Joseph Newton wrote: Kevin Pfeiffer wrote: I thought the easy way to do this is to first assign my entire 'en' data structure to the 'de' structure and then add 'de' values as available. So I did this: $text{'main'}{'de'} = $text{'main'}{'en'};

extending modules

2003-09-29 Thread Kevin Pfeiffer
Hi, I'm working on a nice frontend to the Unix::AliaseFile module for managing 'aliases'. In the process I've extended a couple methods in the module and added a new one. There is a show_user method that returns all aliases of which a user is a member; there's also a Toggle on/off that uses

Re: Generic database access?

2003-09-29 Thread Sam Harris
search google for Webmon. also check out phpadmin. good luck Sam Harris, Systems Administrator Franklin University 201 S. Grant Avenue Columbus, Ohio 43215-5399 Work: (614)-744-8322 Toll free: 1-877-341-6300 ext. 8322 [EMAIL PROTECTED] http://www.franklin.edu/ [EMAIL PROTECTED] 09/29/03 09:56

How to draw lines with different line width?

2003-09-29 Thread Yi Chu
I am usiing GD::Graph::lines to draw a graph with multiple lines. How do I specify so that lines can be of different width? yi - Do you Yahoo!? The New Yahoo! Shopping - with improved product search

Regarding Mail::Bulkmail 3.09 module

2003-09-29 Thread Chinku Simon
Hi, I am facing a problem in using the Mail::Bulkmail 3.09 module. I am using the following method to specify the configuration files. Mail::Bulkmail-conf_files('C:/Perl/lib/Bulkmail.cfg'); and I have converted the script to an '.exe ' file. While I run the .exe file I get the error Can't

Re: Objects, threads and so on

2003-09-29 Thread david
Lists Perl Org wrote: Hi all, I'm quite new to Perl so please bear with me :) I've experience in Delphi so I thought I knew about objects... it seems I don't :( I want to have a class I won't instanciate (static members and variables), with global vars so I can access them and change

Re: Generic database access?

2003-09-29 Thread Rob Richardson
Sam, There's a lot of products named Webmon. The ones I found on Google didn't do what I want. Which one are you thinking of? Can you give me a company name? Thanks again! Rob __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search

Is there a *nix shell variable for the path to perl?

2003-09-29 Thread Dan Anderson
Is there a (BA)SH/CSH/TSH/KSH variable to the Perl path? I am creating a script that uses Perl I want to be able to share over several servers. Instead of having my users edit the file manually (because I assume they would do something dumb) I want to create a shell script to edit the script for

Re: Should loops return a value?

2003-09-29 Thread Steve Grazzini
On Mon, Sep 29, 2003 at 11:04:46PM +0300, Ville Jungman wrote: This is real example from what i was doing yesterday: if($subs-anna_tilavuus($x+$lisax,$y+$lisay,$z) 100){ $subs-paivita($x); $udat{x}=$lisax; $udat{y}=$lisay; }elsif($subs-anna_tilavuus($x,$y+$lisay,$z)

Re: extending modules

2003-09-29 Thread Rob Dixon
Kevin wrote: I've updated the docs and wrote ...based on version xxx of Unix::AliasFile by Steve Snodgrass..., etc. Mister Snodgrass is a character in The Pickwick Papers invented by Charles Dickens. He is no Foo or Bar. Proud of the soil on which I stand :) Rob Dixon Leicester ENGLAND

Re: extending modules

2003-09-29 Thread Jeff 'japhy' Pinyan
On Sep 29, Kevin Pfeiffer said: I'm working on a nice frontend to the Unix::AliaseFile module for managing 'aliases'. In the process I've extended a couple methods in the module and added a new one. There is a show_user method that returns all aliases of which a user is a member; there's also a

Re: Is there a *nix shell variable for the path to perl?

2003-09-29 Thread Jeff Westman
Dan Anderson [EMAIL PROTECTED] wrote: Is there a (BA)SH/CSH/TSH/KSH variable to the Perl path? I am creating a script that uses Perl I want to be able to share over several servers. Instead of having my users edit the file manually (because I assume they would do something dumb) I want to

Question on handling files.

2003-09-29 Thread Douglas Holeman
I have had a request to pull 100,000+ names from a mailing list of 600,000+. I was hoping to figure out a way to get perl to help me do this. I stumbled through this code but the problem is I just wanted to know how to delete a line from the first list so I can be sure I dont pull the same

Re: Should loops return a value?

2003-09-29 Thread John W. Krahn
Steve Grazzini wrote: On Mon, Sep 29, 2003 at 11:04:46PM +0300, Ville Jungman wrote: This is real example from what i was doing yesterday: if($subs-anna_tilavuus($x+$lisax,$y+$lisay,$z) 100){ $subs-paivita($x); $udat{x}=$lisax; $udat{y}=$lisay;

Re: Replacing variable data between fields - Revisited.

2003-09-29 Thread perlwannabe
Perlwannabe wrote: I originally tried to do this, but it won't work. The data doesn't _always_ have a tab before address, sometimes (although seldom) it has a space. With grep I would miss the entire address. However, if I were to just select everything and replace it with nothing, that

remove blanks

2003-09-29 Thread perl
Is there a func or a onliner for removing blanks from both ends? I'm using these: $username =~ s/^\s+//; $username =~ s/\s+$//; There got to be one out there! thanks, -rkl -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: remove blanks

2003-09-29 Thread James Edward Gray II
On Monday, September 29, 2003, at 07:04 PM, [EMAIL PROTECTED] wrote: Is there a func or a onliner for removing blanks from both ends? I'm using these: $username =~ s/^\s+//; $username =~ s/\s+$//; We could combine those: $username =~ s/^\s*(.*?)\s*$/$1/; Hope that helps. James -- To

Re: Generic database access?

2003-09-29 Thread Mark G
Rob, why not try one of r-desktops. I use TridiaVNC, which you can carry with ssh. Mark G - Original Message - From: Rob Richardson [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, September 29, 2003 3:33 PM Subject: Re: Generic database access? Sam, There's a lot of

RE: remove blanks

2003-09-29 Thread Hanson, Rob
I ran some benchmarks. The two-liner outperformed the one-liners by a 10 to 1 ratio. Code and results below. Benchmark: timing 10 iterations of OneLine, OneLine2, TwoLines... OneLine: 41 wallclock secs (39.30 usr + 0.00 sys = 39.30 CPU) @ 2544.79/s OneLine2: 34 wallclock secs (32.58

Re: Question on handling files.

2003-09-29 Thread Bob Showalter
Douglas Holeman wrote: I have had a request to pull 100,000+ names from a mailing list of 600,000+. I was hoping to figure out a way to get perl to help me do this. I stumbled through this code but the problem is I just wanted to know how to delete a line from the first list so I can be sure

Re: remove blanks

2003-09-29 Thread Bob Showalter
[EMAIL PROTECTED] wrote: Is there a func or a onliner for removing blanks from both ends? I'm using these: $username =~ s/^\s+//; $username =~ s/\s+$//; There got to be one out there! Doing it in two steps is the way to go. Don't try to make one regex out of it. I usually write it this

Re: remove blanks

2003-09-29 Thread perl
this looks convenience thanks, -rkl [EMAIL PROTECTED] wrote: Is there a func or a onliner for removing blanks from both ends? I'm using these: $username =~ s/^\s+//; $username =~ s/\s+$//; There got to be one out there! Doing it in two steps is the way to go. Don't try to make one

Re: Question on handling files.

2003-09-29 Thread Bob Showalter
Bob Showalter wrote: for (1..$y) { print $_\n unless $_ % 1000; Whoops! You can leave the line above out. I just stuck it in there so I could see the progress through the loop. my $i = int(rand($x)) + 1; exists $h{$i} and redo; $h{$i}++; } -- To unsubscribe,

RE: remove blanks

2003-09-29 Thread perl
That's some good stuff. can you run a benchmark against these, contributed by others on this list, as well? $username =~ s/^\s*(.*?)\s*$/$1/; $username =~ s/^\s*(.*?)\s*$/$1/; thanks, -rkl I ran some benchmarks. The two-liner outperformed the one-liners by a 10 to 1 ratio. Code and

RE: remove blanks

2003-09-29 Thread perl
This is the correct reply. That's some good stuff. can you run a benchmark against these, contributed by others on this list, as well? $username =~ s/^\s*(.*?)\s*$/$1/; s/^\s+//, s/\s+$// $username; thanks, -rkl I ran some benchmarks. The two-liner outperformed the one-liners by a 10 to 1

building module/package

2003-09-29 Thread perl
Can someone help with build a simple module with one function in it? Can't seem to get anythign working. I guess something like: test.pl --- use mystuff; print mystuff::trim($username); mystuff.pm -- #do i need any declaration line here #is sub here or what? #and where do i put

Re: building module/package

2003-09-29 Thread Daniel Staal
--On Monday, September 29, 2003 19:04 -0700 [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: test.pl --- use mystuff; print mystuff::trim($username); mystuff.pm -- # do i need any declaration line here # is sub here or what? # and where do i put this pm file? sub trim { my $z = $_[0];

RE: remove blanks

2003-09-29 Thread Jeff 'japhy' Pinyan
On Sep 29, Hanson, Rob said: I ran some benchmarks. The two-liner outperformed the one-liners by a 10 to 1 ratio. Code and results below. Benchmark: timing 10 iterations of OneLine, OneLine2, TwoLines... OneLine: 41 wallclock secs (39.30 usr + 0.00 sys = 39.30 CPU) @ 2544.79/s

validate chars for a string

2003-09-29 Thread perl
Since, everyone is so lively today, I'm going to push my luck today with this list. I need a little help here with validating a string to have only characters that I want, A-z and _ (underscore). So, this is what I'm stuck on: #should fail because of space $username=bob by;

patches

2003-09-29 Thread Gupta, Sharad
Hi All, Say i give one of my application to a customer. The customer runs it and finds a bug in there. I don't want to give a fixed application again to the customer and ask him to go through the pain of installing it again. Instead i create a patch and tell customer to install that patch.

Re: patches

2003-09-29 Thread George Schlossnagle
man patch On Monday, September 29, 2003, at 11:24 PM, Gupta, Sharad wrote: Hi All, Say i give one of my application to a customer. The customer runs it and finds a bug in there. I don't want to give a fixed application again to the customer and ask him to go through the pain of installing

Re: validate chars for a string

2003-09-29 Thread Jeff 'japhy' Pinyan
On Sep 29, [EMAIL PROTECTED] said: Since, everyone is so lively today, I'm going to push my luck today with this list. I need a little help here with validating a string to have only characters that I want, A-z and _ (underscore). You'll want to use a regular expression, or perhaps just the

Re: validate chars for a string

2003-09-29 Thread perl
Lots of good stuff here. This oneliner is what makes perl cool but it's like speaking in tongue -:) sub isValidChars { shift =~ /^[A-Za-z_]+$/ } Thanks, -rkl On Sep 29, [EMAIL PROTECTED] said: Since, everyone is so lively today, I'm going to push my luck today with this list. I need a

To quotes or not quotes parameter

2003-09-29 Thread perl
what is the proper way to pass a parameter for something like $cgi-param(username)? as far as i know it, this works for me: $cgi-param(username); $cgi-param(username); $cgi-param('username'); thanks, -rkl -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL