File notOpening.........why?

2001-07-25 Thread Rahul Garg
Hello Everybody, One of the files is not opening.Couldnt get WHY...possibly U CAN..HELP NOTE : the same program i am running independently on telnet with command line arguments , is running perfectlybut thru browser its not working..the problem its

Re: File notOpening.........why?

2001-07-25 Thread Mel Matsuoka
At 02:09 PM 07/25/2001 +0530, Rahul Garg wrote: the same program i am running independently on telnet with command line arguments , is running perfectlybut thru browser its not working..the problem its giving is as follows .. the code goes like this : # !usr/bin/perl

Re: File notOpening.........why?

2001-07-25 Thread Mel Matsuoka
Oh and a few additional problems I caught: At 02:09 PM 07/25/2001 +0530, Rahul Garg wrote: the code goes like this : # !usr/bin/perl -w ^--- This space shouldnt be here. This alone will stop your script from running from the get-go. (Unless of course you specify the perl

sorting email data

2001-07-25 Thread Larry Mullis
I am running a form-to-email script and the data sent to the email address arrives in random order. I can't determine how the script is selecting the order in which it is sent. What do I need to do to send the data line-by-line in the order it appears on the form? Thanks, Larry M. Here is the

Date

2001-07-25 Thread Fred Sahakian
Im Stuck! I need to figure out how to covert a date such as 10242001 into Epoch time or another format where as I can subtract 2 calendar dates and get a number. thanks -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Date

2001-07-25 Thread Venkat Mohan
You can use Time::Local package. There is a function timelocal takes the seconds, minutes, hours, day, month, year and returns epoch seconds. - Venkat -Original Message- From: Fred Sahakian [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 25, 2001 9:53 AM To: Subject: Date Im Stuck!

Re: Can't display counter....

2001-07-25 Thread Baltazar Ruiz
Hi!!! does anyone know anything about this problem??? At 15 36 7/19/2001 -0500, Baltazar Ruiz wrote: Hi I'm trying to put a simple text counter with this simple script: **ScRiPtScRiPt**ScRiPt**ScRiPt**ScRiPt**ScRiPt**ScRiPt**ScRiPt**ScRiPt**ScRiPt**ScRiPt #!/usr/bin/perl print

RE: Date

2001-07-25 Thread Bradley M. Handy
Also, take a local a the Date::Calc module for the date arithmetic. Brad Handy --www.jack-of-all-trades.net [EMAIL PROTECTED] -Original Message- From: Venkat Mohan [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 25, 2001 12:58 PM To: 'Fred Sahakian'; Subject: RE: Date You can

RE: counting in CGI - any pointers?

2001-07-25 Thread Adam Mc Gregor
the file changes every night it is a list of website addresses pulled off the server followed by the site's size, ever site is on its own line followed by its size: exactly like this: johnw/ 123 adamp/ 345 pault/ 2345 miket/ 567 and so on, there are about 500 web sites.

re: e-mailing HTML form results

2001-07-25 Thread Helen Dickey
Now I am getting the error message Can't call method recipient on an undefined value at feedback1SMTP.pl line 77. Does this mean that my address as recipient is wrong? Helen -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: e-mailing HTML form results

2001-07-25 Thread Jason Purdy
I had this earlier this morning - this means the Net::SMTP object wasn't created. In my code, I redirected STDERR and created the object using Debug=1 to get more information. open (STDERR, /logs/mail_log); $msHandle = Net::SMTP-new ('localhost', Hello

e-mailing HTML form results (probably repeat question)

2001-07-25 Thread Ryan Davis/Pamela Karr
I'm trying to get email myself the results of a form, so I can moderate a list, and delete an entry if anyone puts in cuss words... I'm trying to do it with a system(\(mail [EMAIL PROTECTED] messages\)\); The page loads to this point, then quits. I put the in to run the mail program in the

RE: counting in CGI - any pointers?

2001-07-25 Thread Moon, John
Here is one way to do it if I understand what you want ... use strict; use lib Library; # where my library is ! use CGI; use CGI::Pretty; my (@sites, $site); my $total = 0; # open INFILE, /www/webs/affinityinternet.co.za/stats/webusage/libweb; my $q = new CGI; open INFILE, test.txt; while

taint mode problems

2001-07-25 Thread Bill Barrett
I really really want to keep -T in my shebang to keep my script safe, but I simply cannot get the script to work properly. I am driving myself crazy because I don't want to cop out and delete the -T. I collect about 10 pieces of data from a form, store them into variables, and then match them to

Tracking drop down box selections...

2001-07-25 Thread Daniel Falkenberg
List, I can't find much documentation on this but I really want to be able to track user selection from drop down boxes. Can some one tell me the best way to go about this? select size=1 name=time_track_minutes style=font-family: Verdana; font-size: 8pt option value=0 selected0 MIN/option

Re: Tracking drop down box selections...

2001-07-25 Thread Curtis Poe
--- Daniel Falkenberg [EMAIL PROTECTED] wrote: The above is my HTML. Therefore if the user selects 20 min I want 20 min to be passed onto the next sub in my script. Would I go about it like this... my $selection = param('time_track_minutes'); Yup. That's pretty much how you would do it.

Re: Hyperlink to act like submit button...

2001-07-25 Thread Paul Campbell
On Tue, Jul 24, 2001 at 06:07:03PM -0700, Randal L. Schwartz wrote: Paul == Paul Campbell [EMAIL PROTECTED] writes: Paul a href=helpdesk.cgi?action=test_modifyname=$unique_id That's illegal HTML. You need encoded as amp; there. Paul If I was trying to *display* the ampersand in the

File not Opening.....why?

2001-07-25 Thread Rahul Garg
Hello Everybody, One of the files is not opening.Couldnt get WHY...possibly U CAN..HELP the code goes like this : # !usr/bin/perl -w use CGI; $query =new CGI ; print Endoftext; Content-type: text/html html/html Endoftext # fine till

Re: Running Perl scripts...

2001-07-25 Thread Jeff 'japhy/Marillion' Pinyan
On Jul 25, Daniel Falkenberg said: I want to be able to check for errors on my Linux box before I run them in a browser. The problem is is tha when I do this all my HTML is dispalyed. I don't want to see this I want to be able to just check for any errors and display the errors only.

Re: Running Perl scripts...

2001-07-25 Thread Jeff 'japhy/Marillion' Pinyan
On Jul 25, Jeff 'japhy/Marillion' Pinyan said: On Jul 25, Daniel Falkenberg said: I want to be able to check for errors on my Linux box before I run them in a browser. The problem is is tha when I do this all my HTML is dispalyed. I don't want to see this I want to be able to just check for

Re: output file for download

2001-07-25 Thread Rachel Coleman
you just need to provide a link to your file. simply,a href=$myfileclick here to download my file/a and the browser,itself will automatically bring that dialog box, whenever user clicks on Click here to download my file. I would like to create the file dynamically with a cgi program and

File not Opening.....why?

2001-07-25 Thread Rahul Garg
Hello Everybody, One of the files is not opening.Couldnt get WHY...possibly U CAN..HELP NOTE : the same program i am running independently on telnet with command line arguments , is running perfectlybut thru browser its not working..the problem its

Array::compare problem

2001-07-25 Thread Diego Riaño
Hi Everybody I have an array compare problem: I have some array like this my @array1=(); my @array2=(); my @array3=(); my @array4=(); my @array5=(@array1,@array2); my @array6=(@array3,@array4); Then I use Array::compare to compare @array5 and @array6: my $comp

Array::compare problem Correction

2001-07-25 Thread Diego Riaño
Hi Everybody Sorry, I do a misstake in the previous message. This is the correct one. I have an array compare problem: I have some array like this my @array1=(); my @array2=(); my @array3=(); my @array4=(); my @array5=(@array1,@array2); my

Which perl book is the best for a newbie?

2001-07-25 Thread Super Newbie
Which Perl book is the best for a newbie? Any recommendation? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Which perl book is the best for a newbie?

2001-07-25 Thread Mel Matsuoka
At 04:41 PM 07/25/2001 +0900, Super Newbie wrote: Which Perl book is the best for a newbie? Any recommendation? Elements of Programming with Perl from Andrew Johnson. Learning Perl by Randal Schwartz. Both books rock. Aloha, mel -- mel matsuokaHawaiian Image

Perl script to create system user account

2001-07-25 Thread KK
Hello Friends - I am a new bee to this list. Just was curious if one can create system user accounts using the commands adduser from inside a perl script, which will be called from a browser or from within a java servlet? Is there any other way to create dynamic system user account by

Linux commands in perl

2001-07-25 Thread Rahul Garg
hello Everybody , Simple question.. How to run Linux commands in Perl code... Waiting for Reply Thanx in Advance... Rahul

Re: Linux commands in perl

2001-07-25 Thread KK
Hello Rahul - Just prepend and append the command with the symbol - ` - mind u, this is the back apostrophe, the first button on the keyboard from the left nad side on the second row from top. For eg. --- starts here -- #!/usr/local/bin/perl `ls -l`;

Re: Which perl book is the best for a newbie?

2001-07-25 Thread Sascha Kersken
Hi! I think the best one is Learning Perl by Randal L.Schwartz an Tom Christiansen, from O'Reilly. Sascha -- Von: Super Newbie [EMAIL PROTECTED] An: [EMAIL PROTECTED] Betreff: Which perl book is the best for a newbie? Datum: Mit, 25. Jul 2001 9:41 Uhr Which Perl book is the best

RE: Linux commands in perl

2001-07-25 Thread Sascha Kersken
Hi! Try: system command; -- Von: Rahul Garg [EMAIL PROTECTED] An: [EMAIL PROTECTED] Betreff: Linux commands in perl Datum: Mit, 25. Jul 2001 10:44 Uhr hello Everybody , Simple question.. How to run Linux commands in Perl code... Waiting for

Re: Linux commands in perl

2001-07-25 Thread Jim Conner
There are other ways as well. You can use the system() function which forks into a child process, waits for the process to complete, and returns.. system(/bin/ls); @FILES = system(/bin/ls); And you can use the exec() function. This function does not fork a child process. According to the

RE: Cleanest way to split this

2001-07-25 Thread Grant McLean
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] There's also the procedure in Mastering Regular Expressions: (lifted from The Perl Cookbook) [CODE FOLLOWS] snip [END OF CODE] The assumption is the text based fields are enclosed in quotes (like your example) As a matter of interest,

Re: Linux commands in perl

2001-07-25 Thread KK
Hello Jim/Perl Folks - Cud u kindly help me with the following: Just was curious if one can create system user accounts using the command adduser from inside a perl script, which will be called from a browser or from within a java servlet? Is there any other way to create dynamic system user

WITH SENDMAIL

2001-07-25 Thread Mohammed Maraikayar
how perlMX works with sendmail, what is the difference between perl, active perl, perlmx ? iam very curious in knowing this.i have downloaded perl from active state , but i need to configure dusethreads in perl tp work with perlmx.what is this dusethreads ? i went thro the activestate site , but

Re: Linux commands in perl

2001-07-25 Thread KK
Hello Alessandro Lenzen - I tried that. The perl script with the adduser command is getting executed if I execute it from the command prompt when I am logged in as root, but the same script script doesn't get executed from the browser. The web server error_log file doesn't show any error

Re: Linux commands in perl

2001-07-25 Thread Mel Matsuoka
At 05:13 PM 07/25/2001 +0530, KK wrote: Hello Alessandro Lenzen - I tried that. The perl script with the adduser command is getting executed if I execute it from the command prompt when I am logged in as root, but the same script script doesn't get executed from the browser. The web server

Another regex puzzle....

2001-07-25 Thread Hamish Whittal
Hello all, here I go again with another reegex problem. I have the following in a conf file: %CardType% .1.3.6.1.4.1.45.1.6.3.3.1.1.5 %CardSlotNum% =calc=CardType/3.([0-9]*).0/ Now what I'm wanting to do is get the card type (using SNMP). Then to calculate the slot

Which perl book is the best for a newbie?

2001-07-25 Thread Steve Mallett
I bought the Sam's Teach Yourself Perl in 21 seconds book...Learning Perl wasn't available at the time. Then as a companion I bought the Camel book (Programming Perl). Going through the Sams book was OK until they asked me to do an exercise whose example answer used the foreach statement

Re: Linux commands in perl

2001-07-25 Thread Mel Matsuoka
At 01:33 AM 07/25/2001, Mel Matsuoka wrote: Off the top of my head, perhaps a more secure method would be to have your CGI script serve as a wrapper to pass username/passwd data to another script (which has root or sudo root execute permissions) which is located outside the webserver/cgi root

RE: Running Perl scripts...

2001-07-25 Thread Bob Showalter
-Original Message- From: Daniel Falkenberg [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 25, 2001 1:46 AM To: [EMAIL PROTECTED] Subject: Running Perl scripts... List, I want to be able to check for errors on my Linux box before I run them in a browser. The problem is

Re: Which perl book is the best for a newbie?

2001-07-25 Thread Super Newbie
Thanks very much for everyone answered this question... : ) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Changing to new directory.

2001-07-25 Thread Yvonne Murphy
Hi all, Thanks for all your help with previous questions I've had. What I need to figure out now is how I can strip the actual directory from the following pathname that I have stored in a variable : (Just one sample of what I have but there will be different variations of the $pathname below)

Re: Changing to new directory.

2001-07-25 Thread Mooney Christophe-CMOONEY1
$pathname =~ s!/[^/]*$!!; -Original Message- From: Yvonne Murphy [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 25, 2001 8:04 AM To: [EMAIL PROTECTED] Subject: Changing to new directory. Hi all, Thanks for all your help with previous questions I've had. What I need to figure out now

file copy and create directory if necessary

2001-07-25 Thread Birgit Kellner
Hi, I am using File::Find and File::Copy to accomplish the following: check a directory tree for all files that end in *.html and copy them to a different directory, preserving the tree structure. The following code works fine provided that all subdirectories already exist. But is there a way

STDIN

2001-07-25 Thread Sparkle Williams
Is there any other way to input information through STDIN other than using $variable = STDIN ? I have a script that requires multiple values of STDIN, each one different, but the script reads each of the consecutive STDIN values as equal to the first. Help!

Re: typeglobs and references

2001-07-25 Thread Silvio Luis Leite Santana
Thank you very much for your help about Perl. There's just something I didn't get yet. When I write *PI = 5; What am I really doing? I think I was assigning (not attribing :) ) the value 5 to the scalar slot of the glob PI, since 5 is scalar, but when asking for a print $PI; all we see is a

stat() keeps returningthe incorrect date

2001-07-25 Thread Shepard, Gregory R
I am trying to create a script which gathers the stat info of every file in a given directory. Then return the date it was last modified for the purpose of picking the file that was created/modiefied last. The script is reading the files ok, however, when placing them in the stat() to exctact the

Re: Hash of arrays

2001-07-25 Thread Troy Denkinger
On Wednesday 25 July 2001 10:26, Diego Riaño wrote: I want to retrieve the name of one of the original arrays, for example retrieve: @NumericalResults to use it in another function. Hmmm, I'm not sure what you're getting at here. You've create a hash or arrays, why not just pass a

RE: stat() keeps returningthe incorrect date

2001-07-25 Thread Bob Showalter
-Original Message- From: Shepard, Gregory R [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 25, 2001 10:56 AM To: '[EMAIL PROTECTED]' Subject: stat() keeps returningthe incorrect date I am trying to create a script which gathers the stat info of every file in a given

Re: reading a text file

2001-07-25 Thread acavallari
Why don't you try this: open(STATES,state.txt)||die can't open file; while (STATES) { ($mykey, $myval) = split /\s+/, $_; $myhash{$mykey} .= $myval.', '; } close STATES; # Let's write the output foreach $loopkey (keys %myhash) { $myhash{$loopkey }=~s/,\s$//; # Remove last comma and

Recall: Re: reading a text file

2001-07-25 Thread acavallari
acavallari would like to recall the message, Re: reading a text file. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: reading a text file - correction

2001-07-25 Thread acavallari
Sorry... let me correect my previous mail. Try this: open(STATES,state.txt)||die can't open file; while (STATES) { ($myval, $mykey) = split /[:\s]+/, $_; # Corrected this line from my previous mail :-) $myhash{$mykey} .= $myval.', '; } close STATES; # Let's write the output foreach

Re: typeglobs and references

2001-07-25 Thread Paul
--- Silvio Luis Leite Santana [EMAIL PROTECTED] wrote: Thank you very much for your help about Perl. There's just something I didn't get yet. When I write *PI = 5; What am I really doing? I think you meant *PI = \5; Which is assigning the glob PI a reference to a literal

Re: typeglobs and references

2001-07-25 Thread Jeff 'japhy/Marillion' Pinyan
On Jul 25, Silvio Luis Leite Santana said: When I write *PI = 5; What am I really doing? Well, you can assign a string to a typeglob, and Perl will assume that you meant to assign a typeglob to a typeglob: *first = *1; japhy =~ /([aeiou])/; print $first\n; # prints 'a' -- Jeff japhy

Re: Another regex puzzle....

2001-07-25 Thread Jeff 'japhy/Marillion' Pinyan
On Jul 25, Hamish Whittal said: %CardType% .1.3.6.1.4.1.45.1.6.3.3.1.1.5 %CardSlotNum% =calc=CardType/3.([0-9]*).0/ if ( /^%([a-zA-Z]*)%[\s\t]*[\=calc\=([a-zA-Z]+)\/(.*)\/|(\.[0-9]*)]/ ) { I'm afraid you're trying to be a bit too specific. If you let yourself slip into

Re: typeglobs and references

2001-07-25 Thread Jeff 'japhy/Marillion' Pinyan
On Jul 25, Jeff 'japhy/Marillion' Pinyan said: On Jul 25, Silvio Luis Leite Santana said: When I write *PI = 5; What am I really doing? Well, you can assign a string to a typeglob, and Perl will assume that you meant to assign a typeglob to a typeglob: *first = *1; japhy =~ /([aeiou])/;

How can I reinstall CGI?

2001-07-25 Thread David Scott
I have a corrupted CGI module and I have been unable to re-install it. When I type 'install CGI' from the CPAN shell, it goes about its merry way installing lots of stuff then during the testing phase, it comes back with failed 16/17 tests. When I run my program I get this error: undefined

Date problem

2001-07-25 Thread F.H
Hi, does anyone know how to convert a date from mmddyy to mmdd? so 010201 becomes 01022001 Thanks for your help I.S __ Your favorite stores, helpful shopping tools and great gift ideas. Experience the convenience of buying

Re: Changing to new directory.

2001-07-25 Thread Michael Fowler
On Wed, Jul 25, 2001 at 02:03:30PM +0100, Yvonne Murphy wrote: Hi all, Thanks for all your help with previous questions I've had. What I need to figure out now is how I can strip the actual directory from the following pathname that I have stored in a variable : (Just one sample of what I

RE: reading a text file

2001-07-25 Thread Will Crain
Debbie, your problem seemed easy enough. See if this works for you: my $state; my $code; my $currCode = 0; my $outLine = ; open(STATES, state.txt) || die(can't open state:); while($line = STATES) { $line =~ /^(\w+): (\d+)/; if($code == $currCode) { $outLine .=

Re: file copy and create directory if necessary

2001-07-25 Thread Michael Fowler
On Wed, Jul 25, 2001 at 04:22:01PM +0200, Birgit Kellner wrote: Hi, I am using File::Find and File::Copy to accomplish the following: check a directory tree for all files that end in *.html and copy them to a different directory, preserving the tree structure. The following code works

Re: Date problem

2001-07-25 Thread John Fox
F., In article [EMAIL PROTECTED] (F.H), F.H wrote: does anyone know how to convert a date from mmddyy to mmdd? so 010201 becomes 01022001 Sure thing! begin demo code #!/usr/bin/perl -w # Obtain month, month day, and year values from localtime() ($mon, $mday, $year) =

RE: Date problem

2001-07-25 Thread Wagner-David
Here is a shot taking in mmddyy and giving mmdd: Code starts on next line(Lines with #Use are what is needed): #!perl -w use Time::Local;#Use my $Dates = '010201'; my @DateUse = (); while ( $Dates =~ /(\d{2}){1}/g ) { printf %-s\n,$1;

fetchrow_array problem with DBI

2001-07-25 Thread David Rankin
Hi Everybody, I have been programming with Perl for over four years, but I've never had a whole lot of reason to work with DBI or even databases very much for that matter. I'm currently working on a very simple set of scripts to read data from a couple different Postgres tables and parse the

First Script Question

2001-07-25 Thread David Freeman
Hi all, i've been receiving the list mail for a few days and read through what people seem to need to look at to help others with script problems. I included what little bit of code i have for my project below. Basically i've been going through the Perl by Example book and pulling relevant

RE: fetchrow_array problem with DBI

2001-07-25 Thread Venkat Mohan
Simple, After you prepare the sql statement you must execute the statement. See the non indented line of code below. my $dbh=DBI-connect($db, ,$username,$password) or die Couldn't connect.DBI-errstr; my $sth=$dbh-prepare('SELECT * FROM tbl_clients')

chompping periods

2001-07-25 Thread Tyler Longren
Is there a way to chomp a period? Example: this is a test. to this is a test I just need to remove the period from the end of a string. Thanks, Tyler Longren Captain Jack Communications [EMAIL PROTECTED] www.captainjack.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

RE: chompping periods

2001-07-25 Thread Mooney Christophe-CMOONEY1
If you're sure that there's always a period at the end of the string, use 'chop $str'. If you want to be safe, use '$str=~s/\.$//'. -Original Message- From: Tyler Longren [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 25, 2001 1:29 PM To: Perl Beginners Subject: chompping periods Is

RE: fetchrow_array problem with DBI

2001-07-25 Thread David Rankin
Wow, that was really simple. I guess that's what happens when you stare at something way too long. I was going off in all kinds of wrong directions. Thanks! On Wed, 25 Jul 2001 11:30:26 -0700, Venkat Mohan wrote: RE: fetchrow_array problem with DBI Simple, After you prepare the sql

Re: file copy and create directory if necessary

2001-07-25 Thread Birgit Kellner
--On Mittwoch, 25. Juli 2001 09:27 -0800 Michael Fowler [EMAIL PROTECTED] wrote: Thanks for the hint to File::Path; Just one more question to make sure: foreach $file (@files) { ### $destfile will be the copied file in subdir admin, $file the ### original file in $origdir or one

Getting values from a file

2001-07-25 Thread Bob Bondi
I'm planning on starting my perl script with a commandline argument, a filename. I open the file and parse through it line by line, OK, but I'm getting a blank on how to grab the value out of the file for a variable in the script. The file will read like: -TestClass = 3 -TestCase = all -Proxy_IP

clearing memory

2001-07-25 Thread Yacketta, Ronald
Folks, I am drawing a blank here.. I am onsite at a customers location with not perl books and perldoc is not installed :( what is the quickest, cleanest , efficient way to clear out memory used by an array and other variables in a script? We have a script that is continuously run and sleeps

RE: First Script Question

2001-07-25 Thread Bob Showalter
-Original Message- From: David Freeman [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 25, 2001 2:29 PM To: [EMAIL PROTECTED] Subject: First Script Question Hi all, i've been receiving the list mail for a few days and read through what people seem to need to look at to

Can anyone help me to solve this prob

2001-07-25 Thread mp kapa
Hi, Iam working on Interprocess communication using pipes in Windows platform. Iam trying to establish communication between two childs of the same parent process. I have written the program like this. #!/usr/bin/perl -W use IO::Handle; pipe(CHILD1_RDR, CHILD2_WTR); pipe(CHILD2_RDR,

Re: First Script Question

2001-07-25 Thread Troy Denkinger
David, On Wednesday 25 July 2001 14:29, David Freeman wrote: open(NAMES,/etc/mail/access) || die Can't open access: $!\n; while (NAMES){ ( $email, $action )= split('', $_); $newarray{$email} = $action; } close NAMES; Okay, you ask how to split on a tab. The first

RE: clearing memory

2001-07-25 Thread Bob Showalter
-Original Message- From: Yacketta, Ronald [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 25, 2001 3:07 PM To: Beginners (E-mail) Subject: clearing memory Folks, I am drawing a blank here.. I am onsite at a customers location with not perl books and perldoc is not

checking for true/false after a command has run

2001-07-25 Thread Stephanie Stiavetti
thank you all for your help with regexp... you folks are awesome. another question. I'm writing a script where I need to append a file, and I'd like it to do one thing if the command is successful, and another if it fails. how do I check to make sure it successfully appended the file? here's

Re: Getting values from a file

2001-07-25 Thread Jos I. Boumans
assuming you are alright with storing them in a hash as key value pairs, something like this will probably work for you: open I, $ARGV[0] or die $!; my %conf; while(I){ chomp; next unless $_; my ($key,$val) = split /\s*=\s*/; $conf{$key} = $val; } for (keys %conf) { print $_ = $conf{$_}\n

Re: output file for download

2001-07-25 Thread Will Crain
Tim, I believe I know what you are asking. Normally, CGI returns data in the form of text/html. This is indicated by including the line Content-type: text/html\n\n in the output of your CGI application. This instructs the receiving agent to treat all data that follows as html text. I

Cooperating with WINSOCK using Socket::

2001-07-25 Thread Dan Grossman
Hello, I'm hoping someone can help me with an INET Socket question. I have the following socket setup and subroutine to receive data from a Server: # connection protocol if ($port =~ /\D/) { $port = getservbyname($port, 'tcp') } die No port unless $port; $iaddr = inet_aton($remote)

RE: Getting values from a file

2001-07-25 Thread Mooney Christophe-CMOONEY1
That's certainly the way i would do it, but if you really want them stored in scalars instead of hashes, then you can use eval. In other words, instead of: $conf{$key} = $val you can say: eval \$$key = q/$val/ Of course if your lines all start with '-', as you posted, then you'll

Re: checking for true/false after a command has run

2001-07-25 Thread Jeff 'japhy/Marillion' Pinyan
On Jul 25, Stephanie Stiavetti said: open (REZFILE, $rezFile) or die ew! can't open $rezFile! $!\n; foreach (@allParams) { print $_\t; } print \n\n; close (REZFILE); I would check to see if the file could be closed properly. And maybe

RE: Cooperating with WINSOCK using Socket::

2001-07-25 Thread Bob Showalter
-Original Message- From: Dan Grossman [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 25, 2001 3:51 PM To: [EMAIL PROTECTED] Subject: Cooperating with WINSOCK using Socket:: Hello, I'm hoping someone can help me with an INET Socket question. I have the following socket

RE: clearing memory

2001-07-25 Thread Yacketta, Ronald
exec itself? whoa... did not think that was possible.. yeah yeah yeah newbie colors through and through -Original Message- From: Bob Showalter [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 25, 2001 15:16 To: '[EMAIL PROTECTED]' Subject: RE: clearing memory -Original

Whole Script, global symbol?

2001-07-25 Thread David Freeman
I modified the script to reflect what was suggested to me earlier, and now when i run it, i receive errors telling me i'm missing something at line 11 regarding global symbols for my variables? this is the whole script, nothing left out, if it's missing something declared i'm not familiar

Creating Variable Number of Arrays

2001-07-25 Thread saliminl
How could I create a variable number of arrays? For example, I need 20 arrays named @array1, @array2, etc. Would concatenating a string work? Neema Salimi [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Creating Variable Number of Arrays

2001-07-25 Thread Mooney Christophe-CMOONEY1
perldoc perllol # ;) -Original Message- From: saliminl [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 25, 2001 3:36 PM To: [EMAIL PROTECTED] Subject: Creating Variable Number of Arrays How could I create a variable number of arrays? For example, I need 20 arrays named @array1,

Convert date mmddyy to day of the week

2001-07-25 Thread JHuddle
I want to convert a date in the format mm/dd/yy to the day of the week. For example 07/25/01 should become Wednesday. Thanks John -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: file copy and create directory if necessary

2001-07-25 Thread Michael Fowler
On Wed, Jul 25, 2001 at 08:46:21PM +0200, Birgit Kellner wrote: --On Mittwoch, 25. Juli 2001 09:27 -0800 Michael Fowler [EMAIL PROTECTED] wrote: Assume $targetdir holds /home/somedir and $2 holds /anotherdir/yetanotherdir/; So, to check if the dir /home/somedir/anotherdir/yetanotherdir

RE: Whole Script, global symbol?

2001-07-25 Thread Bob Showalter
-Original Message- From: David Freeman [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 25, 2001 4:36 PM To: [EMAIL PROTECTED] Subject: Whole Script, global symbol? I modified the script to reflect what was suggested to me earlier, and now when i run it, i receive errors

perldoc

2001-07-25 Thread David Freeman
ok so to have global symbols i need to declare them. i can understand that. in perldoc there in no my on this system it would appear. but i read about it elsewhere. But i could not find in either place an example of the types of declarations i would need to make for these variables. use

Re: file copy and create directory if necessary

2001-07-25 Thread Birgit Kellner
--On Mittwoch, 25. Juli 2001 12:45 -0800 Michael Fowler [EMAIL PROTECTED] wrote: can't be done; the regex memory variables ($1, $2, $3, etc.) are read-only. I had already noticed that when I tried it in the meantime :-) It's really irrelevant, though; the trailing slash can be left in,

RE: perldoc

2001-07-25 Thread Bob Showalter
-Original Message- From: David Freeman [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 25, 2001 5:03 PM To: [EMAIL PROTECTED] Subject: perldoc ok so to have global symbols i need to declare them. i can understand that. in perldoc there in no my on this system it would

RE: reading a text file

2001-07-25 Thread Qiang Qiang
Maybe using a hash could make things much simpler: open (STATES, state.txt) || die (can't open state.txt); while (STATES) { if (/^(\w+)\:\s+(\d+)$/) { $states{$2} .= $1, ; } } close (STATES); foreach $code (sort keys (%states)) { chop $states{$code}; chop

RE: Convert date mmddyy to day of the week

2001-07-25 Thread Wagner-David
Here is a shot. Take the date in splitting on 2 digits and / if there Print number of items in array Setup a Days array Use timelocal at noon to get total seconds Run seconds thru localtime (array defs are commented print out the date in

Re: Whole Script, global symbol?

2001-07-25 Thread Mel Matsuoka
At 01:35 PM 07/25/2001 -0700, David Freeman wrote: I modified the script to reflect what was suggested to me earlier, and now when i run it, i receive errors telling me i'm missing something at line 11 regarding global symbols for my variables? #!/usr/bin/perl -w #Script to add e-mail

RE: perldoc

2001-07-25 Thread David Freeman
ok, now i think i see. so a fully declared variable looks just like my $email; just linked the perldoc. =) At 05:09 PM 7/25/01 -0400, you wrote: -Original Message- From: David Freeman [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 25, 2001 5:03 PM To: [EMAIL PROTECTED]

USPS has me stumped!

2001-07-25 Thread Luke Bakken
Hi all, I'm tinkering with some of the libwww modules and trying to get some information from the USPS web site. Here's a simple script to get a zip+4 address: use HTTP::Request::Common qw(POST); use LWP::UserAgent; $ua = LWP::UserAgent-new; my $req = POST

Re: clearing memory

2001-07-25 Thread Michael Fowler
On Wed, Jul 25, 2001 at 03:07:16PM -0400, Yacketta, Ronald wrote: We have a script that is continuously run and sleeps every 30 seconds b4 grabbing data and populating arrays. Is it possible to make a clean() that will wipe the slate clean at the end or beginning of the next run? There is the

  1   2   >