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... > > http://mydomain.com/cgi-bin/script?words=test&action=c

Re: Troubles with reg exp

2002-02-11 Thread Dave Benware
Stuart Clark wrote: > > Hi All, > I'm having trouble with this regular expression > I have data file with colon separated delimiters > The data below has 6 colon delimiters > I want to check to make sure that none of the lines of data has more or less > than 6 colons in it (EG: Lets say David ent

Re: Parsing a .csv file

2002-02-11 Thread Dave Benware
Steven Arbitman wrote: > > Hi all, > > I know parsing a comma-separated value file should be easy: > @array = split /,/; # just split the line on commas > > However, my input csv file looks like this: > Name,"street,city,state,zip",phone,email,"comments, may have commas, 2" > > Note, not all

Re: reg exp

2002-02-10 Thread Dave Benware
Stuart Clark wrote: > > Hi all, > I am trying to match a 14 digit number > When i use this regular expression i match a 14 digit number and any number > over 14 digits. > > $somestring = ~ '/d{14}'; > > I have tried these combinations with no avail. > > $somestring =~ '/d{14,14}'; > $somestrin

Re: Complete Beginner Looking for Advise!

2002-02-10 Thread Dave Benware
> There are a few Perl tutors around who might have a different > perspective, but from my point of view, turn on strictures and warnings, > exercise a little self control and Perl can allow you to produce clear, > concise, extensible and maintainable code. What more could a beginner > want? I

Re: Complete Beginner Looking for Advise!

2002-02-07 Thread Dave Benware
[EMAIL PROTECTED] wrote: > > Hi everyone, > > I'm a complete newbie to perl and programming. I'm a computer science > freshman at Cal Poly SLO, and am only in CPE 102 where we are studying the > fundamentals of JAVA. However, because I make websites I am very interested > in perl, and would li

Re: regex and pattern matching

2002-02-06 Thread Dave Benware
Jeff 'japhy' Pinyan wrote: > > On Feb 5, [EMAIL PROTECTED] said: > > >Problem is I don't know how to escape the entire variable $value_a so that > >the . is not considered a quantifier. > > You have $value_a and $value_b in the wrong place in your example. Speaking of $a and $b, I seem to rec

Re: Illegal character error for blank line.

2002-02-06 Thread Dave Benware
Student of Perl wrote: > > Hi there, > > i have very strange problem. > I have a simple script which I run > on Windows98 (PC) and it > executed properly. But when I > sent it to someboday by email > who uses Unix ; it give error. > > The first 3 lines of the script are > comments in following

Re: use strict

2002-02-05 Thread Dave Benware
Octavian Rasnita wrote: > > Hello all, > I am a new member. please tell me what is used for the following line in a > script: > > use strict; > > I saw that if I use it, this make sometimes my scripts to have errors and > without it, they works. > Thanks! > Teddy, > My dear email address is [EM

Re: select text

2002-02-05 Thread Dave Benware
"Jonathan E. Paton" wrote: > > --- Roman Fordinal <[EMAIL PROTECTED]> wrote: > > > > I need to get the email address from string: > > > > $email="Name LastName <[EMAIL PROTECTED]>" > > > > How do I extract it? [Above converted to English - > JEP] > > ($email = $email ) =~ /\<([^>]+)\>$/;

Re: Why localize $_, was-> Re: why shift @_ ?

2002-02-04 Thread Dave Benware
Steve Howard wrote: > > > However, since the whole idea behind using local or my with variables > is to prevent a variable name from writing over the same variable > name elsewhere in the script, it makes even *more* sense to me to > use local with Perl's special variables; in that they are used

Re: Why localize $_, was-> Re: why shift @_ ?

2002-02-04 Thread Dave Benware
Timothy Johnson wrote: > > Okay, that makes sense after playing around with it a little. One more > question. Does that offer an advantage over doing this? > > use strict; > our @list = qw(a b c d); > foreach (@list) { > &check_b; > print $_, "\n"; > } > > sub check_b { > foreach (@list

Why localize $_, was-> Re: why shift @_ ?

2002-02-04 Thread Dave Benware
Timothy Johnson wrote: > > Ok, I figured that much, but I guess my question is this: Is there a > pressing need to scope a predefined variable like $_? How could this > adversely affect a program? (I'm not trying to be a smart aleck, I really > want to know) > Hi, Sorry for such a short ans

Re: why shift @_ ?

2002-02-04 Thread Dave Benware
Timothy Johnson wrote: > > > Is it hot in here? > > I guess I was thinking of another function, although I'd feel a little less > sheepish if I knew which one. "$_ = shift @_" should work for the example. > Good point about catching strings that evaluate to FALSE. I'll keep that in > mind. >

Re: absolute beginner has questions

2002-02-03 Thread Dave Benware
Dave K wrote: > > Thomas, > Any editor (I use notepad, WinVim, and anything else available - later > you may find reason to look for a 'better' editor and there is always plenty > of opinion available about editors). There's a great list of editors with reviews at http://pureperl.org/edit

Re: absolute beginner has questions

2002-02-03 Thread Dave Benware
Thomas Kienberger wrote: > > Hallo, first: I´ve never programmed, bevore. > Now i want to start programming with perl. I´ve made the download of a standard perl >version for windows. And now I have no idea how to start with a first small programm. >I have bought a book about perl, but there i

Re: Perl FAQ

2002-02-02 Thread Dave Benware
"Brett W. McCoy" wrote: > > On Sat, 2 Feb 2002, Dave Benware wrote: > > > This is not a newsgroup, it's an email discussion list. > > It's also accessible via nntp.perl.org as a newsgroup. > > > The *list* doesn't have a FAQ of it&#x

Re: Perl FAQ

2002-02-02 Thread Dave Benware
Russ Foster wrote: > > Speaking of FAQs, is there a Perl FAQ...maybe something from this newsgroup? > This is not a newsgroup, it's an email discussion list. The *list* doesn't have a FAQ of it's own although there has been a bit of talk regarding creating one. And a few of us have created he

Re: Hash Question

2002-02-02 Thread Dave Benware
"McCollum, Frank" wrote: > > Where might one find this 'tutorial'? heh, can't believe I wrote all that and didn't put in the URL duh. http://pureperl.org/hashofhash.html Bompa "McCollum, Frank" wrote: > > Where might one find this 

Re: Hash Question

2002-02-01 Thread Dave Benware
"Balint, Jess" wrote: > > Since this is a beginners list, I thought I would be allowed to ask this > question. Can there be multiple values for hash keys, or just one? The > reason I am asking is that I am working on a statistical program and would > need to use multiple hashes as values of ano

Re: why doesn't this error

2002-02-01 Thread Dave Benware
Alex Harris wrote: > > First, I read perldoc -f exec() and did as follows: > > exec "rsh $plant /u1/bin/forkit 'work.pl'" or >print STDERR "Couldn't fork it.\n $!\n"; > > BUT, even though the file it should be exec - ing 'work.pl' does NOT exist > on the remote system, the error doesn

Re: Access Transmitted Data On "Server" Side Of A TCP Socket

2002-01-31 Thread Dave Benware
Hewlett Pickens wrote: > > Using O'Reilly's "Learning Perl", have set up a "bare bones" socket > connection between two computers to send a small amount of data from the > "client" to the "server". (For learning, not for the real world.) > > The client sends "are you there" and the server res

Re: system "dir"; works fine, but system "dir foo.txt" gets anerror

2002-01-31 Thread Dave Benware
Peter Scott wrote: > > At 11:35 AM 1/31/02 -0500, Dave Benware wrote: > >The line system "dir foo.txt"; returned "Bad command or file name". > > > >foo.txt does exist and I can run dir foo.txt within a dos box just > >fine. Interestingly to

system "dir"; works fine, but system "dir foo.txt" gets an error

2002-01-31 Thread Dave Benware
Running the script (below) from Bob Showalter brought a problem to surface on this win98se using ActivePerl 560 build 630. The line system "dir foo.txt"; returned "Bad command or file name". foo.txt does exist and I can run dir foo.txt within a dos box just fine. Interestingly to me, system

Re: What is the newline character (\n) equal to?

2002-01-31 Thread Dave Benware
> So you can see that the string is 4 bytes long. When I write it to the file, > the file becomes 5 bytes, because the LF is converted to a CR/LF pair. When > I read it back in, the reverse conversion is made, so the string becomes 4 > bytes again. When I call binmode, that conversion is not

Re: What is the newline character (\n) equal to?

2002-01-31 Thread Dave Benware
Dave Benware wrote: > CR/LF has never been translated to a LF while reading a file > for me. If that were true, the whole situation would be > transparent and I would have never asked the question it seems. > I didn't see anything about this "translating" in the doc

Re: What is the newline character (\n) equal to?

2002-01-31 Thread Dave Benware
Bob Showalter wrote: > No. A "\n" in your program is an ASCII linefeed (10) character > on either platform. So, \n equals a LF, thank you. > > What happens on Windows is that when you are reading a file, > each CR/LF pair from the file is changed to a single LF char > before the data is return

Re: undefined variable

2002-01-30 Thread Dave Benware
Debbie McNerney wrote: > > Please accept my apologies for being so dumb. I am a beginner and really > have done basic perl scripting by using the "copy and paste and modify" > method of script writing. > > I have a server running Solaris 8. From what I can determine, perl is > version 4 on it

What is the newline character (\n) equal to?

2002-01-30 Thread Dave Benware
Correct me if I'm wrong, the newline character \n is platform dependent. On unix-type it would equal a LF and on Windows it would equal a CRLF. Right? Bompa -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]