Re: Can anyone comment on "Sams Teach Yourself Perl in 21 Days" ?

2009-03-13 Thread Deviloper
This books tend to teach programming (the syntax of a programm language), not software development. Thats a big issue in the whole it-world. Everybody who can read a shell-skript and work with an text-editor calls himself a software developer. A software developer has to know much more then a h

Regexp-Question: What is backtracking?

2009-03-12 Thread Deviloper
This may sound a little bit stupid, but I never ask about "what is up with this regexps behind the curtain". I was lucky when they did what I was expecting... But I´m getting old and want to know more. Can somebody explain what Backtracking is? thanx, B.

Re: How to release memory?

2009-03-05 Thread Deviloper
Do you ever join your threads? Which Perl-Version do you use? Try update to the latest. Threads had memoryleaks and might till have some. Bye, B.

RegExp Problem using Substitutions.

2009-02-24 Thread Deviloper
Hi there! I have a string "bbbababbaaassass". I want to get a string without any double a 'aa' or and without the 'b's. but if I do: my $s = "bbbababbaaassass"; $s=~ s/aa|b//g; as a result I will get a string "aaassass". (I understand WHY I get this result. But I don´t know how to av

How to find the modul a functions originates.

2009-01-15 Thread Deviloper
Hi, is there an easy why to determit from which package/modul a function/methode is used? I have the case of a very long inheritance chain and don´t know how to figure out the modul where a function has its source. Thanks, B.

Re: lawyer --- new to coding

2008-12-08 Thread Deviloper
Hey, If you are "looking" for a not so hard but very interessting project, then write a tool that lookup the internet (via regex and google see cpan.org) for the latest news/lawsuites of your profession in law. You could write a demon/service, putting all the available information on a lawsuite(?

Special Var with Name of current scope or name of subroutine?

2008-12-02 Thread Deviloper
Hi! Is there a special variable or trick to get the name of the current scope or subroutine name? Thanks, B.

Re: wait for file creation and wait

2008-11-26 Thread Deviloper
How time-critical is it? is it time-critical as an nuclear chain reaction or time-critical like cooking a gumbo? until ( -e $file) {   sleep(1); } If the resultion of 1 sec is not good enough use time::hires... "Mr. Shawn H. Corey" <[EMAIL PROTECTED]> hat am 26. November 2008 um 16:20 geschr

Re: system command

2008-11-26 Thread Deviloper
It will wait. This behaviour is called "blocking". If you want to just start it and the go on in your code "non-blocking" or If you want to do some tasks "at the same time", you should take a look at fork, threads or easier Proc::ParallelLoop. But If the bottleneck is your computingpower, this wi

Re: which module is suitable for logging into cisco devices

2008-11-23 Thread Deviloper
There are some moduls I use under linux. Problem is that Cisco CLI may change prompt. Checkout Net::SSH and Perl Expect. (Also there is a Modul called Net::SSH::Expect, which I had not tried yet.) You may need to install Cygwin. This gives you a lot of linux utils. HaveFun, B.   monnappa appai

MySQL statement with REGEX / RLIKE containing a scalar variable possible?

2008-11-13 Thread Deviloper
I have a SQL-Statement with a Regular Expression and I want to use a scalar in that expression: (Looking for something like "$tool =~ m/\Q$x\E/" ) #Find tools with xx in the name: $dbh->prepare ("SELECT name FROM toolbox WHERE name REGEX '$x'"); #or $dbh->prepare ("SELECT name FROM toolbox

eval, ualarm and IO::Socket

2008-10-21 Thread Deviloper
Hi there, I just wanted to ask if somebody has implementet an "nonblocking" socket reader, which uses Time::HiRes ualarm() function (or nativ perls alarm function) to break the "waiting on data in socket (if the socket has no data)" after a view microsecond... (in eval block) then do something el

Re: translate IP mask

2008-10-16 Thread Deviloper
Net::Netmask does such things, too. "John W. Krahn" <[EMAIL PROTECTED]> hat am 16. Oktober 2008 um 12:57 geschrieben: > Sandy lone wrote: > > I need to translate an IP addr with its mask from this form: > > > > 192.168.1.30/255.255.255.0 > > > > to this one: > > > > 192.168.1.30/24 > > One w

eval and script performance ?

2008-10-16 Thread Deviloper
The last time I considered using eval is years ago. I remember that I had read an article somewhere that doing eval could lead to dramatic performance issues. I want to use eval{} to check my db-transactions. I looking for informations at perldoc eval, but there is nothing mentioned about perfo

Re: Log::Log4perl

2008-10-16 Thread Deviloper
If this helps: I am using Log4Perl in a typical forked-to-background-daemon. I had to do a little thinking to figure out the best place to initialize Log4Perl. The problem is, that the utilized shared vars lost their sharedness in the child proc. Maybe you have to initialize your Log4Perl-Obje

Optimizing DBI script design?

2008-10-14 Thread Deviloper
I am doing a script which updates data sets of thousands of customers on a regular base. (Volume data managemed.) This should be near realtime, so the customers know, how much data they transmitted and how much they have to pay. Because of the type of traffic measurement the input comes in block

Re: Simplest Daemon ?

2008-10-14 Thread Deviloper
IO::Socket::INET does what you want I guess there are more moduls, with more functionality regarding http @ cpan. Detailed tutorials how to build a daemon process are in the internet. (At least 5-10 very detailed, very good.) Else: Buy a copy of "Networkprogramming with Perl" written by my

Re: Check the DB-handle status.

2008-10-13 Thread Deviloper
executed. Thanks for the info on quoting. D. Jenda Krynicky <[EMAIL PROTECTED]> hat am 13. Oktober 2008 um 15:10 geschrieben: > From: Deviloper <[EMAIL PROTECTED]> > > in the early days of the dbi-modul there was a function $dbh->ping(). > > nearly no driver ever

Check the DB-handle status.

2008-10-13 Thread Deviloper
Hi there, in the early days of the dbi-modul there was a function $dbh->ping(). nearly no driver ever implemented it. I want to check the status of my db, in my daemon on a regular base. I could not find any standard solution. Today I´m just doing a query and check then if there where errors.

Re: Concerning passing refs of anonyme Hash to subs...

2008-10-10 Thread Deviloper
don´t like writing input checks for every methode, too^^) Hope to see c++/java like polymorphism some day in perl. "John W. Krahn" <[EMAIL PROTECTED]> hat am 10. Oktober 2008 um 12:18 geschrieben: > Deviloper wrote: > > Hi there, > >

Re: Bug in Perl

2008-10-10 Thread Deviloper
or to be nearer to what he/she wanted to do just: while ($i < 0.8) {  #do something which changes $i } "Dr.Ruud" <[EMAIL PROTECTED]> hat am 10. Oktober 2008 um 11:27 geschrieben: > Rob Dixon schreef: > > anilfunde > > >>   for($i=0;$i<0.8;$i=$i+0.1) > >>      { > >>         print "$i\n"; > >> 

Concerning passing refs of anonyme Hash to subs...

2008-10-10 Thread Deviloper
Hi there, have a look at this example: #!/usr/local/bin/perl use strict; use warnings; my $a_hash = { hund => "Dogge",               katze => "Perser",               obst => "Banane"               }; sub test($){   my $x = shift;   print

Re: Perl Sockets oddity..

2008-09-24 Thread Deviloper
meh

Re: Perl Sockets oddity..

2008-09-24 Thread Deviloper
; print "Connected.\n"; > > $socket->print("|"); > > while ($socket->recv($text,128)) { >     print q{$text}; > } > > However, I still dont see any text, with or without the q{} > > Thanks.. > > Andy > > > On 24 Sep 2008,

RE: Perl Sockets oddity..

2008-09-24 Thread Deviloper
Try unbuffer IO, this might be on off the Problem. $| = 1; the don´t do: > > while (true) { > >          $socket->recv($text,128); > >          print $text; > > } do > > while ($socket->recv($text,128)) { > >          print $text; > > } Byebye, Bo Stewart Anderson <[EMAIL PROTECTED]> hat am

Re: Identify an UPD source

2008-09-22 Thread Deviloper
Ok, that was easier then I had expected. The undocumented methode $sock->peerhost() will return the "human readable" ip-address of the current datagram. Thanks, Bo Deviloper <[EMAIL PROTECTED]> hat am 22. September 2008 um 10:16 geschrieben: > Hi there, > > I

Identify an UPD source

2008-09-22 Thread Deviloper
Hi there, I got a question regarding IO::Socket. I am using IO::Socket to receive UPD datagrams from a number of hosts. It works fine, but I can´t figure out how to tell which host (and from which port) the datagram was send. I don´t want to change the packet data. Here is a code snipplet of wh

Re: talking to an IMAP server with perl

2008-09-11 Thread Deviloper
There are a LOT of Moduls at cpan to talk with IMAP-Accounts & Servers, so I guess developing a tool with your needs should not be such a large problem. (You don´t have to tell your boss.) (Some of this moduls only do the basic stuff.) http://search.cpan.org/author/MARKOV/Mail-IMAPClient-3.10/l

Re: trying to use regex(s) to clean up text

2008-09-11 Thread Deviloper
There are online RegEx-Utilities that helps you building regex. There are some modul with many common regex to steal from or just import. (Regexp::Common) And there is ActiveState Perl Editor with a 30 Trail and a great "realtime" RegEx-Tool and Debugger. If nothing else helps take a look at per

Re: Fetching "n" number of records at a time in Perl DBI !

2008-09-11 Thread Deviloper
I guess thats a task you can achieve with the correct sql-statement. Have a look at http://www.adp-gmbh.ch/ora/sql/examples/first_rows.html. How you can implement an sql-query that give you the results you need, depends on how the data in your db looks like. If you have a fixed index number for