Re: how to can measure my level of knowledge?

2024-05-31 Thread Rob Coops
Hi William, Here are my two cents after nearly 30 years of writing code in many different languages. Writing in any functional language is exactly the same as in every other functional language. The easiest way to learn and improve is by learning to break down your problem into manageable steps.

Re: [getting PAUSE account]

2024-01-02 Thread Rob Coops
Just my two cents on this. There is no sense in putting one language over another if it is for personal use. In those cases use what you want and what you feel is best suited to your needs. You might Choose Perl as you are familiar with it and you need to process lots and lots of text for your pro

Re: Preference

2023-10-30 Thread Rob Coops
In this day and age Kotlin is probably your best bet but if you take on Java you are 90% there with regards to Kotlin. As for Perl, unless you are in a very specific niche Perl is pretty much dead as a commercially viable option as there are too few people that are halfway decent at it so no compan

Re: Please help: perl run out of memory

2022-04-18 Thread Rob Coops
Hi Wilson, Looking at the script I see some room for improvement. You currently declare %hash as a global variable, and keep it around forever. With tens of millions of rows that is quite a large structure to just have sitting around after you have build the %stat hash. So I would start by limitin

Re: question about perl script

2019-10-30 Thread Rob Coops
This should do: #!/usr/bin/perl use strict; use warnings; open my $a, '<:encoding(UTF-8)', 'a' or die "Unable to open a: $!"; open my $b, '<:encoding(UTF-8)', 'b' or die "Unable to open b: $!"; my %pair = (); while ( my $line = <$a> ) { my @line = split(" ", $line); $pair{$line[0]} = 1; }

Looking for a lightweight usable websocket server

2015-05-18 Thread Rob Coops
Hi all, I'm working on a simple (or so I thought) project to build a websocket server that broadcasts data the server receives via a telnet connection. So a telnet connection is easily setup and messages are simple to relay to any file handle. But now comes the harder part. A websocket server se

Re: obfuscating code

2013-02-13 Thread Rob Coops
Are we really spiraling into a discussion on the merits of open versus closed source? Perl is a scripting language, it was create by a linguist which it is why it allows for so many different ways to get the code to do the same thing. It is like a language very flexible in many ways. Obfuscating c

Re: obfuscating code

2013-02-12 Thread Rob Coops
Hi Bob, The problem with obfuscation is that if does not work. No mater how far you go (all database tables are called T with every column being C) all variables being single letter things like $a and @a and %b one that wants to will always be able to read it. The only thing that you are going to

Re: Date::Manip question

2012-11-08 Thread Rob Coops
On Thu, Nov 8, 2012 at 12:53 PM, Rob Coops wrote: > > On Thu, Nov 8, 2012 at 11:56 AM, Marco van Kammen > wrote: > >> Hi List, >> >> ** ** >> >> For a logrotation and cleanup script I want to fill the following >> va

Re: Date::Manip question

2012-11-08 Thread Rob Coops
= $months[$mon]; my $current_mont_num = $mon; my $previous_month = $months[$mon -1]; my $previous_month_num = $mon -1; print "$current_month\n$current_mont_num\n$previous_month\n$previous_month_num\n"; Easy enough and without a module needed a lot more portable without a lot of work. Regards, Rob Coops <><><><><><>

Re: Fast XML parser?

2012-10-31 Thread Rob Coops
rl.org/ > > > The memory issue is really an issue of the module it self I have had those problems as well, the more complex the xml structure the more memory it takes up and the faster you will run out. I simply moved on to other modules as I could not afford to spend my time on trying to figure out a workaround. Regards, Rob Coops

Re: Fast XML parser?

2012-10-29 Thread Rob Coops
On Mon, Oct 29, 2012 at 9:18 AM, Shlomi Fish wrote: > On Mon, 29 Oct 2012 10:09:53 +0200 > Shlomi Fish wrote: > > > Hi Octavian, > > > > On Sun, 28 Oct 2012 17:45:15 +0200 > > "Octavian Rasnita" wrote: > > > > > From: "Shlomi Fish" > > > > > > Hi Octavian, > > > > > > > > > > > > Hi Shlomi, >

Re: Using alarm

2012-10-26 Thread Rob Coops
On Fri, Oct 26, 2012 at 4:46 PM, Unknown User wrote: > I have code that goes something like this: > > > my $start = time(); > my $delay = 60; > ... > > while (my $line = <$fh>) { > my $err; > ... > ... > my $timenow = time(); > if ( $timenow - $start >= $delay ) { >

Re: My script is...

2012-09-14 Thread Rob Coops
sure it will) have a look at the Perl version your provider is using and make sure that you are using the same version as well there might be a difference there. Regards, Rob Coops

Re: hash of arrays sorting

2012-08-23 Thread Rob Coops
On Thu, Aug 23, 2012 at 9:10 AM, Uri Guttman wrote: > On 08/23/2012 02:54 AM, Salvador Fandino wrote: > > >>> It's a pity Sort::Maker not in Debian >>> >> >> There is also Sort::Key, available in Debian testing and unstable, and >> which is usually faster than Sort::Maker and also Sort::Key::Radi

Re: How to format the data ??

2012-08-22 Thread Rob Coops
On Wed, Aug 22, 2012 at 4:39 PM, jet speed wrote: > Hi All, > > Please advice me on now to capture the data below in the format as below. > > i thought of using hash, but then the problem is each DisplayDevNum has > multiple WWN. some has 4 elements, some has 2. Any other method ? > Apprecaite y

Re: search and replace

2012-08-16 Thread Rob Coops
On Thu, Aug 16, 2012 at 10:55 AM, Gergely Buday wrote: > Here is the correct version: > > #!/usr/bin/perl > > $csproj_text = "C:\\build.txt"; > > $csproj_text =~ s/\\//g; > print "$csproj_text\n"; > > Notice that in order to put a literal backslash into a perl string, > you should escape it.

Re: case statement in perl

2012-08-01 Thread Rob Coops
On Wed, Aug 1, 2012 at 9:08 AM, Paul.G wrote: > The example below is just a test, I need to be able to insert multiple > values into a command, those values can be either 1, 2 or upto 5. > > Below is closer to the working example, but I will read that document and > to help make a final decision.

Re: read file attributes

2012-07-30 Thread Rob Coops
On Mon, Jul 30, 2012 at 1:24 PM, Irfan Sayed wrote: > hi, > > i need to access the attributes of file. > more precisely, i need to check if the file is digitally signed or not > > > for example; if i right click on file, then i need to check if the > "digital signature" tab is there or not for tha

Re: How to zip all files which are value from awk command ?

2012-07-26 Thread Rob Coops
On Thu, Jul 26, 2012 at 12:05 PM, Jack Vo wrote: > Hi all, > > I need to compress many files in a directory on server. I use "awk" and > "zip" command to compress these files. > > By "awk" command, I filter theses file : > >> *# ls -latr | grep iMAP.med0 | awk '{print $9}'* >> iMAP.med0101_agent.

Re: Multiprocessing script

2012-07-26 Thread Rob Coops
On Thu, Jul 26, 2012 at 11:01 AM, Shlomi Fish wrote: > Hi Punit, > > a few comments on your code. > > On Thu, 26 Jul 2012 10:17:13 +0530 > punit jain wrote: > > > Hi, > > > > Below is my script where alarm is generated after 15 sec and changes the > > global variable in parent from 0 to 1. Is the

Re: Sluggish code

2012-06-11 Thread Rob Coops
simply take the value in your file and see if it has a matching key in the hash (a lot faster then your way). As you are only comparing the two values you can simply ask the hash if key X exists if it does you can process if not reject it instantly. As a hash is optimized for this work you skip the need to loop over the entire hash every single time. In very short if you want speed writting a loop in a loop in a loop in a loop is never a good idea. If you have to a loop in a loop is possible more thn that should be avoided as much as possible. Regards, Rob Coops

Re: parsing script help please

2012-05-31 Thread Rob Coops
On Thu, May 31, 2012 at 11:37 AM, nathalie wrote: > > > Hi > I have this format of file: (see attached example) > 1 3206102-3207048 3411782-3411981 3660632-3661428 > 2 4481796-4482748 4483180-4483486 > > > and I would like to change it to this > 1 3206102-3207048 > 1 34117

Re: Perl help

2012-04-05 Thread Rob Coops
On Tue, Apr 3, 2012 at 11:38 AM, Om Prakash wrote: > Hi all, > > I have some data which is like > > A:12 > B:13 > C: 14 > > Now the data is line by line and multiple line with A B C is common though > 12 13 14 is changing, i want to take this data column wise, and the the > value should come unde

Re: Learning perl

2012-03-05 Thread Rob Coops
On Mon, Mar 5, 2012 at 4:35 PM, Shawn H Corey wrote: > On 12-03-05 10:19 AM, lina wrote: > >> Is the books wrote before 2006 a bit older, are there much changes in >> the last 10 years for perl? >> > > All changes to Perl are available via perldoc. > > `perldoc perl` and search for /delta/. > > `

Re: translate a file

2012-02-17 Thread Rob Coops
On Fri, Feb 17, 2012 at 4:32 PM, lina wrote: > Hi, > > I have a file, > > cat try.xpm > a 1 > b 2 > c 3 > d 4 > > abbbcdddb > > > I wish to use perl to translate the last line into the numerical value. > > #!/usr/bin/perl > > use warnings; > use strict; > > open FILE, " > my @line = ; > > wh

Re: Executing remote command without using any modules

2012-01-18 Thread Rob Coops
On Wed, Jan 18, 2012 at 5:31 AM, charith wrote: > Hi All, > > I create following bash script to run some block of commands on remote > server > and get information but I try to do same using Perl but I couldn't > make it so any one can suggest way to get done this using perl ? (please > withou

Re: extracting email addresses from a file

2011-11-29 Thread Rob Coops
l them and filter the once out that bounce, so check your email account for any messages stating that the receiving mail server does not know the account. In the end you will have a list of valid existing email addresses that you can then spam to no end or well what ever else your intention is with them ;-) Regards, Rob Coops

Re: extracting email addresses from a file

2011-11-29 Thread Rob Coops
On Tue, Nov 29, 2011 at 4:13 PM, Rajeev Prasad wrote: > hello, > > i am trying to extract email address from a afile, but not quite > succesful. here is what i have: > > the file: > myterqlqt qntmrq Prqtesm qltul qzeez Smqik qltulqzee...@jmqil.com 976665 > myterqlqt qntmrq Prqtesm teepqk Mittql t

Re: "$host = shift || $hostname;" vs. "$host = $hostname;"

2011-11-24 Thread Rob Coops
On Thu, Nov 24, 2011 at 7:19 PM, JPH wrote: > I found the script below at http://hints.macworld.com/** > dlfiles/is_tcp_port_listening_**pl.txt > > I am trying to figure out what's happening at lines 20-23. > Why is the author using

Re: Installing CPAN Params::Validate and DateTime on Mac OS X 10.6.8

2011-10-18 Thread Rob Coops
On Tue, Oct 18, 2011 at 4:20 PM, Madrigal, Juan A wrote: > Hi All! > > I'm having serious problems trying to install DateTime-0.70 along with > pre-requisites Params-Validate-1.00 > on Mac OS X 10.6.8 via CPAN. > > I'm using the default install of Perl 5.10 (64bit). What jumps out to me > is this:

Re: Adding \.JPG$/\.jpg/ to a perlregexp

2011-10-17 Thread Rob Coops
On Mon, Oct 17, 2011 at 9:07 PM, Csanyi Pal wrote: > Leo Susanto writes: > > > On Mon, Oct 17, 2011 at 11:46 AM, Csanyi Pal > wrote: > >> my goal is to get in a directory the following: > >> > >> PIC1.JPG renamed as Gyermekolimpia_Ujvidek_001.jpg > >> PIC2.JPG renamed as Gyermekolimpia_

Re: how to sort two array in perl

2011-10-14 Thread Rob Coops
On Fri, Oct 14, 2011 at 4:32 PM, Shlomi Fish wrote: > On Thu, 13 Oct 2011 02:39:52 -0700 (PDT) > Lemon wrote: > > > Dear all, > > > > I want to sort data set like this > > > > (@a, @b) > > 1,21,2 > > 7,89=> 2,33 > >

Re: Regarding help in Threading

2011-10-06 Thread Rob Coops
On Thu, Oct 6, 2011 at 11:30 AM, Vishal Gupta wrote: > > > > > > Hi, > > I have to write a perl program (Parent script) which does the below 4 tasks > simultaneously: > > 1. Executing a perl script in one shell. (Parent script) > 2. Invoking a thread performing some tasks periodically lets say onc

Re: Sandboxing while I am learning

2011-08-30 Thread Rob Coops
On Tue, Aug 30, 2011 at 4:44 PM, Marc wrote: > Sayth, > > > So basically If I want to experiment and toy with different cpan apps > > and so forth I can without messing up my perl install. > > All you have to do is install cpanm for each version of Perl and > then you don't have to worry

Re: Variable Assignment

2011-08-16 Thread Rob Coops
On Tue, Aug 16, 2011 at 8:27 PM, Joseph L. Casale wrote: > What is the correct way to quickly assign the result of a regex against > a cmdline arg into a new variable: > > my $var = ($ARGV[0] =~ s/(.*)foo/$1/i); > > Obviously that's incorrect but is there a quick way without intermediate > assign

Re: Perl script to retrieve specific lines from file

2011-08-10 Thread Rob Coops
On Thu, Aug 11, 2011 at 1:10 AM, Uri Guttman wrote: > >>>>> "KS" == Kevin Spencer writes: > > KS> On Wed, Aug 10, 2011 at 4:04 AM, Rob Coops wrote: > >> #!/usr/bin/perl > >> > >> use strict; > >> use warn

Re: Perl script to retrieve specific lines from file

2011-08-10 Thread Rob Coops
On Wed, Aug 10, 2011 at 12:43 PM, VinoRex.E wrote: > Hi every one > i am a Biologist,i am having a DNA file having 2000 to 1000 letters. eg > file:(ATGCATGCTAGCTAGTCGATCGCATCGATAGCTAGCTACGCG > CGTACCGTGCAGAAGAGCAGGACATATATATTACGCGGCGATCGATCGTAGC > > GATCGATCGATCGCTAGCTGACTATGCATGCTAGCTAGTCGAT

Re: AES Encryption

2011-08-04 Thread Rob Coops
On Thu, Aug 4, 2011 at 8:23 AM, SDA wrote: > I'm interested in using AES encryption in Perl. I've tried installing > Crypto from CPAN, but can't get it to work. Any ideas? Modules... > > > -- > To unsubscribe, e-mail: beginners-unsubscr...@perl.org > For additional commands, e-mail: beginners-h

Re: substring first 100 words from a string in perl

2011-07-28 Thread Rob Coops
On Thu, Jul 28, 2011 at 3:23 PM, Khabza Mkhize wrote: > I want to substring words, I might be using wrong terminology. But I tried > the following example the only problem I have it cut word any where it > likes. eg "breathtaking" on my string is only bre. > > > $string = "This is an awe-in

Re: Increment UID Field

2011-07-20 Thread Rob Coops
On Wed, Jul 20, 2011 at 9:53 PM, Shlomi Fish wrote: > Hi Overkill, > > On Wed, 20 Jul 2011 13:24:06 -0400 > Overkill wrote: > > > Greetings, > > > > I'm trying to increment the UID field of the unix password file from an > > csv file. I've tried to insert C style increment and it keeps bomping

Re: Increment UID Field

2011-07-20 Thread Rob Coops
On Wed, Jul 20, 2011 at 7:24 PM, Overkill wrote: > Greetings, > > I'm trying to increment the UID field of the unix password file from an csv > file. I've tried to insert C style increment and it keeps bomping out. > What would be the logic to increment the 5009 to increment by one? Thanks > f

Re: error when installing WWW::Mechanize

2011-07-19 Thread Rob Coops
On Tue, Jul 19, 2011 at 11:34 AM, Agnello George wrote: > > > > Suggestions would be to install perlbrew and use it to install a more > recent > > perl or just plain to force install, since everything else seems to be in > > working order. > > > > i did a force install and gave me the following o

Re: Using perl to send sms through siemens tc65

2011-07-18 Thread Rob Coops
your way to CPAN and found a module that seems to do what you want it to do. Now the only thing left to do is just giving it a try and see what it does. In the worst case scenario you can always do as Shlomi suggested and have a go at the serial port interface your self but using a purpose build module will make your life a lot easier in most cases. Regards, Rob Coops

Re: XML suggestions

2011-07-13 Thread Rob Coops
On Wed, Jul 13, 2011 at 3:27 AM, Feng He wrote: > 2011/7/13 Doug Bradbury : > > Does anyone have suggestions for an active and easy to use XML building & > parsing module? > > > > For a simple XML parsing I have used the module XML::Simple which just run > well. > > Regards. > > -- > To unsubscri

Re: understanding adding numeric accumulator

2011-07-08 Thread Rob Coops
On Sat, Jul 9, 2011 at 1:33 AM, J. S. John wrote: > Hi all, > I'm teaching myself perl. Right now, I am stuck with this script. I > don't understand how it works. I know what it does and how to do it by > hand. > > $n = 1; > while ($n < 10) { >$sum += $n; >$n += 2; > } > print "The sum is

Re: Need help for interview

2011-07-08 Thread Rob Coops
On Fri, Jul 8, 2011 at 11:53 AM, pawan kumar wrote: > Hi, > I am BE(CSE) fresher.I got a call for interview and openings is in perl.I > know the basics of perl.Please let me know what i have to prepare for > interview.Any link for frequently asked scripts?? > -- > K.V. PAWAN KUMAR > Good one...

Re: Different behaviour

2011-07-07 Thread Rob Coops
On Thu, Jul 7, 2011 at 12:50 PM, HACKER Nora wrote: > ** > > Hi Rob, > > Thanks for your reply and your suggestions. > >So to make things really simple you basically make the following call: >***system "ps -ef |grep -v grep |grep dbw |grep -q $db";* twice the >first time you get the l

Re: Different behaviour

2011-07-07 Thread Rob Coops
On Thu, Jul 7, 2011 at 11:42 AM, HACKER Nora wrote: > Hello, > > I would be really glad if someone could give me a hint to my following > problem: I have a script that runs smoothly on AIX5.3, installed Perl is > 5.8.8. Now I need it to run on AIX6.1, Perl is 5.8.8 as well, but I > experience a s

Re: rmdir

2011-06-27 Thread Rob Coops
On Mon, Jun 27, 2011 at 3:49 PM, Irfan Sayed wrote: > exactly. some of the files have set the attribute as read only > > and due to that module was unable to delete those > > is there any module which will check if the file has read only attribute > and if yes remove that attribute?? > > plz sugge

Re: rmdir

2011-06-27 Thread Rob Coops
On Mon, Jun 27, 2011 at 3:31 PM, wrote: > Hi Fish, > > In my example (there is no metachar), the two forms of system call are the > same. > from perldoc -f system: > > If there is only one scalar > argument, the argument is checked for shell metacharacters, and if there > are any, the entire argu

Re: @{$var1{$var2}}

2011-06-22 Thread Rob Coops
On Wed, Jun 22, 2011 at 6:44 PM, josanabr wrote: > Hi, > > I'm reading a program written in perl and I read this statement > > > -- > To unsubscribe, e-mail: beginners-unsubscr...@perl.org > For additional commands, e-mail: beginners-h...@perl.org > http://learn.perl.org/ > > > Without any more i

Re: Convert spreadsheet to jpeg

2011-06-20 Thread Rob Coops
On Mon, Jun 20, 2011 at 9:57 PM, wrote: > Hello > > I am not an expert in perl and so before I propose that a particular script > be written I would likek to get an idea as to how hard the task would be. > > We have a large number (in my opinion) of excel spreadsheets that need to > be concerted

Re: malformed header from script. Bad header

2011-06-20 Thread Rob Coops
On Mon, Jun 20, 2011 at 10:32 AM, Khabza Mkhize wrote: > I am not sure if this problem is cause by print "Content-type: text/html", > "\n\n"; > > The main problem I have commented print "Content-type: text/html", "\n\n"; > since is printing line from cookies i Used > > On Mon, Jun 20, 2011 at 9:57

Re: virtual drive

2011-06-15 Thread Rob Coops
On Wed, Jun 15, 2011 at 8:49 AM, Irfan Sayed wrote: > Hi, > > is there any way or module in perl to create the virtual drive in windows > lets say , i have to create M: mapped to c:\test > > so i can use command subst M: c:\test > > > but still , is there any better way > > regards > irfan > Hi I

Re: how to use regexp to match symbols

2011-06-13 Thread Rob Coops
On Mon, Jun 13, 2011 at 2:05 PM, eventual wrote: > Hi, > I have a list of mp3 files in my computer and some of the file names > consists of a bracket like this "darling I love [you.mp3" > I wish to check them for duplicates using the script below, but theres > error msg like this "Unmatched [ in

Re: Check if words are in uppercase?

2011-06-10 Thread Rob Coops
On Thu, Jun 9, 2011 at 9:59 AM, Beware wrote: > Hi all, > > i've a question on my perl script. > > In my script i read a file line per line, and check if keywords are in > uppercase. To do that, i've an array filled with all used keywords. > > On each line, i check all keywords with a foreach loo

Re: how do i push a hashref into another hashref

2011-06-07 Thread Rob Coops
On Tue, Jun 7, 2011 at 8:47 AM, Agnello George wrote: > HI > > I got the following hashref > > my $selet_domU_data = $DBH->selectall_hashref("select > ram,ip,application,hosting,assigned_to,rdom0id from domU_info where > server_name='$domU_server' ",'server_name' ); > > my $select_all_website =

Re: fastq file modification help

2011-06-06 Thread Rob Coops
On Mon, Jun 6, 2011 at 12:29 PM, Nathalie Conte wrote: > Hi, > > I need to remove the first 52 bp sequences reads in a fastq file,sequence > is on line 2. > fastq file from wikipedia:A FASTQ file normally uses four lines per > sequence. Line 1 begins with a '@' character and is followed by a sequ

Re: timestamp with milisecond

2011-06-03 Thread Rob Coops
On Fri, Jun 3, 2011 at 9:38 AM, Anirban Adhikary wrote: > Hi List > Is it possible to get the current time_stamp with milisecond format > > like HH:MI:SS:NNN DD:MM:(NNN is the milisecond) > > If yes then how can I achieve the same.. > > Thanks & Regards in advance > Anirban Adhik

Re: Parsing file

2011-06-02 Thread Rob Coops
nner: > > 2' => { >'PATHWAY' => { > 'ko00010' => 'Glycolysis / > Gluconeogenesis' > 'ko00071' => ' Fatty acid > metabolism' > >

Re: Parsing file

2011-06-02 Thread Rob Coops
On Thu, Jun 2, 2011 at 4:41 PM, venkates wrote: > On 6/2/2011 2:44 PM, Rob Coops wrote: > >> On Thu, Jun 2, 2011 at 1:28 PM, venkates wrote: >> >> On 6/2/2011 12:46 PM, John SJ Anderson wrote: >>> >>> On Thu, Jun 2, 2011 at 06:41, venkates wrote: &g

Re: regexp validation (arbitrary code execution) (regexp injection)

2011-06-02 Thread Rob Coops
2011/6/1 Stanisław Findeisen > Suppose you have a collection of books, and want to provide your users > with the ability to search the book title, author or content using > regular expressions. > > But you don't want to let them execute any code. > > How would you validate/compile/evaluate the us

Re: Parsing file

2011-06-02 Thread Rob Coops
On Thu, Jun 2, 2011 at 1:28 PM, venkates wrote: > On 6/2/2011 12:46 PM, John SJ Anderson wrote: > >> On Thu, Jun 2, 2011 at 06:41, venkates wrote: >> >>> Hi, >>> >>> I want to parse a file with contents that looks as follows: >>> >> [ snip ] >> >> Have you considered using this module? -> >>

Re: whats the purpose of use Data::Dumper;

2011-06-01 Thread Rob Coops
On Wed, Jun 1, 2011 at 6:07 PM, eventual wrote: > use Data::Dumper; > > Hi, > Can someone give me a few examples on the purpose of use Data::Dumper; > I tried reading but I could not understand. > Thanks use Data::Dumper; simply tells perl to load the Data::Dumper module. You can then use the

Re: Can't call method "findnodes" on unblessed reference; not using OO Perl

2011-05-18 Thread Rob Coops
On Wed, May 18, 2011 at 11:25 PM, Rob Dixon wrote: > On 18/05/2011 21:37, Kenneth Wolcott wrote: > >> >> A colleague claims that he made no changes, code worked yesterday >> and doesn't today. >> >> He is not using OO Perl. >> > > You say later that he uses XML::XPath. That is an object-oriented

Re: Can't call method "findnodes" on unblessed reference; not using OO Perl

2011-05-18 Thread Rob Coops
On Wed, May 18, 2011 at 10:37 PM, Kenneth Wolcott wrote: > Hi; > > A colleague claims that he made no changes, code worked yesterday and > doesn't today. > > He is not using OO Perl. > > I have asked him for a small code snippet that reproduces the error (I'm > sure he is unwilling to show the

Re: problem in creating a complex hash

2011-05-13 Thread Rob Coops
It might not look nice but I would do the following: #!/usr/local/bin/perl use strict; use warnings; my $arrayref = [ [ [ 'user1', 'c'], [ 'user2', 'a'], [ 'user2', 'b' ],[ 'user2', 'd' ],[ 'user3', 'a' ],[ 'user2', 'f' ] ] ]; my %hash; foreach my $arrayreference ( @{${$arrayref}[0]} ) { if (

Re: help me with a parsing script please

2011-05-12 Thread Rob Coops
You are almost there :-) my ($helper1, $helper2); my $counter = 1; foreach my $line(@list){ chomp $line; my @coordinates = split(/' '/, $region); my $chromosome = $coordinates[0]; my $start = $coordinates[1]; my $end = $coordinates[2]; my $strand = $coordinates[3

Re: special character regex match

2011-05-05 Thread Rob Coops
Ok let me try to understand the question. You have a form (on an HTML page or inside an application, command line or graphics?), this form contains a textarea that should not allow users to freely enter text but the input should be scanned for "bad" characters, if those are found the user should r

Re: inteligent DBI

2011-04-07 Thread Rob Coops
Even if it is not possible at the moment you could always overwrite this function and make it work this way... I suspect it might be quite a bit of work, but certainly not impossible. After all you are programming anything you can think of can be done the only question is if it is worth the effort

Re: Is CDB_File good for CDB in readonly

2011-04-04 Thread Rob Coops
Hi Ram, CBD or Berkely DB is optimized for reading, it is meant to deal with large volumes of simple non-relational basic data, so no images blobs, globs or any of that stuff... besides that it will be fast very very fast. To give you an example in the past I used to work on a Berkely DB driven D

Re: perl dd

2011-03-28 Thread Rob Coops
> I was referring to unix dd command. was wondering if we have any module > already available. > > i didn't found on cpan > > Thx > a b > > On Mon, Mar 28, 2011 at 2:05 PM, Rob Coops wrote: > >> >> >> On Mon, Mar 28, 2011 at 10:18 AM, a b wro

Re: perl dd

2011-03-28 Thread Rob Coops
On Mon, Mar 28, 2011 at 10:18 AM, a b wrote: > Hi, > > I want to know if any module for "dd" in perl is available. > > Any pointers will a great help > > Thanks, > a b > Have you tried having a look at search.cpan.org? Oh, by the way what does dd stand for? Acronyms are great and all but unless

Re: Using regex special characters from a string

2011-03-08 Thread Rob Coops
Hi Ben, Not sure I get your point... but this is what it sounds like to me. I have a script, and I want to feed it a special thing to let it know that any character (A-Z or a-z does upper lower case matter?) is valid, but I also want to use other characters at the same time. So ./script.pl -s ABC

Re: multidimensional array check

2011-03-04 Thread Rob Coops
that extra step and provides you with a good insight of the underlying logic. On Fri, Mar 4, 2011 at 7:30 PM, Brian F. Yulga wrote: > > Rob Coops wrote: > > >> So you should now be able to retrieve the whole result set as a >> reference to an array containing references

Re: multidimensional array check

2011-03-04 Thread Rob Coops
htly less complex task to learn a programming language with next time, this one is though interesting certainly not an easy one to use as a way to learn the language. :-) Regards, Rob On Fri, Mar 4, 2011 at 3:25 PM, mammoccio wrote: > Il 04/03/2011 13:26, Rob Coops ha scritto: > > Fi

Re: multidimensional array check

2011-03-04 Thread Rob Coops
Hi Vito, Ok so lets give this a try... First lets deal with comparing the arrays then we can get to the size issues and memory usage etc... You have the data in an array which is good but not all that nice as after all it will make for a lot of work if you want to compare two arrays (you end up

Re: perl's threads

2011-02-11 Thread Rob Coops
users just be informative as the better solution has been available for long enough for most module maintainers to switch. On Thu, Feb 10, 2011 at 11:05 AM, Dr.Ruud wrote: > On 2011-02-09 14:03, Rob Coops wrote: > > > But any developer that tells you that threads are not worth the

Re: perl's threads

2011-02-09 Thread Rob Coops
Just adding a little to this discussion then. :-) Threads regardless of the language are meant to do multiple things in parallel. For instance I'm at the moment working on a tool that extracts vast amounts of data from a web service as the calls to that service are pretty much independent and the

Re: Need Help with Perl Mobile Environment

2011-01-25 Thread Rob Coops
On Tue, Jan 25, 2011 at 8:46 AM, Khabza Mkhize wrote: > Can you please help with where to find information about Perl mobile > version > I need to develop Accommodation Booking Website that will run on Smart > phone, Iphone And Blackberry. > > Please send me a links with relevant information > >

Re: Capture nth element of a file

2011-01-21 Thread Rob Coops
On Fri, Jan 21, 2011 at 5:57 PM, Rob Coops wrote: > > > On Fri, Jan 21, 2011 at 5:43 PM, jet speed wrote: > >> Hi All, >> I need some help with the blow. >> >> I have a an input file with the below data >> >> 1835 >> 1836 >> 1837 >

Re: Capture nth element of a file

2011-01-21 Thread Rob Coops
On Fri, Jan 21, 2011 at 5:43 PM, jet speed wrote: > Hi All, > I need some help with the blow. > > I have a an input file with the below data > > 1835 > 1836 > 1837 > 1838 > 1839 > 183A > 183B > 183C > 183D > > > #!/usr/bin/perl > use strict; > use warnings; > > my $filename; > $filename = "input.

Re: Strategy for diagnosing context-sensitive bug

2010-12-07 Thread Rob Coops
On Tue, Dec 7, 2010 at 2:21 PM, Rob Dixon wrote: > On 07/12/2010 09:24, Jonathan Pool wrote: > >> >> Are you familiar with the perl debugger? >>> >> >> Thanks much for your reply. I haven't used the debugger, partly >> because its documentation describes it as an interactive tool and >> it's not

Re: Read logfile to variable hash

2010-12-01 Thread Rob Coops
On Wed, Dec 1, 2010 at 10:24 AM, Dennis Jakobi wrote: > Hi there, > > I have the following problem: > > I want to read a logfile in which every line follows this rule: > ::... > > But the number of values differs. Sometimes a line has 2 values (the > minimum) and sometimes 3 or more values. Now I

Re: finding duplicates in txt file

2010-11-10 Thread Rob Coops
; } else { # If the name already exists then we simply add to the array we already have. $final_hash{ $args[8] } = push @{ $final_array{ $args[8] } }, $args[13]; } } # Now you calculate the mean value foreach my $name ( keys %final_hash ) { my @list_of_values = $final_hash{ $name }; my $mean; ... # Up to you ;-) ... print OUTPUT $name . "\t" . $mean . "\n"; } That should pretty much do the trick I would think... Regards, Rob Coops

Re: using Net::SMTP unable to send out a mail

2010-11-04 Thread Rob Coops
On Thu, Nov 4, 2010 at 9:50 AM, Agnello George wrote: > HI > > i wrote a small simple script using Net::smtp however my local MTA is not > accepting the mail here is the script : > > > = > > #!/usr/bin/perl > > use strict; > use warnings; > use Net:

Re: split log file

2010-10-16 Thread Rob Coops
On Thu, Oct 14, 2010 at 4:54 PM, yo RO wrote: > Hello I need to split a log file per days > I have a file in txt format and I want to create a file with all data > from one day in one file > I will give example > > I have this imput > 3_21_2010;11:12\\trafic info > 3_21_2010;11:34\\trafic info >

Re: Extract Javascript

2010-10-16 Thread Rob Coops
On Thu, Oct 14, 2010 at 7:48 PM, bones288 wrote: > what should I look into for extracting javascript from a webpage: > > http://www.costofwar.com/ > > I want to periodically check the counter but I'll I can see is: > >

Re: perl real life exercise

2010-10-15 Thread Rob Coops
On Fri, Oct 15, 2010 at 9:02 AM, Agnello George wrote: > HI > > Is there any site or any book other than "learning perl" where i would get > real life exercises on perl scripting. > > Thanks > > -- > Regards > Agnello D'souza > Hi Angello, What is your real life? I mean there are great books abo

Re: Out of Memory!

2010-10-13 Thread Rob Coops
On Wed, Oct 13, 2010 at 10:41 AM, Panda-X wrote: > > > 2010/10/13 Rob Coops > > >> >> On Wed, Oct 13, 2010 at 8:42 AM, Panda-X wrote: >> >>> Hi List, >>> >>> My script is running on WinXP, Dos shell, which is a server program. &g

Re: Out of Memory!

2010-10-13 Thread Rob Coops
On Wed, Oct 13, 2010 at 8:42 AM, Panda-X wrote: > Hi List, > > My script is running on WinXP, Dos shell, which is a server program. > > It works fine, unless it will pops-up a "Out of Memory!" and stop running > per each few days! > > Could someone tell me this error message is coming from Perl ?

Re: Subroutine

2010-10-11 Thread Rob Coops
k with classes and object oriented code which is a whole other can of worms, certainly in good old perl5 OO can be a little more difficult than one would like OO to be. Regards, Rob Coops

Re: Problem with foreach loop

2010-09-27 Thread Rob Coops
On Mon, Sep 27, 2010 at 9:19 AM, HACKER Nora wrote: > Hello list, > > Could someone please explain why this test script: > > my @arr1 = qw(one two three); > my @arr2 = qw(1 2 3); > > foreach my $arr1 ( @arr1 ) { >print "Arr1: $arr1\n"; >foreach my $arr2 ( @arr2 ) { >

Re: Can't call method "get_value....

2010-08-05 Thread Rob Coops
On Thu, Aug 5, 2010 at 9:52 AM, sync wrote: > Hi, guys: > > i have a perl script that supposed to add users to ldap . when i run the > script it get: > > Can't call method "get_value" on an undefined value at ./add_user.pl > > > > Any help will be appreciated? > > > The following message is my

Re: add newline

2010-08-03 Thread Rob Coops
On Tue, Aug 3, 2010 at 12:26 PM, Sharan Basappa wrote: > In my program, I am building a text file f that also contains newlines > irst into an array. > I push every line to the array, but how do I add new lines to this text? > > Regards, > Sharan > > -- > To unsubscribe, e-mail: beginners-unsubscr

Re: hash arrays

2010-07-26 Thread Rob Coops
On Mon, Jul 26, 2010 at 2:09 PM, Sharan Basappa wrote: > Folks, > > I am reusing a code for some enhancements. According to my > understanding, it is a record with > some unique string as key and then hash array as the value. > > I iterate through the array and print as follows: > > foreach my $ke

Re: Extract data from BEncoded .torrent files

2010-07-26 Thread Rob Coops
On Sun, Jul 25, 2010 at 9:24 PM, NisargaYoga wrote: > Hi - Total newbie and my first post so please tell me if I'm doing > anything wrong. > > My first real Perl project - looking for some conceptual guidance. > > The project involves processing of BEncoded .torrent files downloaded > from an rtor

Re: Calling Exit from within a subroutine

2010-07-21 Thread Rob Coops
On Wed, Jul 21, 2010 at 5:00 AM, Babale Fongo wrote: > I call several subroutines within my program. The program is design in a > way that I don't expect my subroutines to return to the caller but to exit > once they have executed. > > At the moment I don't have exit or return at the end of my s

Re: Compare file/dir size

2010-07-20 Thread Rob Coops
On Tue, Jul 20, 2010 at 1:51 PM, HACKER Nora wrote: > Hi, > > My aim is to compare two directories on different servers, whereas one > is the FTP'ed "copy" of the other, by checking whether both directories > are of exactly the same size. I tried to accomplish that with > Filesys::DiskUsage, but

  1   2   3   >