While - Problem

2002-11-14 Thread Sorin Marti
Hi all, I,ve got a problem. Following Code reads an Example-String in XML-Style, filters out the necessary information and writes it in a HASH. Now I want to read a file and not only one String. I thought that I can just put a while-loop around my code but that don't work. How may I solve that.

Re: Net::SMTP

2002-11-14 Thread Ramprasad A Padmanabhan
There is no problem in this line ( only 'yourdomain' is not a qualified domainname I hope you have taken care ) There must be some other problem in the code or otherwise. If you can change the domainname to your own server and start smtp server in debug mode and check you can learn better Tom

Net::SMTP

2002-11-14 Thread Tom Allison
I'm trying to connect to a server while using a HELO option, but no luck $smtp = Net::SMTP->new("yourdomain", Hello => "mydomain"); gives me: Invalid argument at ./verify.pl line 92, line 16. -- When you have to kill a man it costs nothing to be polite. -- Winston Churchill, on formal declar

Re: can't read in whole file

2002-11-14 Thread John W. Krahn
Paul wrote: > > > if (open SEARCH_FILE, "< $fileName") { > > my $searchData = join "", ; > > close SEARCH_FILE; > > ok, $searchData should be the whole file, but maybe it's the line-based > read you're doing. A less attractive but more eff

Re: references and printing

2002-11-14 Thread John W. Krahn
Paul wrote: > > --- Julien Motch <[EMAIL PROTECTED]> wrote: > > #The next line printsd the reference why ? > > print("the host which you are connecteed to is $pop->Host()\n"); # > > Mail::POP3Client=HASH(0x8153a8c)->Host() > > Inside the quotes, the -> operator is taken as printable characters.

Re: references and printing

2002-11-14 Thread John W. Krahn
Julien Motch wrote: > > Hi , Hello, > There is one thing I could not explain about printing references . > Take this little program : > > #!/usr/bin/perl > use Mail::POP3Client; > > $pop = new Mail::POP3Client(HOST => "pop.skynet.be"); > > print $pop->Host(); #OK print pop.skynet.be >

Re: checking for special chars in a string

2002-11-14 Thread John W. Krahn
Ramprasad A Padmanabhan wrote: > > Hello all, Hello, > I am sure this must have been asked before But I cant find it > > How do I find if > $str has any special chars ( I mean above 127 in the ascii range ) > > I do not want to do an ord of each character > > like while($str=~/(.)/g) { ret

Re: :Oracle row count not working

2002-11-14 Thread George Schlossnagle
rows does not work correctly for selects.[1] This is because oracle itself does not know how many rows are returned on the select until they have all been fetched. rows works correctly on inserts and updates though. [1] rows will return non-zero after the first row is fetched,, but this number

Re: :Oracle row count not working

2002-11-14 Thread Wiggins d'Anconia
That seems correct to me. You may have better luck on [EMAIL PROTECTED] if maybe this is an Oracle specific thing or such. http://danconia.org -Original Message- From: Kevin Old [mailto:kold@;carolina.rr.com] Sent: Thursday, November 14, 2002 3:10 PM To: [EMAIL PROTECTED] Subject: DBD::O

Re: push'ing items onto an array

2002-11-14 Thread David Buddrige
Thanks Paul, Beau, That's got it. 8-) I knew it had to be something simple. 8-) David. Paul Johnson wrote: David Buddrige said: #!/usr/bin/perl use strict; use warnings; @c_files; @h_files; foreach $arg ( @ARGV ) { if ( $arg =~ /\w\.[Cc]/ ) { push @c_files ($arg);

RE: :Oracle row count not working

2002-11-14 Thread Peter Kappus
I haven't used much DBI but I suspect that your $rv2 is just a reference to an array of rows so you might try doing something like "$rv2 = scalar($sth2->rows)" to put the number of items in that array into $rv2... BTW, why such cryptic variable names? ;-) Of course, I may be completely off so hope

RE: can't read in whole file

2002-11-14 Thread Perl
bingo! That fixed it! Thanks agian -Original Message- From: Wagner, David --- Senior Programmer Analyst --- WGO [mailto:David.Wagner@;freight.fedex.com] Sent: Thursday, November 14, 2002 4:25 PM To: 'Perl'; Wagner, David --- Senior Programmer Analyst --- WGO Cc: [EMAIL PROTECTED]; [EMAIL

RE: can't read in whole file

2002-11-14 Thread Wagner, David --- Senior Programmer Analyst --- WGO
You might try after the open but before any io binmode SEARCH_FILE then do your io. Wags ;) -Original Message- From: Perl [mailto:perl@;codyartsupply.com] Sent: Thursday, November 14, 2002 15:10 To: Wagner, David --- Senior Programmer Analyst --- WGO Cc: [EMAIL P

DBD::Oracle row count not working

2002-11-14 Thread Kevin Old
Hello all, I've been using DBD::Oracle for quite some time now, but have just noticed a major problemI can't get the number of rows returned from a query. Here's my code: #db2 handle defined here $sth2 = $dbh2->prepare($select); $sth2->execute; $rv2 = $sth2-

RE: can't read in whole file

2002-11-14 Thread Perl
Thanks, it's gotten better, but not completely reading yet. It now loads the text-editor opened-and-resaved version of the spreadsheet as a full 10752 characters long. which is good. Unfortunately, the MS-Works spreadsheet files still get tructed right where they did before. I think it must

Subject: checking for special chars in a string

2002-11-14 Thread Alfred Vahau
Hi, I'm using my imagination as to the nature of the problem. Here's one approach. 1. construct a hash of special characters. 2. split the spring on 'nothing' and construct a hash of characters. 3. Then use the exists function to test for the presence of the character in the string. CPAN should h

RE: can't read in whole file

2002-11-14 Thread Paul
--- "Wagner, David --- Senior Programmer Analyst --- WGO" <[EMAIL PROTECTED]> wrote: > Replace local $_ = undef; with local $/ = undef; >This undefines the input record separator which is what you want > when you > want to slurp a whole file into an array. > > Wags ;) DOH C

[Fwd: push'ing items onto an array]

2002-11-14 Thread Alfred Vahau
--- Begin Message --- Hi, >Any help greatly  appreciated. Beau and Paul have  given the help you sought. Help was actually at your finger tips viz, the Perl online documentation. In your case, you would issue a command like: perldoc -f push and you get the display: -- pu

RE: can't read in whole file

2002-11-14 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Replace local $_ = undef; with local $/ = undef; This undefines the input record separator which is what you want when you want to slurp a whole file into an array. Wags ;) -Original Message- From: Perl [mailto:perl@;codyartsupply.com] Sent: Thursday, November 14, 2002

RE: can't read in whole file

2002-11-14 Thread Perl
Hi Paul, Thank you for taking the time to help. >> foreach my $fileName (@list) { >> chomp($fileName); >> my $duhFileName = $fileName; >> #okay, I need help with scope too :-) > >You sure you didn't just misspell the variable name? >It's case se

Re: accessing ACCESS database

2002-11-14 Thread Angel Iliev Kafazov
OK, It doesn't work again. It gives me the following error: Error: Win32::ODBC=HASH(0x1abf118)->ErrorDatabase results: first name and last name > > - Original Message - > From: "Angel Iliev Kafazov" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Thursday, November 14, 2002 11:58

Re: can't read in whole file

2002-11-14 Thread Paul
> foreach my $fileName (@list) { > chomp($fileName); > my $duhFileName = $fileName; > #okay, I need help with scope too :-) You sure you didn't just misspell the variable name? It's case sensitive. > if (open SEARCH_FILE, "

can't read in whole file

2002-11-14 Thread Perl
Hi, I've written a small file-search program, that reads a directory and uses a regex in a loop to find matching files. The problem, is that I can open a file, such as a MS-Works Spreadsheet file in a text editor, and see the plain-text word that I'm searching for nested inside the 'gibberish' w

Re: Fwd: code ref and objects

2002-11-14 Thread Jason Tiller
Hi, Todd & Jeff, :) From: "Jeff 'japhy' Pinyan" <[EMAIL PROTECTED]> > On Nov 13, todd shifflett said: >> the above works. Now I would like to be able to pass in a >> subroutine from a declared object. > You mean a "method" (that is, a function that is "bound" to an object). >> my $fft = new Ma

Re: accessing ACCESS database

2002-11-14 Thread Angel Iliev Kafazov
Thank you very much for the support. I tried whatever you recommended me and I isolated the error in the sql statement. The script connects to the database and returns defined $db var but after this it cannot execute the sql. I double-checked my table and columns, though I still have no idea wh

RE: fork?

2002-11-14 Thread Paul
> Minor point; this won't catch an error from fork(). If fork() fails, > it returns undef, and the test: >(0 == $pid) > Will be true, even if $pid is undef. Damn, that's right -- thanks, Bob. *GOOD* point to make. undef() *always* evaluates to zero in a numeric context such as == Rather, I sh

RE: comparing arrays

2002-11-14 Thread Diego Riano
Hello Thanks for your help -- ___ Diego Mauricio Riano Pachon Biologist Institute of Biology and Biochemistry Potsdam University Karl-Liebknecht-Str. 24-25 Haus 20 14476 Golm Germany Tel:0331/977-2809 http://bioinf.ibun.unal.edu.co/~gotem http://www.geocities.c

RE: fork?

2002-11-14 Thread Bob Showalter
> -Original Message- > From: Paul [mailto:ydbxmhc@;yahoo.com] > Sent: Thursday, November 14, 2002 9:35 AM > To: [EMAIL PROTECTED] > Subject: RE: fork? > > ... > if ($pid=fork()) {# I'm the parent > # ... code > } elsif (0 == $pid) { # I'm the child > # ... code > } else {

RE: Sockets....

2002-11-14 Thread Sorrells, Dave
Bingo! Thanks Paul, you are correct. $_ is not getting loaded in the while statement. >someone please poke me if I'm dreaming, but if you say > > while(<$new_sock>) { print $_; } > >the while(<>){} structure automatically loads $_ with whatever came out >of the <> ... IF and ONLY IF the diamond op

RE: Sockets....

2002-11-14 Thread Kipp, James
> Server: > #!/usr/bin/perl > use IO::Socket; > my $sock = new IO::Socket::INET ( > LocalHost => 'IP_GOES_HERE', > (<-- yes this > is set properly) > LocalPort => '6', > Proto => 'tcp', >

Re: Sockets....

2002-11-14 Thread Paul
> no idea if that is correct. Is there something missing, how does $_ > get assigned the input from $new_sock? Thanks. > > while(defined(<$new_sock>)) { >print "Socket defined\n"; >print $_; > } someone please poke me if I'm dreaming, but if you say while(<$new_sock>) { print $_; } t

Re: references and printing

2002-11-14 Thread Paul
--- Julien Motch <[EMAIL PROTECTED]> wrote: > #The next line printsd the reference why ? > print("the host which you are connecteed to is $pop->Host()\n"); # > Mail::POP3Client=HASH(0x8153a8c)->Host() Inside the quotes, the -> operator is taken as printable characters. Just take the method call o

RE: Sockets....

2002-11-14 Thread Sorrells, Dave
A little clarification of the problem. The line "test" does not get printed at the server. Dave Sorrells ciber Office: (585) 231-2071 Cell: (585) 755-9015 Email: [EMAIL PROTECTED] Text Messaging: [EMAIL PROTECTED] AIM: Dave Ciber -Original Message- From: Sorrells, Dave [mailto:Dave.Sorr

restarting a processing using -HUP

2002-11-14 Thread Chaudhary, Haseeb
I'm trying to restart a process using Perl without actually stopping it. On a solaris command line I would normally grep for the process ID and then -HUP the process eg. bash-2.03# ps -ef | grep icmp root 11083 292 12 Nov 08 ? 1302:03 /opt/Omnibus/monitors/sola

references and printing

2002-11-14 Thread Julien Motch
Hi , There is one thing I could not explain about printing references . Take this little program : #!/usr/bin/perl use Mail::POP3Client; $pop = new Mail::POP3Client(HOST => "pop.skynet.be"); print $pop->Host(); #OK print pop.skynet.be print "\n"; #The next line printsd the reference why

Sockets....

2002-11-14 Thread Sorrells, Dave
Hey all, I'm trying to learn a bit about Perl sockets. I got these simple client/server scripts from http://www.perlfect.com/articles/sockets.shtml and I can't even get them to work. When I run the client against the server I get no output at the server. The "Socket defined" line does get printed s

Re: random strings

2002-11-14 Thread Dave K
Another Way use strict; my @Ary = qw ( a b c d e f g h ); for(@Ary) { print; } print"\n"; fisher_yates_shuffle(\@Ary); for(@Ary) { print; } print"\n"; sub fisher_yates_shuffle { my $array = shift; my $i; for ($i = @$array; --$i; ) { my $j = int rand ($i+1); next if $i == $j;

Re: running a perl script in an other one ?

2002-11-14 Thread Paul
--- Olympio Raymond <[EMAIL PROTECTED]> wrote: > Hi everybody, > I'm a new in perl programming so i hope you won't find my question > too stupid. I have to run a some user-defined functions, but i don't > want to include them in only one script. So, is it possible to run a > perl script into an ot

Re: random strings

2002-11-14 Thread Frank Wiles
.--[ Tom Allison wrote (2002/11/14 at 09:45:42) ]-- | | How can create a random string, similar to MD5 hash, but with a | much smaller number of characters? Maybe 8 characters.. | `- Here is one idea: my @letters = ('a

Re: nslookup script

2002-11-14 Thread Ramprasad A Padmanabhan
I think you want Net::DNS::Resolver Brice Mason wrote: Hello, I would like to write a program in Perl that can perform zone transfers using nslookup in a Windows environment. I assume the best way to implement this is using nslookup in interactive mode since I'm not trying to query just

random strings

2002-11-14 Thread Tom Allison
How can create a random string, similar to MD5 hash, but with a much smaller number of characters? Maybe 8 characters.. -- You're growing out of some of your problems, but there are others that you're growing into. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [E

RE: fork?

2002-11-14 Thread Paul
> I appreciated the help. But the perl code in the elsif statement > still doesn't execute until the perl code in the if statement. > Any other suggestions? I'd like the two perl codes to execute at > the same time. > Maybe fork can't do this.. I think you may be misunderstanding what fo

nslookup script

2002-11-14 Thread Brice Mason
Hello, I would like to write a program in Perl that can perform zone transfers using nslookup in a Windows environment. I assume the best way to implement this is using nslookup in interactive mode since I'm not trying to query just one host but get the entire domain? How do I track a session with

RE: fork?

2002-11-14 Thread chad kellerman
Daryl, I appreciated the help. But the perl code in the elsif statement still doesn't execute until the perl code in the if statement. Any other suggestions? I'd like the two perl codes to execute at the same time. Maybe fork can't do this.. THanks, Chad On Wed, 2002-11-13 at 15:40

Re: Extracting email adresses from a flat text file

2002-11-14 Thread Paul Johnson
Leon Dippenaar said: > Can anybody just give me a quick example of how one would go about doing > this? I am on the verge on insanity and I might already be over that > edge. > > The input file contains names and email addresses. > > The output file with all the names & addresses must be comma del

RE: running a perl script in an other one ?

2002-11-14 Thread wiggins
The other poster was correct about system, exec, and backticks. But I take your meaning to be about including a library of functions that have been written but that you want to use in different places? You should look at documentation on 'use' and on 'require'. perldoc -f require perldoc -f us

Re: Extracting email adresses from a flat text file

2002-11-14 Thread Jean Padilla
try this: #!/usr/bin/perl -w use strict; my $if = "path_to_input_file"; my $of = ">path_to_output_file"; my ($name, $addr); open(IF, $if) or die "Can't open file $if for reading\n"; open(OF, $of) or die "Can't open file $of for writing\n"; while () { chomp; (undef,$name,undef,undef,undef,unde

RE: Extracting email adresses from a flat text file

2002-11-14 Thread wiggins
perldoc -f open perldoc -f split That's a push in the right direction ;-), but not a very hard one. http://danconia.org On 14 Nov 2002 14:41:08 +0200, Leon Dippenaar <[EMAIL PROTECTED]> wrote: > Can anybody just give me a quick example of how on

checking for special chars in a string

2002-11-14 Thread Ramprasad A Padmanabhan
Hello all, I am sure this must have been asked before But I cant find it How do I find if $str has any special chars ( I mean above 127 in the ascii range ) I do not want to do an ord of each character like while($str=~/(.)/g) { return('found') if(ord($1) > 127) } Thanks Ram -- To unsubscri

Weekly list FAQ posting

2002-11-14 Thread casey
NAME beginners-faq - FAQ for the beginners mailing list 1 - Administriva 1.1 - I'm not subscribed - how do I subscribe? Send mail to <[EMAIL PROTECTED]> You can also specify your subscription email address by sending email to (assuming [EMAIL PROTECTED] is your email address):

Extracting email adresses from a flat text file

2002-11-14 Thread Leon Dippenaar
Can anybody just give me a quick example of how one would go about doing this? I am on the verge on insanity and I might already be over that edge. The input file contains names and email addresses. The output file with all the names & addresses must be comma delimited and listed one address per

Re: running a perl script in an other one ?

2002-11-14 Thread Jan Gruber
Hi, On Thursday 14 November 2002 12:43, Olympio Raymond wrote: > So, is it possible to run a perl script into an other one ? You can use either system() or exec(). The difference is, that exec() doesnt return to the calling script, which basically means, your script will end after calling th

Re: How to get a vi like editor during STDIN

2002-11-14 Thread Harry Putnam
Steve Grazzini <[EMAIL PROTECTED]> writes: >> Example can be seen by invoking ksh (88 or 93) like: >> >> ksh read line >> >> During input, vi like editing is possible. > > Check Term::ReadLine. > > I'll bet the Gnu readline (Term::ReadLine::Gnu ?) can > do emacs and vi keystrokes, but I could be

running a perl script in an other one ?

2002-11-14 Thread Olympio Raymond
Hi everybody, I'm a new in perl programming so i hope you won't find my question too stupid. I have to run a some user-defined functions, but i don't want to include them in only one script. So, is it possible to run a perl script into an other one ? Thanks -- To unsubscribe, e-mail: [EMAIL PR

Re: Hacking my IIS

2002-11-14 Thread saffiot
Anadi Taylor wrote: Hi all, I have a question that is unrelated to perl, the only reason I am asking you is because of the help I have recieved from you all with my perl related questions. I hope you can be as helpfull in helping me to resolve this issue. I am running a Windows server (I know

Hacking my IIS

2002-11-14 Thread Anadi Taylor
Hi all, I have a question that is unrelated to perl, the only reason I am asking you is because of the help I have recieved from you all with my perl related questions. I hope you can be as helpfull in helping me to resolve this issue. I am running a Windows server (I know a lot of you dont lik

Re: push'ing items onto an array

2002-11-14 Thread Paul Johnson
David Buddrige said: > #!/usr/bin/perl use strict; use warnings; > @c_files; > @h_files; > > foreach $arg ( @ARGV ) > { > if ( $arg =~ /\w\.[Cc]/ ) > { > push @c_files ($arg); push @c_files, $arg; > } > if ( $arg =~ /\w\.[hH]/ ) > { > push @h_files

RE: push'ing items onto an array

2002-11-14 Thread Beau E. Cox
Hi - My guesses (untested): @c_files; @h_files; foreach $arg ( @ARGV ) { if ( $arg =~ /\w\.[Cc]/ ) { - push @c_files ($arg); + push @c_files, $arg; } if ( $arg =~ /\w\.[hH]/ ) { - push @h_files ($arg); + push @h_files, $arg; } } Function pus

Re: query string into hash?

2002-11-14 Thread Ramprasad A Padmanabhan
I had long back written this function # CGI2Hash # Converts a CGI object into a hash array # # # prototype CGI2Hash($ques,\%vals) # # $ques - the CGI Object # \%values - the returned array with the field names as keys # # sub CGI2Hash { my($ques, $values) = @_; my

RE: accessing ACCESS database

2002-11-14 Thread Beau E. Cox
Thank you for correcting me Douglas - I have worked exclusively with DBI. It's good to learn something new! Aloha => Beau. -Original Message- From: Douglas Gardiner [mailto:dgardiner@;houston.rr.com] > Hi - > > I have never heard of the "Sql" method in DBI. Something like this works:

getting only domain names from list

2002-11-14 Thread Ramprasad A Padmanabhan
Hello all, I have a list from a logfile that has urls browsed. I have to extract all domainnames considering subdomains as the same as the domainnames eg @list = qw( yahoo.com mail.yahoo.com hotmail.com yahoo.co.in cnn.co.uk news.cnn.co.uk) I would like to write a function that will give

Fwd: code ref and objects

2002-11-14 Thread todd shifflett
I have not had a chance to try this yet but it sounds very promising. Begin forwarded message: From: "Jeff 'japhy' Pinyan" <[EMAIL PROTECTED]> Date: Wed Nov 13, 2002 2:02:59 PM US/Pacific To: [EMAIL PROTECTED] Subject: Re: code ref and objects On Nov 13, todd shifflett said: the above works.

Re: date

2002-11-14 Thread Gary Stainburn
On Wednesday 13 Nov 2002 5:10 pm, Aman Thind wrote: > Hi Ray > > $sec = (localtime())[0]; > $min = (localtime())[1]; > $hour = (localtime())[2]; > print "Time => $hour : $min : $sec\n"; > > $day = (localtime())[3]; > $month = (localtime())[4] + 1; > $year = (localtime())[5]; > $year = $year + 1900;

Can this please be deleted from this website?

2002-11-14 Thread Coppi Nikula
I need help writing a hash of an array , Coppi Nikula <2002-07-02>

push'ing items onto an array

2002-11-14 Thread David Buddrige
Hi all, I have written a program (listed at the end of this email) which is designed to examine the arguments to the program and sort them into .C files and .H files and then print them out together. It (attempts) to do this by adding each .C file or .H file into an array @c_files or @h_files

Re: code ref and objects

2002-11-14 Thread debraj bhattacharyya
Hi Can u do the following change Use local instead of my my is defined only within its scope.i.e subfunction..it is not recognised elsewhere. c if it works thanx - Sify Mail - now with Anti-virus protection powered by Trend Micro, USA. Know mor