Re: Search Tab-delimited file for Null fields

2004-11-29 Thread Chap Harrison
This time I'm trying to read through a tab-delimited text file with the first row containing headers. I want to print out any field/column name where the entire field is null (meaning there is no value for that field for any record in the file). [snip] I'm thinking that if I read each column int

Re: Search Tab-delimited file for Null fields

2004-11-29 Thread Gunnar Hjalmarsson
Debbie Cooper wrote: I'm trying to read through a tab-delimited text file with the first row containing headers. I want to print out any field/column name where the entire field is null (meaning there is no value for that field for any record in the file). I'm thinking that if I read each column

Search Tab-delimited file for Null fields

2004-11-29 Thread Debbie Cooper
I'm pretty new to Perl but with the help of this list I've been able to come up with a few helpful scripts. This time I'm trying to read through a tab-delimited text file with the first row containing headers. I want to print out any field/column name where the entire field is null (meaning there

RE: Spam:Re: Error: Scalar found where operator expected

2004-11-29 Thread Michael Kraus
G'day... > This is not related to strict. You always have to use () when > calling methods. Really? /Always/ or only when passing arguments to the method? I've got a method that returns a reference to an object, I often call it without using parentheses. Let me show you what I mean... --- In

Create new "outfile" foreach line in "inputfile"

2004-11-29 Thread Brian Volk
Hi All, I have a urls.txt file that contains a different url on each line (100 urls). And I have a item_numbers.txt file (100 items). I want to create a new outfile.txt, named w/ the corresponding item_number, each time the urls.txt file passes through the loop. Can someone please let me kno

RE: Spam:RE: Return values from methods on Classes/Objects

2004-11-29 Thread Michael Kraus
G'day! > : Clearly, I'm missing something crucial here... :) > > And so are we. Like the code for the method for > format_cost(), but I imagine that you are not shifting the > object off at the beginning of that subroutine. Right you are... :) Btw... The code was: sub format_cost {

Re: tie variable to function?

2004-11-29 Thread JupiterHost.Net
JupiterHost.Net wrote: my $time =... # do magic to make $time always return time() print "$time\n"; sleep 3; print "$time\n"; would output: 1101740477 1101740480 Thanks everyone that replied, that is exactly what I was looking for! I beleive I have it now :) I wonder now, is doing this very

Re: tie variable to function?

2004-11-29 Thread JupiterHost.Net
my $time =... # do magic to make $time always return time() print "$time\n"; sleep 3; print "$time\n"; would output: 1101740477 1101740480 Thanks everyone that replied, that is exactly what I was looking for! I beleive I have it now :) I wonder now, is doing this very resource intensive: When

Re: problem with function

2004-11-29 Thread Ing. Branislav Gerzo
Jenda Krynicky [JK], on Monday, November 29, 2004 at 15:56 (+0100) typed the following: >>my [EMAIL PROTECTED]; JK> my $datenbank = shift(); JK> or JK> my ($datenbank) = @_; heh, this is common mistake, I did it today too, but I found it. I add my suggestion: my $datenbank = $_[0]; --

Signal Handler for Out of Memory Problem

2004-11-29 Thread Joshua Berry
I have written a program that appears to have a memory leak or is using a module with a memory leak. Eventually the system runs out of memory and dies. I need to write a signal handler that intercepts the signal that stops the program and flushes everything in use to free up memory. Does anyone k

perl.beginners Weekly list FAQ posting

2004-11-29 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: File manipulation

2004-11-29 Thread daggerquill
[please keep on list] [especially when the person you're e-mailing is out of town ;) ] - Show quoted text - On Wed, 24 Nov 2004 09:17:18 -0500, FlashMX <[EMAIL PROTECTED]> wrote: > > Hi Jay, > > I'm getting mixed reviews on how to do this script. I've been told by dumping > the input file to an

Get TRAP Sender´s IP

2004-11-29 Thread diogo . senai
Hi List, I´m new around and I´m having kind´a difficulty to solve this problem. Well, I´m writing 2 scripts that will be kept in a server. The first one receives SNMP traps on port 162 (duh!) every 10 seconds and it writes something to a file, just for a record. The second script checks, every 30 s

Re: tie variable to function?

2004-11-29 Thread Randy W. Sims
JupiterHost.Net wrote: Hello list, I saw this recently on here but can't find the thread and since I'm not sure what the technique is called (tie variable to function?) I'm not sure where to look on perldoc :) What is it called/How do you go about doing it when you have a var that each time is

Re: tie variable to function?

2004-11-29 Thread Jenda Krynicky
From: "JupiterHost.Net" <[EMAIL PROTECTED]> > I saw this recently on here but can't find the thread and since I'm > not sure what the technique is called (tie variable to function?) I'm > not sure where to look on perldoc :) > > What is it called/How do you go about doing it when you have a var >

Re: tie variable to function?

2004-11-29 Thread Jonathan Paton
The technique is called tying, for more details look at: perldoc -f tie You need to be familar with object orientated perl, and I would consider "tie" to be an advanced technique. Drawbacks? Consider the pain to others due to unexpected behaviour. Consider the extra pain to implement it all.

tie variable to function?

2004-11-29 Thread JupiterHost.Net
Hello list, I saw this recently on here but can't find the thread and since I'm not sure what the technique is called (tie variable to function?) I'm not sure where to look on perldoc :) What is it called/How do you go about doing it when you have a var that each time is used (IE printed or in

Re: Error: Scalar found where operator expected

2004-11-29 Thread Jenda Krynicky
From: Jonathan Paton <[EMAIL PROTECTED]> > Easy. > > When using strict you must use brackets around subroutine and method > calls... I.E. > > $object->METHOD(args...) > > You need: > > my $message=$pop3->RETR($msg_id); > > Jonathan Paton This is not related to strict. You always have to use (

Re: problem with function

2004-11-29 Thread Jenda Krynicky
From: "E.Horn" <[EMAIL PROTECTED]> > Hello! > Can someone help me with my programm that does not work. > i do not get the mistake. > The output is always the same, if i use &daten_einlesen("nucleotide") > or > > &daten_einlesen("proteine") there is no difference! > What have I done wrong? > > >

re function....

2004-11-29 Thread E.Horn
Thanks a lot Mr Paton! You are right, now it works great! Have a nice day... -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: problem with function

2004-11-29 Thread Jonathan Paton
In daten_einlesen() you have: my [EMAIL PROTECTED]; which sets $datenbank to the number of elements in @_ (the arguments to the subroutine). You probably want: my ($datenbank) = @_; Or: my $datenbank = shift; Jonathan Paton -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional co

RE: converting a postscript file to an image or bitmap

2004-11-29 Thread Bob Showalter
[ keep the discussion on the list please ] [ and don't top-post please ] John wrote: > Does that work on a win32 system? > > > I mean gostscript. You mean GhostScript? I dunno, go to their site and check it out. Go to http://www.google.com and enter "ghostscript" and hit the "I'm Feeling Luck

Re: Error: Scalar found where operator expected

2004-11-29 Thread Jonathan Paton
Easy. When using strict you must use brackets around subroutine and method calls... I.E. $object->METHOD(args...) You need: my $message=$pop3->RETR($msg_id); Jonathan Paton -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

problem with function

2004-11-29 Thread E.Horn
Hello! Can someone help me with my programm that does not work. i do not get the mistake. The output is always the same, if i use &daten_einlesen("nucleotide") or &daten_einlesen("proteine") there is no difference! What have I done wrong? Regards #!/bin/perl -w use strict; use LWP::Simpl

Moving, modifying files and preserving permission's

2004-11-29 Thread William . Ampeh
Hello, I am in the process of migrating our current working environment from Solaris to Linux. This should have been very straight forward if I had a one-to-one mapping of filesystems, but not in my situation. I am moving from a multiple 6GB filesystems to a few 20GB filesystems, which means

Re: Error: Scalar found where operator expected

2004-11-29 Thread Randy W. Sims
vishwas bhakit wrote: hello, I had used following line in my code to retrieve message where $msg_id shows id of message retrieved by LIST command. code: my $message=$pop3->RETR $msg_id; # Line No. 30 it is showing me following error Error: Scalar found where operator expected at try.pl

RE: converting a postscript file to an image or bitmap

2004-11-29 Thread Bob Showalter
John wrote: > Is there any script or module to do that job? Image::Magick, which in turn just calls GhostScript to do the conversion. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: sorting with Swartz Transform

2004-11-29 Thread Gunnar Hjalmarsson
Jeremy Kister wrote: Gunnar Hjalmarsson wrote: my @unsorted = ( '5 127.0.0.1', '10 127.0.1.1', '5 27.0.0.1', '6 10.0.0.1', '1 17.0.0.1', '5 209.0.0.1', ); my @sorted = map { $_->[0] } sort { $a->[1] <=> $b->[1]

Error: Scalar found where operator expected

2004-11-29 Thread vishwas bhakit
hello, I had used following line in my code to retrieve message where $msg_id shows id of message retrieved by LIST command. code: my $message=$pop3->RETR $msg_id; # Line No. 30 it is showing me following error Error: Scalar found where operator expected at try.pl line 30, near "->RET

Re: map vs foreach

2004-11-29 Thread Jonathan Paton
Dear Michael, I am wrong. [SHAME] The output of Benchmark is slowest first... whereas I intuitively thought it would be fastest first. All my conclusions are therefore wrong, although the differences in speed are still surprising. Results may change depending on the version of Perl, I am using

RE: Return values from methods on Classes/Objects

2004-11-29 Thread Charles K. Clarkson
Michael Kraus <[EMAIL PROTECTED]> wrote: : One of my classes has a method called format_cost which takes a : number (integer representing a monetory amount in cents) and : pretties it up for : display as a dollar amount. I.e. format_cost(12) returns : "$1,200.00". : : When I have the functio