[Q]Validating forms?!

2002-02-21 Thread Bhanu Prakash
Bhanu Prakash wrote: HI All, Is there a way to Validate the fields of a form? Say I have a text field, and I should show an error to the user if he does not enter anything while submitting the form? Can somebody give me some sample script?! with some high level explaination? Thanks

Re: selecting a text file for HTML output

2002-02-21 Thread Sir Douglas Cook
The text file that I want to insert is dougs.txt = Which has two sentences = Hey it works... Happy Belated Birthday... == The Code dougs1.cgi = #!/usr/bin/perl print

Re: selecting a text file for HTML output

2002-02-21 Thread Joshua Hayden
Not exactly sure what you're trying to do...Try something like this. #!/usr/bin/perl print Content-type: text/html, \n\n; print HTML\nHEAD\n; print titletest page/title\n; print /head\n; print body\n; open TEXT, ../cards/dougs.txt; while (TEXT) { print $_BR;

Re: [Q]Validating forms?!

2002-02-21 Thread Mo Holkar / UKG
At 11:37 21/02/02, you wrote: Bhanu Prakash wrote: HI All, Is there a way to Validate the fields of a form? Say I have a text field, and I should show an error to the user if he does not enter anything while submitting the form? Can somebody give me some sample script?! with

Re: selecting a text file for HTML output

2002-02-21 Thread Klaus Mangold
What do I need to do to get the Output to look like dougs.txt? and How come my newline \n; didn't seem to work??? Where did the dots come from? You must use HTML code! Newlines are ignored by the browser. Instead print BR for a new line. btw what do you want to do with Test 2? I do not

Limiting form field submission length with perl

2002-02-21 Thread Hughes, Andrew
I have a form that people are going to be filling out online. I am using JavaScript on the front-end to validate the form. However, for security sake and for my own knowledge, I would like to know how to limit the length of form submissions on my server validation sequence. I don't want to cut

Re: selecting a text file for HTML output

2002-02-21 Thread Sir Douglas Cook
Thank you,,, Joshua Hayden That was exactly what I was trying to do. [EMAIL PROTECTED] - Original Message - From: Joshua Hayden [EMAIL PROTECTED] To: Sir Douglas Cook [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, February 21, 2002 9:58 AM Subject: Re: selecting a text file for

Re: Limiting form field submission length with perl

2002-02-21 Thread Joshua Hayden
use CGI ':standard'; if (length(param('field')) 25) { subroutine(Please limit your response to 25 characters.); } elsif ... Best Regards, JOSHUA D. HAYDEN Owner/Operator of www.PinnacleSiteDesign.com - Original Message - From: Hughes, Andrew [EMAIL PROTECTED] To: [EMAIL PROTECTED]

A variable in a text?

2002-02-21 Thread Octavian Rasnita
Hi all, I want to make a form to let the visitors to type a text. In this text, I want to allow them to insert a variable. For example a $name variable. I would like to allow them to insert something like: My name is XXX and I would like to meet name from LA. And on the next page (as a test)

Re: Sending Mail

2002-02-21 Thread Johannes Franken
On Wed, Feb 20, 2002 at 08:58:41AM -0800, Bhanu Prakash wrote: when a user submits a form, the input entered by him should be mailed to the address he specifies in one of teh input fileds.! If you put that one on a public webserver, you should consider a way to prevent bad people from using

RE: Sending Mail

2002-02-21 Thread Darren Simpson
try FormMail http://worldwidemart.com/scripts/formmail.shtml -Original Message- From: Bhanu Prakash [mailto:[EMAIL PROTECTED]] Sent: 20 February 2002 16:59 To: [EMAIL PROTECTED] Subject: Sending Mail Hi, I'm new to Perl and am trying to write some cgi programs in Perl. Currently

Re: Sending Mail

2002-02-21 Thread Chris Zampese
Bhanu, Not sure what operating system you are using, but I have just done something very similar in Windows. The form the user input data into was on their intranet, and then the details of the form were mailed out to the client (in html orginally, but my clients are large insurance firms

Re: Sending Mail.

2002-02-21 Thread Bhanu Prakash
Chris, I'm using Solaris to run my perl script. Did you have a chance to write script in Solaris anytime?! Should the script be different for Solaris and Windows? Thanks Bhanu. Bhanu, Not sure what operating system you are using, but I have just done something very similar in

[Q] Validating Forms?!

2002-02-21 Thread Bhanu Prakash
HI All, Is there a way to Validate the fields of a form? Say I have a text field, and I should show an error to the user if he does not enter anything while submitting the form? Thanks for the help Bhanu. = Bhanu Prakash G V S __

RE: [Q] Validating Forms?!

2002-02-21 Thread John Edwards
I would do this using javascript within the form. Then when the field loses focus you can validate it. This means the form doesn't have to be submitted before the user is alerted of a problem. For extra robustness you can also validate the submitted results in the perl script and return the user

Perl subroutines using array hash????

2002-02-21 Thread Bruce Ambraal
Hi How do you do it Give me two different methods in subroutines, that will: match together all of its parameters into on large list. Many thanks to the following people: Brett, Micheal F, Zentara, Stephen H, Edward) Appreciate all you asistance) Cheers Bruce -- To unsubscribe, e-mail:

RE: [Q] Validating Forms?!

2002-02-21 Thread Bhanu Prakash
John, Thanks much for that information. It would be of great help to me if you can provide me with some sample scripts that will do these functions.! Of course I'd like to add more robustness to my script.! But, I don't know how to :( Looking for your help Bhanu. I would do this using

multiple line

2002-02-21 Thread kitti
Hi all I,am newbie perl ,i have text file like this INPUT FILE SUSCP:SNB=704131,LIST; SUBSCRIBER DATA SNBDEVDETYSUT SCL MIS COS 704131 LI3-37891 IPT-1

Re: [Q] Validating Forms?!

2002-02-21 Thread Arul, Rex (NEA-IMAP)
I am afraid this is a OT. Please consult with good Javascript documentation available online from Netscape and Microsoft Websites. You can write a javascript function, say 'checkThis' which would accept a parameter that corresponds to your text object and associate that with the onBlur event

RE: [Q] Validating Forms?!

2002-02-21 Thread John Edwards
You might have more luck asking this in the Perl CGI Beginners list. I haven't got any scripts that do this, but I know it's possible. See http://learn.perl.org to subscribe to the CGI list. John -Original Message- From: Bhanu Prakash [mailto:[EMAIL PROTECTED]] Sent: 21 February 2002

Re: local $/ = undef;

2002-02-21 Thread Jonathan E. Paton
Is there a way to find out the current possition in a file when you have unset $/? Err... unset $/ and the first time you read you've just grabbed the whole file - that means you're at the end. And that's all you know, unless: perldoc -f tell perldoc -f seek Jonathan Paton

RE: Stripping words from a string

2002-02-21 Thread Jonathan E. Paton
--- Wagner-David [EMAIL PROTECTED] wrote: Though s(world .. worked w/o /, it should be written s/(world | how )//gi; s/\b(world|how)\b//gi; The \b is a word boundary, which is going to work as expected more frequently. Jonathan Paton __ Do

Re: Perl subroutines using array hash????

2002-02-21 Thread Jon Molin
is this homework? Your other posts looks very homeworkish... /jon Bruce Ambraal wrote: Hi How do you do it Give me two different methods in subroutines, that will: match together all of its parameters into on large list. Many thanks to the following people: Brett, Micheal F,

Re: bleedperl , Berkeley DB-4, BerkeleyDB

2002-02-21 Thread zentara
On Wed, 20 Feb 2002 13:54:05 -0600, [EMAIL PROTECTED] (Elaine -Hfb- Ashton) wrote: zentara [[EMAIL PROTECTED]] quoth: * *All my searches on the net seem to indicate that bleedperl *is the latest version; but the BerkeleyDB docs say *it will need only perl version 5.004; and I have v5.6.0. Oh..I

Re: local $/ = undef;

2002-02-21 Thread insomniak
I kinda cheated. open(FH, . $file) or die print Cannot read $file; local $/ = undef; my $seek = 0; while (FH) { while (/^(START(.*)^END)/smg) { if (!$seek){ $seek= (pos) - length $1;} } } $seek will eventually get the number which represents the number of charaters read. Then I got the

Regular Expression

2002-02-21 Thread Lilian Alvarenga Caravela Godoy
Hi everyone I am trying to learn Perl looking into some scripts. One of them has a regular expression inside. First of all, I need to know what two specific lines are doing. The code is bellow. $req =~ s/\r//g ; $req =~ s/([^\n]{72,72})\n([^\n]{1,71})\n([^\n]{1,71})$/$1\n$2$3/ I know they

Re: Activer Perl Modules

2002-02-21 Thread Jenda Krynicky
From: Daniel Falkenberg [EMAIL PROTECTED] Just wondering if any one has seen this error before when installing a Active Perl Module. I have RTFM. I have run... c:\ppm then... PPMinstall HTML-TableExtract.ppd but then I recieve the following error... Error

RE: Regular Expression

2002-02-21 Thread John Edwards
$req =~ s/\r//g ; # This is replacing all carriage return special characters with nothing globally. # s/(replace)\r(carriage return special char)/(with nothing i.e delete them)/g(globally. i.e for every match in the string, not just the first)/; $req =~

RES: Regular Expression

2002-02-21 Thread Lilian Alvarenga Caravela Godoy
John Thank you very much for the explanation and for the links. Lilian. -Mensagem original- De: John Edwards [mailto:[EMAIL PROTECTED]] Enviada em: quinta-feira, 21 de fevereiro de 2002 11:11 Para: 'Lilian Alvarenga Caravela Godoy'; '[EMAIL PROTECTED]' Assunto: RE: Regular Expression

$ENV{remote_user}?

2002-02-21 Thread IT Workflow - Terry Honeyford
Not sure if this is Perl or apache related, but have spent hours trawling through web sites for the answer Gettin a bit desperate now so any help would be much appreciated. I have a perl script that runs fine using netscape fastrack server but when I use Apache 1.3.22 I don't get as many $ENV's

Re: Perl subroutines using array hash????

2002-02-21 Thread Bruce Ambraal
JON MOLIN many thanks to you too..., if that's what you want to hear. Don't have time for these question need to get myself skilled in Perl soonest. I surpose the name [EMAIL PROTECTED] is meant for people like me SUSAN not to worry I am two weeks in the game too, worken on the above problem,

Re: $ENV{remote_user}?

2002-02-21 Thread Johannes Franken
On Thu, Feb 21, 2002 at 02:42:31PM -, IT Workflow - Terry Honeyford wrote: but when I use Apache 1.3.22 I don't get as many $ENV's back from the server, in particular the one my script is looking for - ($ENV{remote_user}) In apache's httpd.conf, you should enable these lines:

Re: Sending mail

2002-02-21 Thread Bhanu Prakash
Darren, Can I run this formmail from another cgi program? Say I have some code fragment like this? if(param(myinfo)) { Can I invoke formmail here? } Would you mind explaining me, how ? Thanks Bhanu. try FormMail http://worldwidemart.com/scripts/formmail.shtml -Original Message-

Re: Unix commands in Perl scripts

2002-02-21 Thread Jonathan E. Paton
Hi guys, I was wondering if anyone knows how to execute Unix commands in a Perl Script? system(echo Hello World); my $output = qx(echo Hello There); print The shell said :$output\n; perldoc -f system perldoc perlop Jonathan Paton __ Do You

Need help with if statement - please

2002-02-21 Thread Chris
Greetings listers, I have the following code snippet: my @result; @result =`ping $hostname`; my $aPing = @result; my $Pcount = 0; $Status = $entryS-Entry-delete(1.0, end); while ($aPing 0){ print DUMPFILE * @result[$Pcount]; if ( substr(@result[$Pcount],0, 12) == 'Packets:' ) {

Re: Sending Mail

2002-02-21 Thread Johannes Franken
On Thu, Feb 21, 2002 at 08:46:54AM -, Darren Simpson wrote: try FormMail http://worldwidemart.com/scripts/formmail.shtml Be careful with formmail, for there are lots of script kiddies out there, trying to abuse it. Although I don't have it on my webserver, people occasionally try to

RE: Storing Newsletter in Database

2002-02-21 Thread Jonathan E. Paton
Any thought to storing links to the docs in a db rather than the data itself, maybe with some keywords you can search on? I don't see why, the database will handle it just fine. All you need to do is write a couple of simple wrapper CGI scripts. Using only the database is far easier to make

RE: Need help with if statement - please

2002-02-21 Thread Nikola Janceski
don't use == for string comparison. Use eq in place of the == see: perldoc perlop -Original Message- From: Chris [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 21, 2002 10:22 AM To: [EMAIL PROTECTED] Subject: Need help with if statement - please Greetings listers, I have the

Re: ifconfig and too many pppd's

2002-02-21 Thread Johnathan Kupferer
Basically, you want to run ifconfig to get a list of which interfaces are up and then look for ppp devices: open IFCONFIG, ifconfig |; my @interfaces; while(IFCONFIG){ next unless /^(ppp\d+)/; push @interfaces, $1; } close IFCONFIG; This should give you what an array of what

Re: How to I am not sure how to reference a perl script from the web

2002-02-21 Thread Johannes Franken
On Tue, Feb 19, 2002 at 02:54:33PM -0800, Lance Prais wrote: I am not sure how to do this. I wrote a perl script that searches a doc table and I need to have it called when I reference a web page. Write a perl-script (with the help of man CGI) and just put it in your webserver's /cgi-bin/

Re: Extracting Multiple Lines

2002-02-21 Thread Jonathan E. Paton
Also there are no delimiting characters to search. And one more problem is that they rarely end the sentence with a period. The only good news is that there are never more than 4 lines. But because there is almost always a newline, I can't use: while because it searches line by

Compare values

2002-02-21 Thread Bhanu Prakash
Hi Perl Gurus Is there a way to compare the values in perl? something like.. my $user = remote_user() if ($user == $owner_of_page ) { do_something } else { do_something_else } Thanks Bhanu. __ Do You Yahoo!? Yahoo! Sports - Coverage of the 2002

Re: Need help with if statement - please

2002-02-21 Thread Chris
Nikola Janceski wrote: don't use == for string comparison. Use eq in place of the == see: perldoc perlop -Original Message- From: Chris [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 21, 2002 10:22 AM To: [EMAIL PROTECTED] Subject: Need help with if statement - please

[Q]File Handles.

2002-02-21 Thread Bhanu Prakash
Perl Gurus, Can somebody tell me what is the difference between the two , with some examples? open(|/usr/users/mydir/myfile); and open(/usr/users/mydir/myfile); Thanks for the response Bhanu. = Bhanu Prakash G V S __ Do You Yahoo!? Yahoo!

Re: What is the value of @_4_[0], and $return_me? (see below)

2002-02-21 Thread zentara
On Wed, 20 Feb 2002 16:37:56 +0200, [EMAIL PROTECTED] (Bruce Ambraal) wrote: 1. (see subject) 2. Explain lines 3 , 4 3.Why does'nt this coding return anything2 sub routine { my @arr = (0, 'a' 1, 'b'); @_ = @arr; my $retun_me = shift; return( $return_me ) }; Try this one, it captures the

Re: How to copy and keep file permissions

2002-02-21 Thread zentara
On Wed, 20 Feb 2002 17:17:20 +, [EMAIL PROTECTED] (Craig Eberly) wrote: Hmm, I've tried this but it doesn't seem to change the file permissions at all on the backup file. I checked into it, and my stat command or $mode in this case is equal to 33261. Is that a normal output for the mode

Looking for someone to install perl scripts

2002-02-21 Thread dude1e
Hello: I subscribe to the perl newsletters,I am wondering what is the best way to announce to the group that I am looking for someone to install some perl scripts on my website for as reasonable as possible? Ed __ Do You Yahoo!? Yahoo! Sports -

Re: How to copy and keep file permissions

2002-02-21 Thread zentara
On Thu, 21 Feb 2002 11:09:59 -0500, [EMAIL PROTECTED] (Zentara) wrote: Ooops, made a dumb error. Corrected below. The 33261 is file permissions and file type in decimal. Under linux, chmod accepts this value, maybe under solaris you have to to have the octal value? Try this instead:

Re: Looking for someone to install perl scripts

2002-02-21 Thread Randal L. Schwartz
dude1e == dude1e [EMAIL PROTECTED] writes: dude1e I subscribe to the perl newsletters,I am wondering dude1e what is the best way to announce to the group that I dude1e am looking for someone to install some perl scripts on dude1e my website for as reasonable as possible? Post your request on

Re: Compare values

2002-02-21 Thread Paresh Kakrecha
if ( $user eq $owner_of_page) do something; At 07:48 AM 2/21/2002 -0800, Bhanu Prakash wrote: Hi Perl Gurus Is there a way to compare the values in perl? something like.. my $user = remote_user() if ($user == $owner_of_page ) { do_something } else { do_something_else } Thanks Bhanu.

Re: How to copy and keep file permissions

2002-02-21 Thread Randal L. Schwartz
Zentara == Zentara [EMAIL PROTECTED] writes: Zentara On Wed, 20 Feb 2002 17:17:20 +, [EMAIL PROTECTED] (Craig Eberly) wrote: Hmm, I've tried this but it doesn't seem to change the file permissions at all on the backup file. I checked into it, and my stat command or $mode in this case

Postgres Module in Windows?

2002-02-21 Thread Agustin Rivera
I've searched high and low for a module, any module, that would allow me to make called to the postgres database in Windows, but have come up empty. There doesn't even seem to be a way to do it from DBI. Does anyone have any experience with this? I would love it if someone could prove to me I

RE: Stripping words from a string

2002-02-21 Thread Mark Anderson
Though s(world .. worked w/o /, it should be written s/(world | how )//gi; s/\b(world|how)\b//gi; The \b is a word boundary, which is going to work as expected more frequently. The first example doesn't work if the word is followed by a punctuation mark. The second example doesn't get

Using subroutines from other languages

2002-02-21 Thread Antonis Zamout
I have a weird question for you: Is there anyway to use subroutines written in another language from within perl (like the xs package for C). In particular, I want to use Fortran code from perl scripts. Any ideas? Thanks -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,

RE: Regular Expression

2002-02-21 Thread Mark Anderson
$req =~ s/([^\n]{72,72})\n([^\n]{1,71})\n([^\n]{1,71})$/$1\n$2$3/ # This regex appears to do nothing. It's looking for three matches, then replacing them with the matches found. It's like saying look for all instances of one two three in the string and replace them with one two three.

RE: Splitting variable...

2002-02-21 Thread Timothy Johnson
This is correct, but for the sake of readability I'd put the /\s+/ in there anyway. -Original Message- From: Deen Hameed [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 20, 2002 10:39 PM To: Daniel Falkenberg Cc: [EMAIL PROTECTED] Subject: Re: Splitting variable... # split

RE: How to split on case boundries?

2002-02-21 Thread Mark Anderson
There may be a solution using split, but I am much more familiar with regular expressions, so I crafted the following: use strict; use warnings; my $str = UaBitEssdSi; my @dpt = (); while ($str =~ /([A-Z][a-z]*)/g) { push @dpt,($1); } foreach my $i (0..$#dpt) { print

Re: How to split on case boundries?

2002-02-21 Thread Jeff 'japhy' Pinyan
On Feb 20, Tim Musson said: The people who control the data want to remove the _ chars and make the delimiter based on the case of the chars (first char of each part is uc, all others are lc)... So the source would look like this UaBitEssdSi I still need to put the same elements into @dpt, so

How to split on case boundries?

2002-02-21 Thread Tim Musson
Hey all, My current source looks like this ua_bit_essd_si I split on _ into @dpt. The people who control the data want to remove the _ chars and make the delimiter based on the case of the chars (first char of each part is uc, all others are lc)... So the source would look like this

Re: Splitting variable...

2002-02-21 Thread Jeff 'japhy' Pinyan
On Feb 21, Deen Hameed said: # split works on whitespace by default @somearray = split $string; Err, that splits $_ on the contents of $string. Yes, split() uses whitespace by default, but that default is the FIRST argument. What I'm saying is that split; is equivalent to split ' ';

Re: Using subroutines from other languages

2002-02-21 Thread Jeff 'japhy' Pinyan
On Feb 21, Antonis Zamout said: I have a weird question for you: Is there anyway to use subroutines written in another language from within perl (like the xs package for C). In particular, I want to use Fortran code from perl scripts. There might be Inline::Fortran. If not, I'm not sure what

Filtering PDF as text stream

2002-02-21 Thread Joshua Kaufman
Hi all- I'd like to be able to filter text in a large number of PDF files, ideally opening the pdf, filtering the text and then saving the stream back again as a pdf. Can anyone point me towards an easy way to do this? Preliminary research on CPAN showed a large number of modules that deal

Re: Looking for someone to install perl scripts

2002-02-21 Thread Dennis G. Wicks
This reminds me of an antacid commercial on TV, because technically, You just did! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Stripping words from a string

2002-02-21 Thread Jeff 'japhy' Pinyan
On Feb 21, Mark Anderson said: The first example doesn't work if the word is followed by a punctuation mark. The second example doesn't get rid of the space, which is fine for HTML, but not for other uses. Well, you have to define the word-removal. If you're removing the word at the beginning

Converting windows txt file format to Linux txt file format

2002-02-21 Thread Lilian Alvarenga Caravela Godoy
Hi everyone I am trying to upload a windows txt file to a Linux server. There are an application running in my Linux server that reads the txt file to extract some information. But the application doesn't recognize the file because it's originally from windows. I know that I could solve it

How to issue CLEAR command from Perl

2002-02-21 Thread Hewlett Pickens
Invoking a Perl script from a TN3270 terminal (Linux/390) Want to issue the shell clear command to clear the screen. Using Bash shell 1.14.7(1) clear works ok from the command line. Does not clear the screen when issued from the script. Displays1 instead Have tried these syntaxes (if

Re: Need help with if statement - please

2002-02-21 Thread David Wall
Chris [EMAIL PROTECTED] wrote on 21 Feb 2002: if ( substr(@result[$Pcount],0, 12) == 'Packets:' ) { How about if ( substr($result[$Pcount],0, 12) eq 'Packets:' ) { $result[$Pcount] is a scalar, not an array. or if ( $result[$Pcount] =~ /^\s+Packets:/ ) { But I think

Re: Object Question

2002-02-21 Thread Brad Phinney
A brett ... Any headway on the code I sent you? On Wed, 20 Feb 2002, Brett W. McCoy wrote: On Wed, 20 Feb 2002, phinney wrote: I have an object method that allocates quite a bit of memory through fillung up an array. I then pass that array back to the calling program. Now, if I

RE: How to issue CLEAR command from Perl

2002-02-21 Thread Nikola Janceski
use system(clear) system displays output to the terminal where ` (backtick) returns the output to the perl script not the terminal. -Original Message- From: Hewlett Pickens [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 21, 2002 2:26 PM To: zPerl Beginners Subject: How to issue

RE: How to issue CLEAR command from Perl

2002-02-21 Thread Aaron Shurts
Try typing this at the command line: $ perldoc -f system ;-) -_-Aaron -Original Message- From: Hewlett Pickens [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 21, 2002 11:26 AM To: zPerl Beginners Subject: How to issue CLEAR command from Perl Invoking a Perl script from a

Re: Need help with if statement - please

2002-02-21 Thread Chris
David Wall wrote: Chris [EMAIL PROTECTED] wrote on 21 Feb 2002: if ( substr(@result[$Pcount],0, 12) == 'Packets:' ) { How about if ( substr($result[$Pcount],0, 12) eq 'Packets:' ) { $result[$Pcount] is a scalar, not an array. or if ( $result[$Pcount] =~

Timeout issue using the Perl NET cmd method

2002-02-21 Thread Bill Barrett
request for help. I am having the following problem with a test script. I issue the stmt: @lines = $t-cmd(who); And my script times out at that statement. I have the Dump_Log turned on. I can see that my command executes successfully on the remote host. But, I want to finish the remaining

Re: Regular Expression

2002-02-21 Thread John W. Krahn
Lilian Alvarenga Caravela Godoy wrote: Hi everyone I am trying to learn Perl looking into some scripts. One of them has a regular expression inside. First of all, I need to know what two specific lines are doing. The code is bellow. $req =~ s/\r//g ; This is replacing all the \r

RE: How to issue CLEAR command from Perl

2002-02-21 Thread Hewlett Pickens
Thank you - the system(clear)did the trick. And Aaron Shurts' suggestion about reading perldoc resolved a reading problem I've been having. Items like Cexec LIST and Cwait() have meant nothing when I've come across them. Now - it dawns on me that they are c calls. Hewlett -- To

RE: How to issue CLEAR command from Perl

2002-02-21 Thread Jeff 'japhy' Pinyan
On Feb 21, Hewlett Pickens said: Items like Cexec LIST and Cwait() have meant nothing when I've come across them. Now - it dawns on me that they are c calls. No, you're looking at raw Pod markup. It's like seeing bwhoa/b instead of rendered HTML. C... means that the text should be shown

Re: Win32::ODBC

2002-02-21 Thread Johnathan Kupferer
This looks like an issue we ran into when connecting with MS-SQL 7. Try using two different database handles, one handles the query and the other one to perform the inserts. You also were missing a semi-colon after your print, but I think that was probably an error in copying the code to the

FW: Timeout issue using the Perl NET cmd method

2002-02-21 Thread Bill Barrett
Between one of my colleagues and myself, we stumbled on to the problem. It was an incorrect Prompt assignment when I was doing a new on my telnet object. Those darn typos. Sorry, Bill Barrett -Original Message- From: Bill Barrett [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 21,

RE: How to issue CLEAR command from Perl

2002-02-21 Thread Hewlett Pickens
Read 'perldoc perlpod' for a description of the markup Thank you. That clears up my mis-understanding and provides a lot more information besides. As time goes by, things gradually becoming less murky. Am still on my back flailing with arms and legs, but getting closer to the crawling

RE: How to issue CLEAR command from Perl

2002-02-21 Thread Aaron Shurts
If you don't already have it, invest some coin in the 3rd edition of 'Programming Perl'. -_-Aaron -Original Message- From: Hewlett Pickens [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 21, 2002 2:15 PM To: [EMAIL PROTECTED]; zPerl Beginners Subject: RE: How to issue CLEAR command

shift inside of for loop

2002-02-21 Thread Luke Bakken
Hi all, I've noticed some interesting behavior when trying to shift an array that you're iterating over. For example: my @ary = (0..1000); for (@ary) { if($_ = 1000) { shift @ary; } } print scalar @ary, \n; This prints 500 on my NT box with ActiveState

RE: shift inside of for loop

2002-02-21 Thread Mark Anderson
I inserted a print statement into your code that may help you understand what's happening: my @ary = (0..1000); for (@ary) { if($_ = 1000) { print; shift @ary; } } print scalar @ary, \n; ## my comments: the for

To create a hash of lists

2002-02-21 Thread William . Crain
Using the following code, I want to create a hash or individual lists. Of course, this code doesn't work What do I need to change to correct my error? --- Code follows --- #!/perl/bin/perl use strict; my %printQueue; push($printQueue{A}, 'This is the first line in

Allow only letters and numbers?

2002-02-21 Thread Daniel Falkenberg
Hello List, The code below of coarse will count all characters in the string $string $string = 4556jhkl; $count = $string =~ tr/a-zA-Z0-9//; How would I go about only allowing numbers and letters of the alpahbet? if ( $string =~ /\dw/)) { print Only letters and numbers allowed: NO SPECIAL

Re: Allow only letters and numbers?

2002-02-21 Thread Jeff 'japhy' Pinyan
On Feb 22, Daniel Falkenberg said: The code below of coarse will count all characters in the string $string $string = 4556jhkl; $count = $string =~ tr/a-zA-Z0-9//; How would I go about only allowing numbers and letters of the alpahbet? You could say: if ($string =~ tr/a-zA-Z0-9//c) {

Re: To create a hash of lists

2002-02-21 Thread Jeff 'japhy' Pinyan
On Feb 21, [EMAIL PROTECTED] said: Using the following code, I want to create a hash or individual lists. Of course, this code doesn't work What do I need to change to correct my error? push() requires an array. $foo{bar} is a scalar. @{ $foo{bar} } is an array. push($printQueue{A},

RE: Allow only letters and numbers?

2002-02-21 Thread Timothy Johnson
If you don't mind having underscores in your text, you could also do this: if($string !~ /^\w+$/){ #If the string does not have only letters, digits, and underscores from start to finish (\w) print There's a special character in there somewhere.\n; } -Original Message- From: Jeff

Re: Splitting variable...

2002-02-21 Thread Michael Fowler
On Thu, Feb 21, 2002 at 10:47:43AM +1030, Daniel Falkenberg wrote: $string = BusinessPersonalFAD AFD:test(Regional); @line = split/\s+/, $string; Now $line[1] prints nothing? Am I doing something wrong here? perl -wle '@line = split(/\s+/, $ARGV[0]; print $line[1];'

Re: Opposite of $respose-is_success

2002-02-21 Thread Peter Scott
At 02:00 PM 2/21/02 +1030, Daniel Falkenberg wrote: Hey all, Just wondering if any one know what the oposite of $response-is_success in the code below? I have tried $response-is_fail and $response-is_failure. Oh so close :-) $response-is_error I have also RTFM but I can't find anywhere what

Re: How to issue CLEAR command from Perl

2002-02-21 Thread Matt C.
Here's another way, which I suppose is simply an alternative to the system call: Notice how you just print the *value* from the captured backtick in the following line: perl -e '$c=`clear`; print Testing ...\n; sleep 1 ; print $c;' Matt --- Hewlett Pickens [EMAIL PROTECTED] wrote: Invoking

Cwd behavior when $PATH is not there - bug or feature?

2002-02-21 Thread Adriano Rodrigues Ferreira
I have encountered a behavior that I think it is a little odd and I have discovered it has to do with the standard module Cwd. I had a Perl script which was called by a Java application via Runtime.getRuntime().exec() I have discovered that it was a good idea to use the form that includes not

Re: Allow only letters and numbers?

2002-02-21 Thread Randal L. Schwartz
Timothy == Timothy Johnson [EMAIL PROTECTED] writes: Timothy If you don't mind having underscores in your text, you could also do this: Timothy if($string !~ /^\w+$/){ #If the string does not have only letters, digits, Timothy and underscores from start to finish (\w) Nope, that also permits

RE: Allow only letters and numbers?

2002-02-21 Thread Timothy Johnson
Okay, I get what you're saying about \z, sort of, assuming that the user doesn't have to enter in the text at a prompt and you're not reading from a file where lines are delimited by newlines, but I don't get where this ties into security. Could you explain? -Original Message- From:

Re: Allow only letters and numbers?

2002-02-21 Thread Randal L. Schwartz
Timothy == Timothy Johnson [EMAIL PROTECTED] writes: Timothy Okay, I get what you're saying about \z, sort of, assuming Timothy that the user doesn't have to enter in the text at a prompt Timothy and you're not reading from a file where lines are delimited Timothy by newlines, but I don't get

What would take care of this?...

2002-02-21 Thread Daniel Falkenberg
Hey All, Just wondering how I would go about extracting all the data from heading 1 (h1) in the following HTML code. I figured I could have used HTML::TableExtract but then I realized ( :) ) there are not tables in the following HTML. Would I now have to go ahead and use HTML::parser or

Sorting situation on how to handle a sort where some items may not be numeric

2002-02-21 Thread Wagner-David
I have some data which looks like this: Key CPU Mirror $AUDIT 8 Y $AUDIT1 7 Y $DATA1 7 Y $DATA2 7 Y $DATA3 6 Y This data has already been sorted, but I

RE: [Q] Convert tcl list

2002-02-21 Thread Wagner-David
Here is one attempt: $_ = 'mykey {{ abc xyz nnn mmm }} mykey2 {{ aaa bbb ccc ddd}}'; my @MyData = (); while ( /\{{2}([a-z0-9\s]+)\}{2}/g ) { push(@MyData, $1); } my $MyId = 1; foreach ( @MyData ) { printf %3d: %s\n, $MyId++, $_; } Output: 1: abc xyz nnn mmm 2: aaa

Re: Netscape or Perl error?

2002-02-21 Thread Dave Benware
Daniel Falkenberg wrote: Hi All, I am just testing my Perl CGI script on Netscape browser at the moment and I am getting a weird error occur. I can execute my script fine but when I go to use a link in the script such as...

Re:[Q]Convert tcl list

2002-02-21 Thread Bhanu Prakash
Hi Wags, Whoops! That seems to solve the purpose.! But, How do I read this data from a file into an array?! Thanks Bhanu. $_ = 'mykey {{ abc xyz nnn mmm }} mykey2 {{ aaa bbb ccc ddd}}'; my @MyData = (); while ( /\{{2}([a-z0-9\s]+)\}{2}/g ) { push(@MyData, $1); } my $MyId = 1;

Need help with Perl error Please

2002-02-21 Thread Michael Eggleton
Hi All, I have a problem with the Perl format command. If I use the '' for Justify left. I get the error message: Missing right curly or square braket. So this code below does not work: format STDOUT = ZIPPKG: @ $zippkg NAME: @ $zippkgName CATEGORY: @

RE: Netscape or Perl error?

2002-02-21 Thread Daniel Falkenberg
Hi Dave, My apologize for not getting back to the list sooner. I have figured out exactly what my problem was. I didn't add the following into my HTML code... $nameofscript = perlscript.pl; form method=post action=$nameofscript Netscape didn't automatically use the script it was executing.

  1   2   >