Re: How to "chmod go-w $name" in perl?

2004-08-16 Thread John W. Krahn
Steven Shoemaker wrote: Hi, Hello, What am I doing wrong? And yes I know that there is a module for chmod but it is not loaded on this server that I need to run this on. The assumption here is that your code is not working correctly but you have not explained exactly what it is supposed to do so

RE: MySQL and Perl over the web

2004-08-16 Thread Bob Showalter
renzo rizzato wrote: > Hallo to all, > I am trying to access my MySQL database using the following PERL > script: > > use DBI; > use CGI qw(:standard); You should ALWAYS "use strict", and probably "use warnings" as well. > > print "Content-type: text/html\n\n"; > > print "\n\n\n"; Bad HTML.

Re: host perl script

2004-08-16 Thread Chris Devers
On Mon, 16 Aug 2004, Franklin wrote: I am planning to apply for the virtual server plan. Ok, that's fine -- go ahead. Another response said you should focus on making your script work on a test machine of your own before uploading it, and that's true. On the other hand, the server may not be runn

RE: how to encrypt my perl script

2004-08-16 Thread Trooper
You could also set up your own web server machine that only you have access to! But really... have you created something so special that nobody else should be allowed to lay their eyes on it? Much of what we have with Perl today is because people have shared their code (ie. all the great module

Re: host perl script

2004-08-16 Thread Flatman
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Franklin) wrote: > Hello: > > > > I want to host my website and perl script. And I have inquired it with www > lunarpages.com and www.ipowerweb.com. In both providers' 7.95/month plan, I > only can execute my perl script by webpage or cron job

RE: how to encrypt my perl script

2004-08-16 Thread Bakken, Luke
Put a copyright notice in it and have a good lawyer. To: [EMAIL PROTECTED] Subject: **POSSIBLE SPAM**::how to encrypt my perl script Hello: I would run a perl script in my website which is hosted

using data return from DBI SELECT statement

2004-08-16 Thread Tim McGeary
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_hashref()

can't locate Image/Magick.pm in @INC

2004-08-16 Thread Brian Volk
Hello All, I'm having trouble using Apache::ImageMagick. Here is the error I'm getting. Can't locate Image/Magick.pm in @INC (@INC contains: C:\PROGRAM FILES\PERLEDIT C:/Perl/lib C:/Perl/site/lib .) at C:/Perl/site/lib/Apache/ImageMagick.pm line 25. ---

Re: can't locate Image/Magick.pm in @INC

2004-08-16 Thread David Dorward
On 16 Aug 2004, at 15:30, Brian Volk wrote: I'm having trouble using Apache::ImageMagick. Here is the error I'm getting. Can't locate Image/Magick.pm in @INC (@INC contains: C:\PROGRAM FILES\PERLEDIT C:/Perl/lib C:/Perl/site/lib .) at C:/Perl/site/lib/Apache/ImageMagick.pm line 25. Does Magick.pm

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: using data return from DBI SELECT statement

2004-08-16 Thread Wiggins d Anconia
> 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

perl.beginners Weekly list FAQ posting

2004-08-16 Thread casey
NAME beginners-faq - FAQ for the beginners mailing list 1 - Administriva 1.1 - I'm not subscribed - how do I subscribe? Send mail to <[EMAIL PROTECTED]> You can also specify your subscription email address by sending email to (assuming [EMAIL PROTECTED] is your email address):

Sending Email

2004-08-16 Thread Fontenot, Paul
I'm in need of a way to send the output of a script from a windows server via email and I'm drawing a blank. What is the module called?

Re: Sending Email

2004-08-16 Thread David Greenberg
Mail::Send and Mail::Mailer are a couple, though I'm sure there are others. -David On Mon, 16 Aug 2004 09:00:33 -0700, Fontenot, Paul <[EMAIL PROTECTED]> wrote: > I'm in need of a way to send the output of a script from a windows > server via email and I'm drawing a blank. What is the module call

date format

2004-08-16 Thread DBSMITH
All, I have this code: my ($month, $day, $year) = (localtime)[4,3,5]; printf ("%02d/%02d/%02d\n", $month+1,$day,$year+1900); which gives me 08/16/2004 what I want is 08/16/04. Should I just use Posix with strftime or is there a quicker way w/out having to load the Posix module? also, why

RE: using data return from DBI SELECT statement

2004-08-16 Thread Bob Showalter
Tim McGeary wrote: > This is probably a very newbie-type of question, but I have this code > which a question noted by the ** below. > [snip] ># join patrons to respective disciple default lists ># bib_databases >my $sth2 = $dbh->prepare("SELECT bib_database_id FROM >

RE: date format

2004-08-16 Thread Bob Showalter
[EMAIL PROTECTED] wrote: > All, > > I have this code: > > my ($month, $day, $year) = (localtime)[4,3,5]; > printf ("%02d/%02d/%02d\n", $month+1,$day,$year+1900); > > which gives me > > 08/16/2004 > > what I want is 08/16/04. Should I just use Posix with strftime or is > there a quicker way w/

RE: Sending Email

2004-08-16 Thread NandKishore.Sagi
Use MIME::Lite to send the mail and you can use any standard File writing packages(For example O::Tee) to log all the messages. -Original Message- From: Fontenot, Paul [mailto:[EMAIL PROTECTED] Sent: Monday, August 16, 2004 11:01 AM To: [EMAIL PROTECTED] Subject: Sending Email I'm in ne

Re: date format

2004-08-16 Thread Chris Devers
On Mon, 16 Aug 2004 [EMAIL PROTECTED] wrote: I have this code: my ($month, $day, $year) = (localtime)[4,3,5]; printf ("%02d/%02d/%02d\n", $month+1,$day,$year+1900); which gives me 08/16/2004 what I want is 08/16/04. Should I just use Posix with strftime or is there a quicker way w/out having to lo

RE: date format

2004-08-16 Thread Bob Showalter
Bob Showalter wrote: >($year + 1900) % 100 Actually just $year % 100 is valid. The former makes it clearer what you're doing, if you're into that :~) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: date format

2004-08-16 Thread Flemming Greve Skovengaard
[EMAIL PROTECTED] wrote: All, I have this code: my ($month, $day, $year) = (localtime)[4,3,5]; printf ("%02d/%02d/%02d\n", $month+1,$day,$year+1900); which gives me 08/16/2004 what I want is 08/16/04. Should I just use Posix with strftime or is there a quicker way w/out having to load the Pos

Re: Sending Email

2004-08-16 Thread Lincoln Rutledge
I guess if you don't use cygwin, sendmail won't work for you... That's what I usually do... open(SENDMAIL, "|/usr/lib/sendmail -oi -t -odq") or die "Can't fork for sendmail: $!\n"; print SENDMAIL <<"EOF"; From: $login <[EMAIL PROTECTED]> To: Subject:

RE: date format

2004-08-16 Thread DBSMITH
Ah yes the old modulus operator! : ) should of thought of that myself... but I am glad this list exists! thanks a bunch! Derek B. Smith OhioHealth IT UNIX / TSM / EDM Teams Bob Showalter <[EMAIL PROTECTED]> 08/16/2004 12:44 PM To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>

RE: can't locate Image/Magick.pm in @INC

2004-08-16 Thread Brian Volk
David Dorward wrote: >Does Magick.pm existing in an Image directory in any of those >directories? If not - install Image::Magick. Yes it does... Since I'm using Active Perl, and the only Image::Magick is Apache::ImageMagick, if that is causing the error? Not sure. Thanks, Brian -Original

Re: can't locate Image/Magick.pm in @INC

2004-08-16 Thread JupiterHost.Net
Brian Volk wrote: David Dorward wrote: Does Magick.pm existing in an Image directory in any of those directories? If not - install Image::Magick. Yes it does... Since I'm using Active Perl, and the only Image::Magick is Apache::ImageMagick, if that is causing the error? Not sure. Er, if you hav

pattern extraction

2004-08-16 Thread Fontenot, Paul
If I have this: http://www.microsoft.com/technet/security/bulletin/MS02-045.asp"; target="_default">Microsoft Security Bulletin MS02-045 Or this: http://www.microsoft.com/technet/treeview/?url=/technet/security/b ulletin/MS02-045.asp" target="_default">Microsoft Security Bulletin MS02-045 How can

Re: pattern extraction

2004-08-16 Thread JupiterHost.Net
Fontenot, Paul wrote: If I have this: http://www.microsoft.com/technet/security/bulletin/MS02-045.asp"; target="_default">Microsoft Security Bulletin MS02-045 Or this: http://www.microsoft.com/technet/treeview/?url=/technet/security/b ulletin/MS02-045.asp" target="_default">Microsoft Security Bull

Re: pattern extraction

2004-08-16 Thread Chris Devers
On Mon, 16 Aug 2004, Fontenot, Paul wrote: Or this: http://www.microsoft.com/technet/treeview/?url=/technet/security/b ulletin/MS02-045.asp" target="_default">Microsoft Security Bulletin MS02-045 How can I get this: MS02-045 The actual pattern would be MS0?-??? where the "?" could be any number Try

RE: date format

2004-08-16 Thread Bob Showalter
Flemming Greve Skovengaard wrote: > printf ("%02d/%02d/%02d\n", $month + 1, $day, $year - 100); > # Only works when $year > 1999. And when $year <= 2099 :~) Stick to $year % 100; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: pattern extraction

2004-08-16 Thread Fontenot, Paul
I'm not having much luck with that :), probably using it incorrectly though. Is this correct: my $mso = $row[2]( m/MS\d\d\-\d{3}/); or am I just way wrong on this one? -Original Message- From: JupiterHost.Net [mailto:[EMAIL PROTECTED] Sent: Monday, August 16, 2004 11:09 AM To: Fontenot

RE: pattern extraction

2004-08-16 Thread Chris Devers
On Mon, 16 Aug 2004, Fontenot, Paul wrote: I'm not having much luck with that :), probably using it incorrectly though. Is this correct: my $mso = $row[2]( m/MS\d\d\-\d{3}/); or am I just way wrong on this one? We wouldn't know. You didn't tell us how this data is stored before now. Are you saying

RE: pattern extraction

2004-08-16 Thread Fontenot, Paul
Here is the entire script: while (my(@row) = $sth->fetchrow_array) { my $ip = $row[0]; next if $ip == "010.041.\*"; my $name = $row[1]; my $mso = $row[2](m/MS\d\d\-\d{3}/); my @date = split/ /, $row[3]; my $severity = $row[4];

RE: pattern extraction

2004-08-16 Thread Chris Devers
On Mon, 16 Aug 2004, Fontenot, Paul wrote: Here is the entire script: Thanks, this is clearer. while (my(@row) = $sth->fetchrow_array) { # ... snip ... my $mso = $row[2](m/MS\d\d\-\d{3}/); This may work better: my $mso = $row[2] =~ (m/MS\d\d\-\d{3}/); or my $mso = ( $row[

Re: date format

2004-08-16 Thread Flemming Greve Skovengaard
Bob Showalter wrote: Flemming Greve Skovengaard wrote: printf ("%02d/%02d/%02d\n", $month + 1, $day, $year - 100); # Only works when $year > 1999. And when $year <= 2099 :~) Stick to $year % 100; Yes, you are correct. Your solution is fool proof. -- Flemming Greve Skovengaard FAITH, n. a

RE: pattern extraction

2004-08-16 Thread Bob Showalter
Chris Devers wrote: > On Mon, 16 Aug 2004, Fontenot, Paul wrote: > > > Here is the entire script: > > Thanks, this is clearer. > > > while (my(@row) = $sth->fetchrow_array) > > { > ># ... snip ... > > my $mso = $row[2](m/MS\d\d\-\d{3}/); > > This may work better: > > my $mso = $r

RE: pattern extraction

2004-08-16 Thread Fontenot, Paul
Thanks for the help. That did it, now if I could ask one more question on this. How can I make the MS portion match either upper or lower case? -Original Message- From: Bob Showalter [mailto:[EMAIL PROTECTED] Sent: Monday, August 16, 2004 12:01 PM To: 'Chris Devers'; Fontenot, Paul Cc: [E

RE: pattern extraction

2004-08-16 Thread Chris Devers
On Mon, 16 Aug 2004, Fontenot, Paul wrote: Thanks for the help. That did it, now if I could ask one more question on this. How can I make the MS portion match either upper or lower case? Add the 'i' flag to your regex: my $mso = ( $row[2] =~ (m/MS\d\d\-\d{3}/i) ); For more, look at `perldoc per

RE: pattern extraction

2004-08-16 Thread Fontenot, Paul
Thanks for all the help, I'll be sure and do that from now on. -Original Message- From: Chris Devers [mailto:[EMAIL PROTECTED] Sent: Monday, August 16, 2004 12:08 PM To: Fontenot, Paul Cc: Bob Showalter; [EMAIL PROTECTED] Subject: RE: pattern extraction On Mon, 16 Aug 2004, Fontenot, Pau

Re: pattern extraction

2004-08-16 Thread JupiterHost.Net
Fontenot, Paul wrote: Here is the entire script: while (my(@row) = $sth->fetchrow_array) { my $ip = $row[0]; next if $ip == "010.041.\*"; my $name = $row[1]; my $mso = $row[2](m/MS\d\d\-\d{3}/); I'd do (assuming $row[2] holds the html you gave before and $row[2] only h

Re: date format

2004-08-16 Thread DBSMITH
I have this value, from the date format solution emails, in a subroutine and I want to pass it to a if clause, how would I go about this? Can I assign a literal such as sub datemanip { my ( $month, $day, $year) = (localtime)[4,3,5]; my $foodate = printf ("%02d/%02d/%02d\n", $m

RE: pattern extraction

2004-08-16 Thread Fontenot, Paul
Ugh, I thought I was done. Why would this show the MS?-??? in either upper or lowercase http://www.microsoft.com/technet/security/bulletin/MS03-051.asp"; target="_default">Microsoft Security Bulletin MS03-051 And this one would not show a value? http://www.microsoft.com/technet/treeview/?url=/tec

Re: date format

2004-08-16 Thread Chris Devers
On Mon, 16 Aug 2004 [EMAIL PROTECTED] wrote: sub datemanip A name like that screams a need for the Date::Manip CPAN module: Look over the docs for that module, see if you can't use it to do what you need to do, and let the list know if you

RE: pattern extraction

2004-08-16 Thread Jeff 'japhy' Pinyan
On Aug 16, Fontenot, Paul said: >while (my(@row) = $sth->fetchrow_array) >{ > my $ip = $row[0]; > next if $ip == "010.041.\*"; That line will always be false. You probably mean next if $ip eq '010.041.*'; But if you really wanted to do a wildcard-like equality, you'd need a reg

Re: date format

2004-08-16 Thread Flemming Greve Skovengaard
[EMAIL PROTECTED] wrote: I have this value, from the date format solution emails, in a subroutine and I want to pass it to a if clause, how would I go about this? Can I assign a literal such as sub datemanip { my ( $month, $day, $year) = (localtime)[4,3,5]; my $foodate = printf

accessing each element

2004-08-16 Thread Mandar Rahurkar
Hi, I have a list , $list=['orange','red','purple']; How do I access each member of $list ? If this had been @list I cud have done, foreach(@list) { print $_; } How does it work for a scalar ? Thanks, Mandar -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [

Re: accessing each element

2004-08-16 Thread Ricardo SIGNES
* Mandar Rahurkar <[EMAIL PROTECTED]> [2004-08-16T17:32:28] > Hi, >I have a list , > $list=['orange','red','purple']; > > How do I access each member of $list ? If this had been @list I cud have > done, > > foreach(@list) { > print $_; > } > > How does it work for a scalar ? You really, r

Re: pattern extraction

2004-08-16 Thread JupiterHost.Net
Fontenot, Paul wrote: Ugh, I thought I was done. Why would this show the MS?-??? in either upper or lowercase http://www.microsoft.com/technet/security/bulletin/MS03-051.asp"; target="_default">Microsoft Security Bulletin MS03-051 And this one would not show a value? http://www.microsoft.com/techn

RE: pattern extraction

2004-08-16 Thread Wagner, David --- Senior Programmer Analyst --- WGO
JupiterHost.Net wrote: > Fontenot, Paul wrote: > >> Ugh, I thought I was done. >> >> Why would this show the MS?-??? in either upper or lowercase > href="http://www.microsoft.com/technet/security/bulletin/MS03-051.asp"; >> target="_default">Microsoft Security Bulletin MS03-051 >> >> And this one

RE: pattern extraction

2004-08-16 Thread Fontenot, Paul
Yes I have. The following URL's are the exact data from the database. I can get the MS??-??? from this URL http://www.microsoft.com/technet/security/bulletin/MS03-051.asp"; target="_default">Microsoft Security Bulletin MS03-051 But not from this one. My question was to see if anyone could figure

RE: pattern extraction

2004-08-16 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Fontenot, Paul wrote: > Yes I have. The following URL's are the exact data from the database. > > I can get the MS??-??? from this URL Have you printed out the $row data to insure that each row has what you expect. SO you have done something like: for(my $MyId=0;$MyId <

Re: pattern extraction

2004-08-16 Thread JupiterHost.Net
Fontenot, Paul wrote: Yes I have. The following URL's are the exact data from the database. I can get the MS??-??? from this URL http://www.microsoft.com/technet/security/bulletin/MS03-051.asp"; target="_default">Microsoft Security Bulletin MS03-051 But not from this one. My question was to see if

RE: accessing each element

2004-08-16 Thread Trooper
Mandar, You can simply de-reference the array! [code] my $list=['orange','red','purple']; foreach(@$list) { print $_."\n"; } [/code] By saying @$list, you turn an array reference into an array, for purposes of the loop. Love those references! $trooper 16-Aug-2004 18:23 PST ==

a bug of "-f" option?

2004-08-16 Thread Shu Hung (Koala)
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I recently wrote a script with a '-f' file test inside. Normally, a '-f ' returns TRUE if a file with that filename exist. My script returns TRUE for all the files -- except the largest one (9.7 GB) on my list (others are XX MB - XXX MB in size). When