Re: Where are the archives?

2001-10-04 Thread jeffl

http://archive.develooper.com/beginners%40perl.org/

you know it took me awhile to find them as well.

jeffl

On 2001.10.04 11:27 "Mason, Andrew" wrote:
> Where are the archives?
> 
> Sorry to ask such a dumb question but I don't know and it might save me
> posting others.
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: encrypt, decrypt module suggestions

2001-10-03 Thread jeffl

Rex, Elaine thanks. I read you're suggestion Elaine, informative, 
thanks. Rex, thanks I think I'll try the Crypt::RC4 module.

jeffl
On 2001.10.03 20:49 Rex Arul wrote:
> Use Crypt::RC4 module, to encrypt and decrypt values. It uses the RC4
> Symmetric encryption which is fairly robust. It depends on a symmetric
> key
> which you will use for encryption as well as decryption.  You can
> download
> the latest Crypt::RC4 module through PPM. (Activestate Perl).
> 
> http://aspn.activestate.com/ASPN/Downloads/ActivePerl/PPM/Packages
> 
> 
> 
> - Original Message -
> From: "Jeff Loetel" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, October 03, 2001 7:38 PM
> Subject: encrypt, decrypt module suggestions
> 
> 
> > I'm looking for a module where I can encrypt and decrypt
> > values. Obviously, the more secure the better. Most of
> > everything that I have seen is in the way of one way
> > hash digests. The main thing is I  have to be able to
> > get the values back out.
> >
> > Suggestions appreciated.
> >
> > jeffl
> >
> >
> > --
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> 
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Date comparing and difference?

2001-09-26 Thread Jeffl

John,
Try Date::Simple very  simple interface for calculations between two
dates.

 use Date::Simple ('date', 'today');

# Difference in days between two dates:
$diff = date('2001-08-27') - date('1977-10-05');

Jeffl
On 2001.09.26 12:55 John Grimes wrote:
> OK, this may seem rather simple, but I can't for the life of me find an
> answer...
>  
> Let's say I've got two dates.  The current date, and a date in the past.
> What's the scripting module that I'm going to need to compute the
> difference
> between the two dates?  I've gone to perl.com, but nothing seems quite
> exactly what I'm looking for...
>  
> (If it's any help, the dates are in MM/DD/YYY format...)
>  
> Thanks ahead of time for the patience with a total newbie, and any help
> or
> direction you can point me in...
>  
> John
>  
> 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: URL redirect and row-count

2001-09-07 Thread Jeffl

Howdy,

redirect assuming use CGI;

print q->redirect( "http://www.somewhere.org"; );

or not,

print "Location: http://www.the_other_place.org\n\n";;

counting the number of rows

select COUNT(some_column) FROM some_table WHERE some_clause;

or

SELECT COUNT DISTINCT(some_column) FROM some_table WHERE some_clause;

The above statements will return a # 

Hope that helps

jeffl

does anyone else ever find themself using esc shit : wq! for just about
everything? Sorry, I've been ear deep in code all day long..



On 2001.09.07 17:29 Imtiaz ahmad wrote:
> Hi-
> 
> Can somebody help me with a function that redirects a user's browser to a
> different site.
> I like to be able to do it using some PERL function.
> 
> Also, is there a function in PERL that tells you how many rows are
> returned
> by a select statement.
> e.g. If I have following select then what do I need to do find the total
> rows that resulted from the query:
> 
> Don't want to use any counter for the LOOP.
> 
> -
> ###Select statement to pull all the advertisers
> my $check_login="SELECT users.fullname, security.secname
> FROMusers, security
> WHERE   users.login = '$user_name'
> AND users.phone = '$password'
> AND users.secureid = security.secureid";
> 
> $dataObject = $dbh->prepare($check_login);
> $dataObject->execute();
> 
> 
> while(($fullname, $secname)=$dataObject->fetchrow_array())
> { #start of WHILE loop
> print " 
> $fullname 
> $secname
> 
> ";
> }#close WHILE loop
> 
> -
> 
> thanks.
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: foreach and the ordering of array's

2001-09-07 Thread Jeffl

You are correct it was probably a bad choice of wording to use "retreive",
iteration is what is actually occuring. When it comes down to it, I think
I just confused myself on the issue, I was thinking to much on how foreach
iterates over a hash. I should have just ran a test before hand to 
check...my bad. I was just having a brain fart.

thanks for you're comments,
Jeffl

EOF


On 2001.09.07 12:23 Bob Showalter wrote:
> > -Original Message-
> > From: Jeffl [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, September 07, 2001 11:47 AM
> > To: Bob Showalter
> > Cc: 'beginners @ perl . org'
> > Subject: RE: foreach and the ordering of array's
> > 
> > 
> > when you run a foreach on a hash you have no idea what order 
> > you will get
> > the keys unless
> > you sort it, then you can only get it in the order defined by 
> > sort. If you
> > use Tie::IxHash
> > on a hash you can print out the has in the order it was constructed.
> > 
> > Basically, I couldn't remeber what the Camel said about foreach and
> > accessing an array.
> > I went back and found this, which ties into what I had 
> > thought...(quote
> > from the camel v.3
> > pg.118) "There is no way with foreach to tell where you are 
> > in a list. You
> > may compare adjacent elements by remembering the perevious one in a
> > variable, but sometimes you just have to break down and write 
> > a three-part
> > for loop with subscripts."
> > 
> > So basically, what I get out of this, is that you don't know 
> > the order that
> > foreach will retrieve the elements of the '@'. Now I could be mistaken
> > here, and am not seeing the forest for the trees, and I 
> > should have just
> > run a test to find out for myself.I'm off to go build an 
> > @ and find out
> > the order it parses through in a foreach, which I should have 
> > done in the
> > first place..doh.It was late..cut me some slack.
> 
> Some confusion in the terminology here.
> 
> for/foreach does not "retrieve" anything. It iterates over a list.
> It will iterate over that list in the exact order the list elements
> are supplied to for/foreach. Guaranteed.
> 
> One way to supply a list to for/foreach is to use the keys() function
> to retrieve a list of the keys in a hash. keys() does not return the
> key values in any particular order, due to the internal representation
> of a hash.
> 
> But you want to supply an array to for/foreach. In that case, the
> elements of the array are supplied in the array index sequence, which is
> what you are looking for. This holds for any list context where an array
> is used, not just for/foreach (e.g. print(), join(), map(), etc.)
> 
> (Inside the body of a for/foreach loop, you cannot determine the
> subscript
> of the current array element you are processing. This is obvious, because
> there is nothing that says the list supplied to for/foreach came from a
> single array in the first place. But that doesn't mean that the loop does
> not interate over the list in a guaranteed sequence.)
> 
> I'm sure others can explain this better than I can. But you are on the 
> right track to construct a test to confirm the behavior.
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: foreach and the ordering of array's

2001-09-07 Thread Jeffl

when you run a foreach on a hash you have no idea what order you will get
the keys unless
you sort it, then you can only get it in the order defined by sort. If you
use Tie::IxHash
on a hash you can print out the has in the order it was constructed.

Basically, I couldn't remeber what the Camel said about foreach and
accessing an array.
I went back and found this, which ties into what I had thought...(quote
from the camel v.3
pg.118) "There is no way with foreach to tell where you are in a list. You
may compare adjacent elements by remembering the perevious one in a
variable, but sometimes you just have to break down and write a three-part
for loop with subscripts."

So basically, what I get out of this, is that you don't know the order that
foreach will retrieve the elements of the '@'. Now I could be mistaken
here, and am not seeing the forest for the trees, and I should have just
run a test to find out for myself.I'm off to go build an @ and find out
the order it parses through in a foreach, which I should have done in the
first place..doh.It was late..cut me some slack.

jeffl

On 2001.09.07 10:18 Bob Showalter wrote:
> > -Original Message-
> > From: Jeffrey Loetel [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, September 07, 2001 1:57 AM
> > To: [EMAIL PROTECTED]
> > Subject: foreach and the ordering of array's
> > 
> > 
> > Question:
> > When you extract a value from an @ are you guarenteed the order that 
> > you are going to get?
> 
> Yes. Why do you suspect that you may not?
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: cgi not writing to flat file

2001-08-28 Thread Jeffl

I'm in the middle of coding myself so I'll be brief, help you get some
direction.

First, I wouldn't set you're permissions to 777, BUT that all depends on
what
the user is that would be writing to the file. What I mean is, the web
server
is the one that is going to be writing to the file so, and you may have
created
it so the permissions would look like

rw-rw-r-- danny web survey.out (664 or 660-> if you're parnoid)

or if the web server creates it,

rw-r--r-- webuser web survey.out (644 or 640 -> if you're parnoid)

This assumes that the group that the web server runs under is 'web' and the
web server user is 'webuser'. 

Cool?

Next, you have to make sure that the web server can write to that
directory.

if the directory is:

rwxrwxr-x danny web .

This will work so will,
rwxrwxr-x webuser web .

Check to see if the user or the group has the ability to write to that
directory.

Remember, you want you're permissions as strict as possible, and still
allow you
to do what YOU need to.

using the >> has the ability to create a file, so that should work.

One thing though, I personally wouldn't write to the directory where I
store my 
scripts. If you are writing to a directory it should be out of the document
root.

I've seen people do this and it can be a nightmare to maintain not to
mention a
security hole. Store you're data out of the doc root.

oh, and try.

$file = "/somedir_out_of_doc_root/survey.out";
open(OUTF, ">> $file") or die "Couldn't open $file for INPUT: $!\n";

hope that gets you going.

Jeff 
On 2001.08.28 22:11 Danny Reyna wrote:
> ive downloaded 
> a simple perl script that im trying to run
> on my computer
> -i use the updated version of indigo perl on win98
> -listed below are the html and scripts
> -can someone tell me where i am going wrong
> -someone on the list told me that i dont have my 
>  permissions set to chmod 777, however from what 
>  ive read that when using win98 you dont have to set
>  a folder to permission  :  but if im wrong how do 
>  i set permissions using   win98/apache webserver
> 
> note: if i add line 
> open(OUTF,">>/cgi-bin/survey.out")  then no
> "survey.out" file is created (i just get the "Couldn't
> open  for writing!" as the perl error msg  
> 
> if i leave the /cgi-bin/ out of the script then i get
> a netscape error msg that says "document contains no
> info - try again later" then a file called survey.out
> is created in my cgi-bin however, no data is written
> in it
> 
> your help in the matter is appreciated
> thanks
> Danny
> 
> 
>  
> 
> __
> Do You Yahoo!?
> Make international calls for as low as $.04/minute with Yahoo! Messenger
> http://phonecard.yahoo.com/
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Check to see if process exists

2001-08-21 Thread Jeffl

Hey Hans,
Go check out a program written by  Evan Borgstrom, it is a program written
in perl that will check to see if a program is up, and email you the
status.. It runs as a cron job. Also you can add additional services quite
easily.


Author: Evan Borgstrom
Email : syntec at unixpimps.org
WWW   : http://www.unixpimps.org/safetynet

the name of the program is safetynet. Quite a nifty little piece-o-work..


On 2001.08.21 16:04 "Baartmans, Hans" wrote:
> Is there good way to execute a UNIX 'ps' command from Perl and check to
> see
> if a process is running or exists?  For instance, I would like to check
> to
> see if Sendmail is running.  Under a UNIX shell command you can execute,
> '/usr/bin/ps -ef | grep sendmail'.
> 
> Is there an easy way to do this in Perl?
> 
> Thanks in advance!!!
> 
> Hans
> 
> 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Graphs in perl ....

2001-08-08 Thread jeffl

Try the GD module, its a Stein!!!

jeff

On Wed, 8 Aug 2001, Elie De Brauwer wrote:

> Date: Wed, 8 Aug 2001 20:16:07 +0200
> From: Elie De Brauwer <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: Graphs in perl 
> 
> I'm looking for a modules that can create graphs, i want a nice picture that 
> says you loads are today here, yesterday there the day before there  so i 
> can see any evolutions, the same for diskspace and stuff. So what i want to 
> know is there a module / docs about this ? And how can i search these modules 
> by myself so  i don't need to bother this list each time i need a module ;))
> greetings
> Elie De Brauwer 
> -- 
> <==>
>  real men do it in perl ;)
> 
>  De Brauwer Elie 
>[EMAIL PROTECTED]
> <==>
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: adding an element to an array in a hash of arrays...

2001-08-01 Thread jeffl

push @{ $HoA{key} }, "new value", "some other value";

On Thu, 2 Aug 2001, Jim Conner wrote:

> Date: Thu, 02 Aug 2001 01:21:38 -0400
> From: Jim Conner <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: adding an element to an array in a hash of arrays...
> 
> How can I do this? :)
> 
> 
> 
> 
> 
> - Jim
> 
> -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
> http://www.perlmonks.org/index.pl?node_id=67861&lastnode_id=67861
> 
> -BEGIN PERL GEEK CODE BLOCK-  --BEGIN GEEK CODE BLOCK--
> Version: 0.01 Version: 3.12
> P++>*@$c?P6?R+++>@$M  GIT/CM/J d++(--) s++:++ a-
>  >$O!MA->E!> PU-->+++BDC(+) UB$L$S$
> $C-@D!>(-)$S@$X?WP+>MO!>+++   P++(+)>+ L+++()>+$ !E*
> +PP+++>n-CO?PO!o >G   W++(+++) N+ o !K w--- PS---(-)@ PE
>  >*(!)$A-->@$Ee---(-)Ev++uL++>*@$uB+   Y+>+++ PGP t+(+++)>+++@ 5- X++ R@
>  >*@$uS+>*@$uH+uo+w-@$m!   tv+ b? DI-(+++) D+++(++) G()
> --END PERL GEEK CODE BLOCK--  --END GEEK CODE BLOCK--
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




General module question, can't get anything imported.

2001-08-01 Thread jeffl

I tried building my own module but I can't get the calling script to see
the variables being imported.

# below is the module
---
#!/usr/bin/perl

package Foo;
require Exporter;

our @ISA = qw(Exporter);
our @EXPORT  = qw($foo_var);
our $VERSION = 1.00;

$foo_var = "foo_value";

1;

# below is the script
---
!/usr/bin/perl

use Foo;

print "$foo_var\n";

exit;

below is the output
#-----
jeffl>./test.pl 

jeffl>

#-
I've checked the permissions rw-r--r--
I've checked my @INC, its in its path. I moved it out to test and it
freaked out about not finding Foo in my path. I moved it back in and it
was cool. So it can find it. It's like its not exporting squat.

It just doesn't want to pull in anything.
it seems as though there is something basic that I am not getting.



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]