Re: Continuing a while loop

2001-09-20 Thread Me
> I need the code below to execute the sub double_check($host) but I still > want the while loop to continue exactly what it's doing. > > Is this possible with Perl|? > > while (1) { > $p = Net::Ping->new("icmp", 4, 2); #Ping object. Uses icmp > protocal > foreach $host (sort keys (%host

Continuing a while loop

2001-09-20 Thread Daniel Falkenberg
List, I need the code below to execute the sub double_check($host) but I still want the while loop to continue exactly what it's doing. Is this possible with Perl|? while (1) { $p = Net::Ping->new("icmp", 4, 2); #Ping object. Uses icmp protocal foreach $host (sort keys (%host)) {

RE: REGEX Premath $`

2001-09-20 Thread Gary MacDonald
It's tough to figure out what you're trying to accomplish, since the "i" modifier on the regex doesn't make any sense, but if you want the "g" modifier to cause repeated passes on the string, then you need to place the regex in its own loop. Something like this: while () { print WRITE "'

Re: autovivification of typeglobs

2001-09-20 Thread Atul_Khot
Thanks a lot for such a clear explanation. Now it all seems to fall in place (: and obviously, obvious :). - warm regards, LFTLMFY (: Looking Forward To Learning More From You, that is :) Atul Michael Fowler <[EMAIL PROTECTED]> 09/20/01 01:02 PM To: [EMAIL PROTECTE

Re: zen and the art of perl

2001-09-20 Thread Casey West
On Sep 19, 2001 at 10:35 -0700, Matthew Peter Lyon took the soap box and proclaimed: : This group just needs to really calm down. Yes, and this thread is quite off topic and quite finished. Casey West -- Shooting yourself in the foot with troff rmtroff -ms -Hdrwp | lpr -Pwp2 & .*place bulle

perl and ftp

2001-09-20 Thread Sofia
I want to connect to an FTP server and get some files. I found the "Being an FTP Client" document in the Perl Cookbook which has the following lines: $ftp = Net::FTP->new("ftp.host.com") or die "Can't connect: $@\n"; $ftp->login($username, $passwd) or die "Couldn't login\n"; My question is: Do

GDBM_File problems

2001-09-20 Thread Michael D. Risser
I'm writing a script which will convert the gdbm files used by wreq to the MySQL files used by BugZilla, but am having a serious problem. I can't seem to open the gdbm files for reading. Here's where the problem is: # !/usr/local/bin/perl -w use diagnostics; # A bunch of currently undefined

DBI Limitations Urgent

2001-09-20 Thread SAWMaster
I'm not sure what you mean by DBD, but in case I'm right...lol I'm using MS Access from Office 97 on a Windows 98 server running Apache. My code works fine unless I go over 6 in my select statement ie.: $sqlstatement="SELECT pid, name, description, picture, price, sold FROM gallery ORDER BY

get & cache

2001-09-20 Thread Cohan, Drew
hi, offhand does anybody know if get ($url) does any sort of cacheing of the contents of the url? if it does, how do you turn cacheing off? thanks, -- drew [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: autovivification of typeglobs

2001-09-20 Thread Michael Fowler
On Thu, Sep 20, 2001 at 11:37:50AM -0500, [EMAIL PROTECTED] wrote: > I think you lost the context. I was afraid of that. > My question is not whether %$$self and self are same ( They are not and > %$this was never a point of debate ). I wanted just the explanation of > using %$$self in the ***

Re: aanother simple question

2001-09-20 Thread Michael Fowler
Some minor corrections. On Thu, Sep 20, 2001 at 10:46:27AM -0400, Brian wrote: > When comparing a variable with a string you must use 'eq'. So your > example would look like: When comparing a string with a string, you should always use 'eq'. That it's in a variable is irrelevant. > if($host

Weekly list FAQ posting

2001-09-20 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)

Re: evaluating a pattern before matching

2001-09-20 Thread Michael Fowler
On Thu, Sep 20, 2001 at 05:22:14PM +0530, Surarchitha Kumar Kudikyala wrote: > I have a doubt whether it is possible to evaluate a pattern before using > it in the pattern matching. > > For eg > > string =~ /$pattern/ > > here $pattern is a pattern string contains some perl commands like > len

RE: reg exp

2001-09-20 Thread Bob Showalter
> -Original Message- > From: David Draley [mailto:[EMAIL PROTECTED]] > Sent: Thursday, September 20, 2001 12:35 PM > To: [EMAIL PROTECTED] > Subject: reg exp > > > hello - > > I am trying to search a for any sentence that ends in > "." or "?" I > want to only print those sentences t

RE: structure of scripts (newbie Q)

2001-09-20 Thread Bob Showalter
> -Original Message- > From: Stephan Tinnemeyer [mailto:[EMAIL PROTECTED]] > Sent: Thursday, September 20, 2001 9:22 AM > To: [EMAIL PROTECTED] > Subject: structure of scripts (newbie Q) > > > I hope I did not overread this in the FAQ: > > In some tutorials I found the recommendation to

Re: autovivification of typeglobs

2001-09-20 Thread Atul_Khot
I think you lost the context. My question is not whether %$$self and %$self are same ( They are not and this was never a point of debate ). I wanted just the explanation of using %$$self in the *** context of *** autovivifying typeglobs. What I really don't understand is how to interpret the %

looking for tips on using global objects

2001-09-20 Thread Ruth Albocher
Hi all. I am writing an application in perl and I would like to have it print things out into global 'Report' objects(warning, error, result reports etc). In general, I like to think of my reports as tools the applications uses constantly, but are not a part of it. Well, creating instances of t

RE: aanother simple question

2001-09-20 Thread Brian
When comparing a variable with a string you must use 'eq'. So your example would look like: if($host eq 'access_1') { $host1 = 'ACESSO 1'; } elseif($host eq 'access_2') { $host1 = 'ACESSO 2'; } When using == with a string, it will always be true. Hope this helps you. NOTE: I didn't reall

Re: functions in arrays

2001-09-20 Thread Jeff 'japhy/Marillion' Pinyan
On Sep 20, Geert Neuts said: >for ($i = 0; $i < @stuff; $i++) { > print "$stuff[$i][0] ($stuff[$i][1])\r\n"; >} $stuff[$i][1] is just a reference to the function. To actually call it, you'll need to use &{ $stuff[$i][1] } or $stuff[$i][1]->(); However, neither of those expands in a

Re: Any feature equivalent to Macros of C?

2001-09-20 Thread Jeff 'japhy/Marillion' Pinyan
On Sep 20, G Lakshmi said: >if (index($OSNAME,"Win",0) > -1) >{ >use Win32::Process; >} That will ALWAYS try to include the Win32::Process module, regardless of the rest of your program. 'use' statements are executed at compile-time, while the rest of the code is executed at run-time. You'll w

functions in arrays

2001-09-20 Thread Geert Neuts
Can I put functions in arrays to make flexible menus ? I tried this : @stuff = (["menu 1", \&func_1], ["menu 2", \&func_2], ["menu 3", \&func_3]); for ($i = 0; $i < @stuff; $i++) { print "$stuff[$i][0] ($stuff[$i][1])\r\n"; } sub func_1 { print "function 1 called\n

evaluating a pattern before matching

2001-09-20 Thread Surarchitha Kumar Kudikyala
Hi   I have a doubt whether it is possible to evaluate a pattern before using it in the pattern matching.    For eg   string =~  /$pattern/   here $pattern is a pattern string contains some perl commands like lenght(str) etc. I want these commands to be evaluated, and the result of this evalu

Re: Where does Makefile.PL pick up include paths from?

2001-09-20 Thread Pete Sergeant
I don't know the answer to your question, but... You can download the PPM files seperately from activestate: http://www.activestate.com/PPMPackages/zips/5xx-builds-only/ You can then use PPM to install them, but I think that part's covered in the readmes. "Reg Smith" <[EMAIL PROTECTED]> wrote i

Re: Any feature equivalent to Macros of C?

2001-09-20 Thread Pete Sergeant
> It works fine on Windows NT. On Solaris, it gives the foll error message: > > Can't locate Win32/Process.pm in @INC (@INC > contains: /usr/perl5/5.00503/sun4-so > laris /usr/perl5/5.00503 /usr/perl5/site_perl/5.005/sun4-solaris > /usr/perl5/site > _perl/5.005 .) at sim.pl line 3. > BEGIN failed

Re: Pattern matching problem

2001-09-20 Thread Pete Sergeant
Some other notes... You don't have to use printf - you can use print. And you don't need the brackets, or the inverted commas around $path: if ($path =~ m/^\$/) { print "Path is env var\n"; } else { print "Working on phys.dir\n"; } > > if ( "$path" =~ /^$/ ) { > >printf("p

Still problems with bind param

2001-09-20 Thread Lothar Behrens
Hello, I searched the internet for any solution about binding parameters to the SQL statement. I read something, that in WIN32ODBC, binding parameters is not supported. I have the following environment: W2K TS, Activestate Perl, WIN32ODBC driver. I use this statements: $sql = "insert into $ta

RE: :dns module

2001-09-20 Thread John Edwards
Do you have access to a DNS server feom your machine? Run nslookup from the command prompt. Does it return the name of a DNS server, or does it say something like "default servers are not available". That could be your problem if it's timing out. John -Original Message- From: Vasileios

net::dns module

2001-09-20 Thread Vasileios Delis
Hi there trying to understand the module I tried the following example (also in the module'es refrence): use Net::DNS; $res = new Net::DNS::Resolver; $res->debug(1); $query = $res->search($ARGV[0]); if ($query) { foreach $rr ($query->answer) { next unless $rr->type e

Re: cgi-lib.pl

2001-09-20 Thread Murtini
You might want to even try this site... ( I found it very useful as a starter to CGI.pm) http://stein.cshl.org/WWW/CGI/ Cheers, Murtini - Original Message - From: "Singh, Harpreet" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, September 20, 2001 10:38 AM Subject: cgi-lib.p

Any feature equivalent to Macros of C?

2001-09-20 Thread G Lakshmi
Hi, I tried the following script: if (index($OSNAME,"Win",0) > -1) { use Win32::Process; } It works fine on Windows NT. On Solaris, it gives the foll error message: Can't locate Win32/Process.pm in @INC (@INC contains: /usr/perl5/5.00503/sun4-so laris /usr/perl5/5.00503 /usr/perl5/site_pe

Re:Regular Expression needed?

2001-09-20 Thread Jorge Goncalvez
Hi, folks I have 5 labels in a perl tk program. I have this line in my file: 1000975996: 44CGMB0114.col.bsf.alcatel.fr: read request for /bootp/cygwin.bat: success . my code is : open FILE, "< $SYSLOG" or die $!; while () { if (/([0-9a-z:]+)\s*via eth0/) {

Re: Pattern matching problem

2001-09-20 Thread Sudarsan Raghavan
/^$/ matches a blank line, /^\$/ will do the job for you. $ is a metacharacter, you will have to escape it. It matches at the end of a line or before newline at the end. hth. Sudarsan Tanya Bar wrote: > > Path could be physical or start with environment variable; so in my script > I'm trying

Re: line editing

2001-09-20 Thread reg . smith
Hello Chia Using the ... range operator appears to do what you want, if I understand correctly; open(FILE,"input.txt"); while (){ print if !(/^\.SUBCKT (\S\S)/ ... /^\.ends $1/); } This print lines that don't fall between lines that match the two patterns My test file input.txt was like th