Re: Variable scoping, static variable

2003-03-28 Thread R. Joseph Newton
"Shishir K. Singh" wrote: > Try using it like this > > - Hi Shishir, There is just one problem here, as demonstrated below, with the addition of a "brick-tosser" function. use strict; my $cache = {}; &test("hello0",$cache); # Note: better written as tes

Re: running a script thru a webpage

2003-03-28 Thread Ramprasad
Christopher M Burger wrote: Hello everyone. I have written a perl program that will take a tar file and untar it then move file from the untarred direcories to it's directory on the webserver. However, when I run the program thru a webpage it does not untar the file. If I run the program localy i

Re: Net::Ping Cannot redirect output !

2003-03-28 Thread Ramprasad
Rob Dixon wrote: Ramprasad wrote: I have written a simple script that runs file when I run on command line but fails when I redirect its output I cant beleive this , it seems so impossible can anyone help me $!=1; Should be $| = 1 for autoflush. Or, more neatly: use IO::Handle; autoflu

Re: redirection to various html files based on IP list

2003-03-28 Thread R. Joseph Newton
Martin Hudec wrote: > Hello, > > I need to make script which will go through file with IP addresses (one IP per > line), and then compare each line to $ENV{'REMOTE_ADDR'}, and if it is equal > then it will load first html to browser, otherwise it will load second html. > Can anyone help me with th

RE: How to pull all attachments from an email and save as unique ids?

2003-03-28 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Wagner, David --- Senior Programmer Analyst --- WGO wrote: > David Olbersen wrote: >> David, >> >> Take a look at perlmonks.org, somebody wrote a script that does >> something very similar to what you're looking for. >> >> Specifically, http://www.perlmonks.com/index.pl?node_id=12287 has a >> goo

Re: howto: open/create a file as executable

2003-03-28 Thread John W. Krahn
Ken Lehman wrote: > > Is it possible to open/create a file with open that does not exist and give > it a umask that makes it executable, say for the purpose of generating shell > scripts? Yes. > For example, say > > open OUT_FILE, MAGIC_UMASK, "/scripts/new_script"; > > where the current umask

running a script thru a webpage

2003-03-28 Thread Christopher M Burger
Hello everyone. I have written a perl program that will take a tar file and untar it then move file from the untarred direcories to it's directory on the webserver. However, when I run the program thru a webpage it does not untar the file. If I run the program localy it works fine. I have even r

Newbie Help Needed! Mail Problem!

2003-03-28 Thread Palm Optins
Hello All. I have a admin script for a protected members area. In it, I can email all the members to let them know the Updates of the program. For some unknown reason, it keeps sending out double emails for each address. Can someone tell me what I did wrong? Here's the code I used for the mailer

Re: Variable scoping, static variable

2003-03-28 Thread John W. Krahn
Rob Anderson wrote: > > I'm trying cache a function to help speed it up. Have a look at the Memoize module at CPAN. John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: $from_address

2003-03-28 Thread John W. Krahn
Robbie Staufer wrote: > > Hi, Hello, > I have a perl script that takes in form data and generates and email > with the data to be sent to me. I'm getting the error message > Error:Bad or missing From address: '$from_address'. The webmaster says > I'm using the correct from address, so, any id

howto: open/create a file as executable

2003-03-28 Thread Ken Lehman
Is it possible to open/create a file with open that does not exist and give it a umask that makes it executable, say for the purpose of generating shell scripts? For example, say open OUT_FILE, MAGIC_UMASK, "/scripts/new_script"; where the current umask is 2. Is the only option to chmod the file

db query help! -> part 2

2003-03-28 Thread Jasmine
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi thanks .. for telling me tht DBI dont accept $! erm i still have problems though. Theres actually data in the this table made up of 2 columns. But, apparently my query keep returning "0" and "new" which I cant understand why. #!/usr/bin/perl -w

RE: grab input from a stdout

2003-03-28 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Leon wrote: > Hi again, > > I have a questions regarding stdout. > > Basically I have a script that looks like this: > > system("reg DELETE HKCR\\AppID\\OvEpSeMain.EXE /f") && die "no $!"; > system("reg DELETE HKCR\\AppID\\OvEpSeMain.EXE /f") && die "no $!"; > system("reg DELETE HKCR\\AppID\\OvE

RE: How to pull all attachments from an email and save as unique ids?

2003-03-28 Thread Wagner, David --- Senior Programmer Analyst --- WGO
David Olbersen wrote: > David, > > Take a look at perlmonks.org, somebody wrote a script that does > something very similar to what you're looking for. > > Specifically, http://www.perlmonks.com/index.pl?node_id=12287 has a > good starting point! > > It uses the MIME tools if memory serves me.

grab input from a stdout

2003-03-28 Thread Leon
Hi again, I have a questions regarding stdout. Basically I have a script that looks like this: system("reg DELETE HKCR\\AppID\\OvEpSeMain.EXE /f") && die "no $!"; system("reg DELETE HKCR\\AppID\\OvEpSeMain.EXE /f") && die "no $!"; system("reg DELETE HKCR\\AppID\\OvEpSeMServer.EXE /f") && die "n

RE: db query help!

2003-03-28 Thread Bob Showalter
Jasmine wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Hi perl gurus, > > I m afraid I need some help here urgently. Could anyone see whats > wrong with the way I query the database? Whats > DBI::st=HASH(0x8240a10) ? Any help is appreciated Thanks! DBI::st=HASH(0x8240a10) is the wa

RE: How to pull all attachments from an email and save as unique ids?

2003-03-28 Thread David Olbersen
David, Take a look at perlmonks.org, somebody wrote a script that does something very similar to what you're looking for. Specifically, http://www.perlmonks.com/index.pl?node_id=12287 has a good starting point! It uses the MIME tools if memory serves me... -- David Olb

db query help!

2003-03-28 Thread Jasmine
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi perl gurus, I m afraid I need some help here urgently. Could anyone see whats wrong with the way I query the database? Whats DBI::st=HASH(0x8240a10) ? Any help is appreciated Thanks! the $query variable returns -->> DBI::st=HASH(0x8240a10) $res

Re: Enumerating available modules

2003-03-28 Thread Janek Schleicher
Steve Gilbert wrote at Fri, 28 Mar 2003 09:28:17 -0800: > Does anyone know of a way to enumerate all the > available modules on a system? Have a look to the CPAN module ExtUtils::Installed Greetings, Janek -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PR

RE: cobol -> perl ??

2003-03-28 Thread Jeff Westman
David, Thanks, I was just now finding out the same thing (architecture is 2 bytes for PIC S9(1) through PIC S9(5). Much thanks! -Jeff --- "Wagner, David --- Senior Programmer Analyst --- WGO" <[EMAIL PROTECTED]> wrote: > Jeff Westman wrote: > > Hi, > > > > I've got some files, that were writt

How to pull all attachments from an email and save as unique ids?

2003-03-28 Thread Wagner, David --- Senior Programmer Analyst --- WGO
I have one email which has 100 attachments (mail ids) which are not unique and when I save attachments via Outlook and it comes back repeatedly saying that this file already exists, do you want to replace. I am not even sure where to start, just know that Perl will have a way to

RE: cobol -> perl ??

2003-03-28 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Jeff Westman wrote: > Hi, > > I've got some files, that were written with a COBOL program, so I > have fields that have been created with COMP (binary) "picture" > clauses. The problem is now I need to read this file into a perl > program. Here's what I have: > > 05 RECORD-TYPE

RE: newbie module question

2003-03-28 Thread Hanson, Rob
Tricky question... Try using PPM first, it is a utility that comes with ActiveState Perl. It installs from the ActiveState module repository. >From the command line... C:\>ppm Once in PPM you can search and install... search Foo install Foo::Bar help ...But not all modules are available th

cobol -> perl ??

2003-03-28 Thread Jeff Westman
Hi, I've got some files, that were written with a COBOL program, so I have fields that have been created with COMP (binary) "picture" clauses. The problem is now I need to read this file into a perl program. Here's what I have: 05 RECORD-TYPEPIC X. 05 LOC-ID

Re: $from_address

2003-03-28 Thread Kevin Meltzer
$from _address will not interpolate in single quotes. No quotes needed around $from_address, $to_address or $subject. Cheers, Kevin On Fri, Mar 28, 2003 at 12:12:44PM -0700, Robbie Staufer ([EMAIL PROTECTED]) said something similar to: > Hi, > > I have a perl script that takes in form data and

newbie module question

2003-03-28 Thread Leon
Hi everyone, I am really really new to perl. I know this is dumb but I am using perl in the win 32 environement (perl 5.8.0 build 804) from active state. I am trying to figure out how to install modules. Where do you get them from? How do you install them? Other things I need to know? T

Re: $from_address

2003-03-28 Thread Rob Dixon
Robbie Staufer wrote: > Here's what I have: > > $from_address = "[EMAIL PROTECTED]"; > $to_address = "[EMAIL PROTECTED]"; > $subject = "ESMF Registration Form"; I should have pointed out that here single quotes are just what you want, to stop it expanding arrays @sweb and @scd. That way you wouldn

Re: $from_address

2003-03-28 Thread Rob Dixon
Robbie Staufer wrote: > Hi, > > I have a perl script that takes in form data and generates and email > with the data to be sent to me. I'm getting the error message > Error:Bad or missing From address: '$from_address'. The webmaster says > I'm using the correct from address, so, any ideas about

Re: $from_address

2003-03-28 Thread Pete Emerson
You need to leave off the single quotes around $from_address, $to_address, and $subject. %mail = ( SMTP=> 'finster.scd.ucar.edu', from=> $from_address, to => $to_address, subject => $subject, ); Mar 28, 2003 at 12:12pm from Robbie Staufer:

RE: $from_address

2003-03-28 Thread Bakken, Luke
> $from_address = "[EMAIL PROTECTED]"; > $to_address = "[EMAIL PROTECTED]"; > $subject = "ESMF Registration Form"; > > %mail = ( > SMTP=> 'finster.scd.ucar.edu', > from=> '$from_address', > to => '$to_address', > subject => '$subject', > ); > >

Worm

2003-03-28 Thread Rob Dixon
Guys. Watch out for a mail with 'Microsoft Mail Service' as a subject. It has an executable attachment which I'm sure isn't benign. /R -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

$from_address

2003-03-28 Thread Robbie Staufer
Hi, I have a perl script that takes in form data and generates and email with the data to be sent to me. I'm getting the error message Error:Bad or missing From address: '$from_address'. The webmaster says I'm using the correct from address, so, any ideas about this error message? Thanks.

Re: Net::Ping Cannot redirect output !

2003-03-28 Thread Rob Dixon
Ramprasad wrote: > I have written a simple script that runs file when I run on command line > but fails when I redirect its output > > I cant beleive this , it seems so impossible can anyone help me > > $!=1; Should be $| = 1 for autoflush. Or, more neatly: use IO::Handle; autoflush STDOU

Re: Enumerating available modules

2003-03-28 Thread Rob Dixon
Frank Wiles wrote: > .--[ Steve Gilbert wrote (2003/03/28 at 09:28:17) ]-- > > > > Does anyone know of a way to enumerate all the > > available modules on a system? > > I'm not sure why you'd want to do it, but does it. > > #!/usr/bin/perl > > use File::Find; > my $coun

Re: Variable scoping, static variable

2003-03-28 Thread Rob Dixon
Rob Anderson wrote: > Thanks but I don't see how this could work. I've tried using it, but to no > avail Hi Rob I can't think what could be wrong if you've copied Janek's code. I've written a simple subroutine with a persistent hash which simply counts the different strings it's called with and d

RE: :Ping Cannot redirect output !

2003-03-28 Thread Bakken, Luke
> $!=1; $! contains error text, if I remember correctly off the top of my head. Use $| = 1 instead for autoflush. This shouldn't cause redirect problems, tho. > use Net::Ping; > @host_array = ; > $p = Net::Ping->new("icmp"); > $p->bind("192.168.2.211"); # Specify source interface of pings > fore

Re: Enumerating available modules

2003-03-28 Thread Frank Wiles
.--[ Steve Gilbert wrote (2003/03/28 at 09:28:17) ]-- | | Does anyone know of a way to enumerate all the | available modules on a system? | `- I'm not sure why you'd want to do it, but does it. #!/usr/bin/perl use F

Enumerating available modules

2003-03-28 Thread Steve Gilbert
Does anyone know of a way to enumerate all the available modules on a system? TIA Steve __ Do you Yahoo!? Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop! http://platinum.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED]

Re: strange chacaters

2003-03-28 Thread Mike Blezien
My mistake, I got the wrong information. >> Dan Muey wrote: Are you serious? How in the world can we help if there's no context at all? What does this have to do with perl? I would assume '2 dimensional' and '3 dimensional' since it looks like graphic stuff but, again, see above and this link

strange chacaters

2003-03-28 Thread Mike Blezien
I came accross some characters, while process various files that contain characters like this: Animations/2D/Animals Camers/3D/videos what exactly are the '2D' and '3D' designate... an extra space of some sort ?? TIA ;) -- MikeBlezien =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Thunder Rain In

RE: strange chacaters

2003-03-28 Thread Dan Muey
Are you serious? How in the world can we help if there's no context at all? What does this have to do with perl? I would assume '2 dimensional' and '3 dimensional' since it looks like graphic stuff but, again, see above and this link :: http://www.catb.org/~esr/faqs/smart-questions.html > I

RE: Variable scoping, static variable

2003-03-28 Thread Shishir K. Singh
Try using it like this - use strict; my $cache = {}; &test("hello0",$cache); &test("hello1",$cache); &test("hello0",$cache); &test("hello3",$cache); sub test { my $param = shift; my $cache = shift; my $cache_key = "param=$param"; if (

Re: Variable scoping, static variable

2003-03-28 Thread Rob Anderson
Thanks but I don't see how this could work. I've tried using it, but to no avail "Janek Schleicher" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Rob Anderson wrote at Fri, 28 Mar 2003 14:45:07 +: > > > -- module sub routine > > > > sub test { > > my $param =

Net::Ping Cannot redirect output !

2003-03-28 Thread Ramprasad
I have written a simple script that runs file when I run on command line but fails when I redirect its output I cant beleive this , it seems so impossible can anyone help me $!=1; use Net::Ping; @host_array = ; $p = Net::Ping->new("icmp"); $p->bind("192.168.2.211"); # Specify source interface of p

Re: Variable scoping, static variable

2003-03-28 Thread Janek Schleicher
Rob Anderson wrote at Fri, 28 Mar 2003 14:45:07 +: > -- module sub routine > > sub test { > my $param = shift; > my $cache_key = "param=$param"; > if (exists $cache{$cache_key}) { > return $cache{$cache_key}; > } > sleep 1; > $cache{$cache_key} = $

Variable scoping, static variable

2003-03-28 Thread Rob Anderson
I'm trying cache a function to help speed it up. My function lives inside a module, and is being called from a seperate script. It works if I do the following. foreach my $count (1..10) { print "$count" . test("one") . "\n"; } print "\n"; -- module sub routine sub test { my

writing in UTF8

2003-03-28 Thread Laurent_Coudeur
Hi all, I have to print a report in UTF8 Is there any options to format the file to UTF8 while creationg it then print into it safely? like open (XLIFF,">$path1\\$_"); print XLIFF "$header$header2$filename "; is there a module to do this or am i lost in limbo and missed the doc? Laurent coud

RE: CGI:Push

2003-03-28 Thread wiggins
On Thu, 27 Mar 2003 15:00:39 -0800, "David Cheng" <[EMAIL PROTECTED]> wrote: > Hi all, > > 1. Is Server Push feature only supported by Netscape but not by IE? If yes, is there > anyway we can do similar tricks with IE? I know I can achieve the sa

redirection to various html files based on IP list

2003-03-28 Thread Martin Hudec
Hello, I need to make script which will go through file with IP addresses (one IP per line), and then compare each line to $ENV{'REMOTE_ADDR'}, and if it is equal then it will load first html to browser, otherwise it will load second html. Can anyone help me with this please? -- Martin Hudec

Re: Synchronization of FTP servers

2003-03-28 Thread Jenda Krynicky
From: Aman Thind <[EMAIL PROTECTED]> > This is a typical situation in companies with development teams spread > around the globe. > > I have FTP servers - in India , US & Switzerland. > > Builds are being made in India and being put on the Indian server. > > Any tips how I could transfer the con

Re: String removal

2003-03-28 Thread Aim
Hi, A very helpful member of this list assisted me in coming up with the following: substr ($fastaseq{$key}, rand (length $fastaseq{$key}), 3) = ""; This bit of code removes a single character, randomly, but not from the very first 3. it does the removing from the values of %fastaseq. I hope it

Re: perl DBI and mysql

2003-03-28 Thread jaws
Thanks Ill try that. At 09:26 AM 3/28/2003 +, Rob Anderson wrote: Jaws, This looks like your script is working fine, but the insert your trying to do is in error. I'd guess that your just trying to add a row with a duplicate key, and that's what DBI is complaining about, because of a contrain

Re: perl DBI and mysql

2003-03-28 Thread Rob Anderson
Jaws, This looks like your script is working fine, but the insert your trying to do is in error. I'd guess that your just trying to add a row with a duplicate key, and that's what DBI is complaining about, because of a contraint on the database. You could try different keys, or the INSERT statemen

Re: perl DBI and mysql

2003-03-28 Thread jaws
What will I do to get my script working properly? Thanks for your help. At 04:17 AM 3/28/2003 -0500, Dave K wrote: Jaws, > DBD::mysql::st execute failed: Duplicate entry 'sample' for key 1 at > ./addvpdnuser.pl line 17, <> line 1. > DBD::mysql::st execute failed: Duplicate entry 'sample' for key

Re: perl DBI and mysql

2003-03-28 Thread Dave K
Jaws, > DBD::mysql::st execute failed: Duplicate entry 'sample' for key 1 at > ./addvpdnuser.pl line 17, <> line 1. > DBD::mysql::st execute failed: Duplicate entry 'sample' for key 1 at > ./addvpdnuser.pl line 17, <> line 1. > [EMAIL PROTECTED] util]# This is probably happening because the table

Re: perl DBI and mysql

2003-03-28 Thread jaws
when i run the program like this: [EMAIL PROTECTED] util]# ./addvpdnuser.pl sampleusername, samplepassword,sampledescription,sampleattr DBD::mysql::st execute failed: Duplicate entry 'sample' for key 1 at ./addvpdnuser.pl line 17, <> line 1. DBD::mysql::st execute failed: Duplicate entry 'sample'

Re: perl DBI and mysql

2003-03-28 Thread Rob Anderson
Hi Jaws (!?), You don't say where your script is failing, or what errors it's reporting, which is going to make it hard for anyone to help. You could add some better error checking. Here's a couple of lines lifted from one of my CGI's. my $dbh; eval { $dbh = DBI->connect( $DATA_SOURCE, $DB_USER,

Re: INFO PLEASE

2003-03-28 Thread Scott R. Godin
Eric Walker wrote: > how can I see where modules are installed no matter if they are personal > or come with perl also how can I tell what functions are available for > them. Thanks There's my ModuleReport script -- http://www.webdragon.net/mr/ There's still a few things I'd like to do with it,

CGI:Push

2003-03-28 Thread David Cheng
Hi all, 1. Is Server Push feature only supported by Netscape but not by IE? If yes, is there anyway we can do similar tricks with IE? I know I can achieve the same goal by using Client Pull, HTML refresh tag, but the flashing screen is kind of annoying. 2. I ran a couple of CGI scripts through