Re: Interactive socket client

2004-10-26 Thread "Ing.Miroslav Kondělka"
[EMAIL PROTECTED] wrote: I think the problem is that your child dies before your parent reads any data and closes STDIN+OUT. You can see that if you install SIG CHLD handle. Don't forget that parent and child have same file handles, and execution order of process is never a sure thing. The rea

Re: Determine the Binary format of a file

2004-10-26 Thread David le Blanc
Assuming the file isn't some known standard which is discovered by interrogating the header (ala unix 'file ') you will need to understand the format of the file before we can help defined an unpack template. Any ideas where to start? Generally I try and determine record size and delimiter first.

Re: Determine the Binary format of a file

2004-10-26 Thread Chris Devers
On Tue, 26 Oct 2004, Jim wrote: > I have a binary file that I have been tasked to discover the format of > and somehow convert the records to readable text. Is there any way I > can find out what binary format the file is in, so I can create an > template for unpack() to convert the binary to t

Re: CGI.pm info on the web

2004-10-26 Thread Randal L. Schwartz
> "Jenda" == Jenda Krynicky <[EMAIL PROTECTED]> writes: Jenda> Opinions differ. I think including these "HTML generation" functions Jenda> in CGI.pm was a bad design decision (a module should do only one Jenda> thing) and that they are hard to read and maintain. I'll be the one that disagr

Re: Reading from a filehandle in while-loop

2004-10-26 Thread Randal L. Schwartz
> "David" == David le Blanc <[EMAIL PROTECTED]> writes: David> You are making the assumption that '' sets '$_' which is not David> true. Oddly, perl makes '<>' set $_, but not ... dunno why No, that's completely wrong. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503

Determine the Binary format of a file

2004-10-26 Thread Jim
Hi I have a binary file that I have been tasked to discover the format of and somehow convert the records to readable text. Is there any way I can find out what binary format the file is in, so I can create an template for unpack() to convert the binary to text? Thanks Jim --- Outgoing mail is

Re: Counting gaps in sequence data revisited.

2004-10-26 Thread Zeus Odin
"Michael S. Robeson II" <[EMAIL PROTECTED]> wrote in message ... > open(DNA_SEQ, $dna_seq) Due to precedence, the parens are optional here. > open(OUTFILE, ">indel_list_"."$dna_seq") ^ ">indel_list_$dna_seq" or ">indel_list_".$dna_seq > foreach (keys

Re: what is something like this - $seen{$1}

2004-10-26 Thread Dan Jones
On Tue, 2004-10-26 at 22:00, Chasecreek Systemhouse wrote: > Interesting. > > Why doesn't this skip already seen letters, I used the > case-insensitive modifier... > > %seen = ( ); > $string = "AaBbCcDdEeFf"; > while ($string =~ /(.)/gi) { > $seen{$1}++; > } > print "\n\nunique chars are: ",

Re: Problem installing the perl Template module

2004-10-26 Thread Chris Devers
On Tue, 26 Oct 2004, Clement Lau wrote: > I'm trying to install Bugzilla on a Redhat 8 system. Okay, so isn't there an RPM you could install? Bugzilla is popular enough that I'd be surprised if there wasn't already a pre-made RPM package that could be used for this. For that matter, there mig

RE: Problem installing the perl Template module

2004-10-26 Thread Clement Lau
Hi, I've actually tried grabbing the src package manually and install it but only came out with the same result. I'm still a bit reluctant to do the force install, thinking just maybe a little tweak will solve the whole thing. Anymore suggestions? Thanks, Clement Lau Tugboat Media Inc. [EMAIL P

Re: what is something like this - $seen{$1}

2004-10-26 Thread Chasecreek Systemhouse
Simply put, the dot (.) matches everything regardless of modifier switch. -- WC -Sx- Jones http://youve-reached-the.endoftheinternet.org/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Problem installing the perl Template module

2004-10-26 Thread Chasecreek Systemhouse
It's an exmaple of where you must decide if a <2% failure rate is worth forcing it. force install Template Or, install it manually by downloading the template file off cpan. On Tue, 26 Oct 2004 15:30:09 -0700, Clement Lau <[EMAIL PROTECTED]> wrote: > Failed 1/90 test scripts, 98.89% okay. 1/24

Problem installing the perl Template module

2004-10-26 Thread Clement Lau
Hi, I'm trying to install Bugzilla on a Redhat 8 system. And now I came across this problem of installing the required Template module. I've checked all the dependency of the Template module but when I do perl -MCPAN -e 'install', the "make test" will show one fail: # perl -MCPAN -e'install "T

Re: what is something like this - $seen{$1}

2004-10-26 Thread Chasecreek Systemhouse
Interesting. Why doesn't this skip already seen letters, I used the case-insensitive modifier... %seen = ( ); $string = "AaBbCcDdEeFf"; while ($string =~ /(.)/gi) { $seen{$1}++; } print "\n\nunique chars are: ", sort(keys %seen), "\n"; 'A' and 'a' are the same, or is the logic only char() or

Re: what is something like this - $seen{$1}

2004-10-26 Thread Errin Larsen
> > %seen = ( ); > $string = "an apple a day"; > foreach $char (split //, $string) { > $seen{$char}++; > } > print "unique chars are: ", sort(keys %seen), "\n"; > > Also, a couple of paragraphs later, the Cookbook goes on to show how > to solve the same problem with a while loop a

Re: what is something like this - $seen{$1}

2004-10-26 Thread Errin Larsen
On Tue, 26 Oct 2004 16:50:11 -0400, Bob Showalter <[EMAIL PROTECTED]> wrote: > rs wrote: > > Hi, > > Here's a snippet of some code from the cookbook. > > Hmm, time to get a new cookbook :~) Nope. Just make sure you understand the the OP changed the code quoted from the cookbook, and that the c

Re: Editting the registry?

2004-10-26 Thread Jenda Krynicky
Subject:Editting the registry? Date sent: Tue, 26 Oct 2004 12:25:33 -0400 From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> > I want to restore the default admin shares on a user's machine. > > I have to delete the following key f

Re: CGI.pm info on the web

2004-10-26 Thread Jenda Krynicky
From: "Adamiec, Larry" <[EMAIL PROTECTED]> > This link may be of help to some people. > > http://www.samag.com/documents/s=9408/ur0411l/ Opinions differ. I think including these "HTML generation" functions in CGI.pm was a bad design decision (a module should do only one thing) and that they are

RE: what is something like this - $seen{$1}

2004-10-26 Thread Bob Showalter
rs wrote: > Hi, > Here's a snippet of some code from the cookbook. Hmm, time to get a new cookbook :~) > I am trying to understand what $seen{$1} is. ie where did $1 come > from, and what is in $seen{$1}, and how is the hash populated? $1 is a built-in variable that is set by capturing parens in

what is something like this - $seen{$1}

2004-10-26 Thread rs
Hi, Here's a snippet of some code from the cookbook. I am trying to understand what $seen{$1} is. ie where did $1 come from, and what is in $seen{$1}, and how is the hash populated? thanks. Radhika #!/usr/bin/perl #use strict; #use diagnostics; my %seen = (); my $string =

RE: Printing to a file

2004-10-26 Thread Ed Christian
Ed Christian wrote: >> #!/usr/bin/perl >> >> + >> use warnings; >> use strict; >> use File::Find; >> >> find sub { >> return unless -f; >> return unless $_ =~ /.\d+$/; >> print "$_\n"; >> #print "$File::Find::name\n"; >> >> + >> open(SD, "$_") or die "can't open $_ $!\n";

Re: Printing to a file

2004-10-26 Thread DBSMITH
yes I do agree, some people need to try harder at their code and be more descriptive in their problems. Gunnar, nothing personal! : ) Derek B. Smith OhioHealth IT UNIX / TSM / EDM Teams 614-566-4145 "JupiterHost.Net" <[EMAIL PROTECTED]> 10/26/2004 04:01 PM To: Perl Lists <[E

RE: Printing to a file

2004-10-26 Thread Ed Christian
> #!/usr/bin/perl > > + > use warnings; > use strict; > use File::Find; > > find sub { > return unless -f; > return unless $_ =~ /.\d+$/; > print "$_\n"; > #print "$File::Find::name\n"; > > + > open(SD, "$_") or die "can't open $_ $!\n"; > #my $fh = IO::File->new(

Re: CGI.pm info on the web

2004-10-26 Thread Chris Devers
On Tue, 26 Oct 2004, Adamiec, Larry wrote: > This link may be of help to some people. > > http://www.samag.com/documents/s=9408/ur0411l/ I bet it would go over even better on the CGI list :-) -- Chris Devers -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMA

CGI.pm info on the web

2004-10-26 Thread Adamiec, Larry
This link may be of help to some people. http://www.samag.com/documents/s=9408/ur0411l/ Larry Adamiec -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Printing to a file

2004-10-26 Thread Felix Li
print "Gunnar does not suffer fools gladly.\nSo?"; print "Try not to look like a fool!"; - Original Message - From: "JupiterHost.Net" <[EMAIL PROTECTED]> To: "Perl Lists" <[EMAIL PROTECTED]> Sent: Tuesday, October 26, 2004 4:01 PM Subject: Re: Printing to a file > > > [EMAIL PROTECTED

Re: Printing to a file

2004-10-26 Thread JupiterHost.Net
[EMAIL PROTECTED] wrote: I agree, Gunnar is mean. Mean people suck! Ok, everyone calm down :) Perhaps some folks can be a bit blunt and maybe its even wrong *but* the content was good if not the delivery :) As a support person myself it is extremely annoying when soemone comes up and says "My

Re:Printing to file

2004-10-26 Thread lashley ray
I like Gunnar, professional, to the point. He answers alot of questions too. 'The silent majority' -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Printing to a file

2004-10-26 Thread DBSMITH
I agree, Gunnar is mean. Mean people suck! derek Chap Harrison <[EMAIL PROTECTED]> 10/26/2004 01:37 PM To: Gunnar Hjalmarsson <[EMAIL PROTECTED]> cc: Perl Lists <[EMAIL PROTECTED]> Subject:Re: Printing to a file > Wait a minute there. I'm not lear

RE: Printing to a file

2004-10-26 Thread Brian Gunlogson
Oops, my bad. This looked like a problem I had. I stored a filehandle in a hash, and it confused print when I accessed the filehandle as a scalar. I'd better think before I post again... *blush* --- Bob Showalter <[EMAIL PROTECTED]> wrote: > Brian Gunlogson wrote: > > Put the MY in braces. > >

Re: Printing to a file

2004-10-26 Thread Gunnar Hjalmarsson
Chap Harrison wrote: Ah-freakin'-men. Gunnar, what the *hell*? I've been reading this list for a couple of months now and the majority of your posts seem to be little more than chiding people in an extremely unpleasant tone. If you find a *particular* post "extremely unpleasantly" worded, pleas

Re: Printing to a file

2004-10-26 Thread Steve Bertrand
> On Tue, 26 Oct 2004 10:57:39 -0500, JupiterHost.Net > <[EMAIL PROTECTED]> wrote: >> >> >> Kevin Old wrote: >> >> > Hello everyone, >> > >> > First, this is a basic problem, but I have looked at it for over >> an >> > hour and wasted time. Now, I'm asking for help. >> > >> > For some reason nothi

Re: Printing to a file

2004-10-26 Thread Chap Harrison
Wait a minute there. I'm not learning programming. I've been a perl programmer for 7 years and have written hundreds of more complex programs than this and have written to thousands of files in my time. I just needed another pair of eyes to possibly point out what I was doing wrong. Also, posting

Re: Printing to a file

2004-10-26 Thread Kevin Old
On Tue, 26 Oct 2004 19:17:11 +0200, Gunnar Hjalmarsson <[EMAIL PROTECTED]> wrote: > Kevin Old wrote: > > First, this is a basic problem, but I have looked at it for over an > > hour and wasted time. Now, I'm asking for help. > > Just an hour, and you think it's already justified to "waste" hundre

RE: Printing to a file

2004-10-26 Thread Bob Showalter
Brian Gunlogson wrote: > Put the MY in braces. > > SO > print MY $line; > > WOULD BECOME > print {MY} $line; Why? That fails under use strict, and is totally unecessary. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Printing to a file

2004-10-26 Thread Kevin Old
On Tue, 26 Oct 2004 10:57:39 -0500, JupiterHost.Net <[EMAIL PROTECTED]> wrote: > > > Kevin Old wrote: > > > Hello everyone, > > > > First, this is a basic problem, but I have looked at it for over an > > hour and wasted time. Now, I'm asking for help. > > > > For some reason nothing is being pr

Re: Printing to a file

2004-10-26 Thread Gunnar Hjalmarsson
Kevin Old wrote: First, this is a basic problem, but I have looked at it for over an hour and wasted time. Now, I'm asking for help. Just an hour, and you think it's already justified to "waste" hundreds of other person's time? I disagree. You need to be a lot more patient if you want to learn

Editting the registry?

2004-10-26 Thread adisegna
I want to restore the default admin shares on a user's machine. I have to delete the following key from the registry. To restore the default hidden administrative shares, delete the AutoShareWks DWORD value in the following registry key, and then restart your computer: HKEY_LOCAL_MACHINE\SYSTEM\

Re: Printing to a file

2004-10-26 Thread Brian Gunlogson
Put the MY in braces. SO print MY $line; WOULD BECOME print {MY} $line; --- Kevin Old <[EMAIL PROTECTED]> wrote: > Hello everyone, > > First, this is a basic problem, but I have looked at it for over an > hour and wasted time. Now, I'm asking for help. > > For some reason nothing is being pr

RE: MySQL+foreach loop.........roy

2004-10-26 Thread Chris Devers
On Tue, 26 Oct 2004, Bob Showalter wrote: > Chris Devers wrote: > > On Tue, 26 Oct 2004, Murphy, Ged (Bolton) wrote: > > > > > Going back a few years here, but does an SQL statement not have to > > > end in a semi-colon as above? > > > > I think it depends on your SQL interpreter. > > > > The

Re: Printing to a file

2004-10-26 Thread JupiterHost.Net
Kevin Old wrote: Hello everyone, First, this is a basic problem, but I have looked at it for over an hour and wasted time. Now, I'm asking for help. For some reason nothing is being printed to the MY filehandle. Can someone see what I'm doing wrong? Is if ( $_ =~ /40187378|40187233|40187230|4018

RE: MySQL+foreach loop.........roy

2004-10-26 Thread Bob Showalter
Chris Devers wrote: > On Tue, 26 Oct 2004, Murphy, Ged (Bolton) wrote: > > > Going back a few years here, but does an SQL statement not have to > > end in a semi-colon as above? > > I think it depends on your SQL interpreter. > > The MySQL command line interface `mysql` expect semi-colons, as d

Printing to a file

2004-10-26 Thread Kevin Old
Hello everyone, First, this is a basic problem, but I have looked at it for over an hour and wasted time. Now, I'm asking for help. For some reason nothing is being printed to the MY filehandle. Can someone see what I'm doing wrong? #!/usr/bin/perl

RE: MySQL+foreach loop.........roy

2004-10-26 Thread Chris Devers
On Tue, 26 Oct 2004, Murphy, Ged (Bolton) wrote: > Going back a few years here, but does an SQL statement not have to end > in a semi-colon as above? I think it depends on your SQL interpreter. The MySQL command line interface `mysql` expect semi-colons, as does the `psql` tool for PostgreSQ

RE: MySQL+foreach loop.........roy

2004-10-26 Thread Murphy, Ged (Bolton)
Roime bin Puniran, wrote: >#Prepare the insert SQL >my $rec = $dbh->prepare("INSERT INTO t_flows(ipSrc, ipDst, pktSent, bytesSent, startTime, endTime, srcPort, >dstPort, tcpFlags, proto, tos) VALUES ('$value1', '$value2', '$value3', '$value4', '$value5', '$value6', >'$value7', '$value8', '$va

RE: questions

2004-10-26 Thread Charles K. Clarkson
M. Ilyas Hassan <[EMAIL PROTECTED]> wrote: : The input file is a flat file (.txt) parsed by "~" with 40 : columns. Columns 2-40 has numbers (all integers, +ve and -ve : numbers). Column 0 has items in alphanumeric and column 1 has : labels in text. I would like to find the minimum value for : numb

Re: Interactive socket client

2004-10-26 Thread mgoland
- Original Message - From: "mkondelk" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, October 25, 2004 6:39 AM Subject: Interactive socket client > I have this interactice client: > > #!/usr/bin/perl -w > use strict; > use IO::Socket; > my ($host, $port, $kidpid, $handle, $lin

Re: problem printf

2004-10-26 Thread deny
Jenda P.S.: What the heck is find.pl? You should be using File::Find! thanks for your help -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Reading from a filehandle in while-loop

2004-10-26 Thread Bob Showalter
David le Blanc wrote: ... > You are making the assumption that '' sets '$_' which is not > true. Oddly, perl makes '<>' set $_, but not ... dunno why Sorry, but that's just not correct. while () DOES set $_, as documented in perldoc perlop under the secion "I/O Operators" The OP has some o

Re: Reading from a filehandle in while-loop

2004-10-26 Thread David le Blanc
On Tue, 26 Oct 2004 11:33:24 +0200, Bastian Angerstein <[EMAIL PROTECTED]> wrote: > > Why does this don´t work in my Script? > > open (TEST, " while () { > print $_; > # or just > print; > } You are making the assumption that '' sets '$_' which is not true. Oddly, perl makes '<>' set $_, bu

RE: array of references

2004-10-26 Thread Bob Showalter
Scott Pham wrote: > I've been thinking about this and not sure how to approach this > problem. Say I want to create an array of 4 array references, thats > easy since I know that there will be 4 array references, how would I > do this dynamically? Say if one I only needed 2 references and > another

RE: questions

2004-10-26 Thread Bob Showalter
M. Ilyas Hassan wrote: > hi, > Could someone please help me with the following perl questions. > > #1 - Is there a way to add "days" to a date? I want > end_date=start_date+90days; where start_date is in the format > 10/25/04; the output end_date should be in the same format as well. I > was not s

Re: Extracting Directories and Sub Directories

2004-10-26 Thread Gunnar Hjalmarsson
Ron Smith wrote: The sulution that you and others gave to the previous problem worked out fine. I thought I sent mail regarding that. You may have done that; sorry if I was mistaken. I didn't think that this was related to that problem; but, it is very similar. What I mean is that I believe it woul

Re: Reading from a filehandle in while-loop

2004-10-26 Thread Flemming Greve Skovengaard
Bastian Angerstein wrote: I noticed that while ($test=) works on my system perfectly but while () donÂt ... donÂt know why... should reinstall perl. Thanks for your help Bastian They should both work, why they don't is beyond me. Please post on the list, I am *not* a all-seeing, all-knowing Perl g

Re: Reading from a filehandle in while-loop

2004-10-26 Thread Flemming Greve Skovengaard
Bastian Angerstein wrote: Joop, if I use open... or die "$!" i see that the file is opened correctly but nothing is in $_. -UrsprÃngliche Nachricht- Von: Flemming Greve Skovengaard [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 26. Oktober 2004 11:45 An: [EMAIL PROTECTED] Cc: Bastian Anger

AW: Reading from a filehandle in while-loop

2004-10-26 Thread Bastian Angerstein
Joop, if I use open... or die "$!" i see that the file is opened correctly but nothing is in $_. -UrsprÃngliche Nachricht- Von: Flemming Greve Skovengaard [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 26. Oktober 2004 11:45 An: [EMAIL PROTECTED] Cc: Bastian Angerstein Betreff: Re: Read

Re: Reading from a filehandle in while-loop

2004-10-26 Thread Flemming Greve Skovengaard
Bastian Angerstein wrote: Why does this donÂt work in my Script? open (TEST, ") { print $_; # or just print; } Does the file exists and can you read it? -- Flemming Greve SkovengaardThe killer's breed or the Demon's seed, a.k.a Greven, TuxPowerThe glamour, the for

Reading from a filehandle in while-loop

2004-10-26 Thread Bastian Angerstein
Why does this don´t work in my Script? open (TEST, ") { print $_; # or just print; } -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: problem printf

2004-10-26 Thread Flemming Greve Skovengaard
deny wrote: Try to add this lines somewhere the top of the file: use strict; use warnings; and report the errors, if any. Global symbol "$md5" requires explicit package name at ./checksum.pl line 11. Global symbol "@dirs" requires explicit package name at ./checksum.pl line 12. Global symbol "$d

Re: questions

2004-10-26 Thread M. Ilyas Hassan
hi Chris, Thanks for the responses. Q1: Your suggestion would work without the date module for now :-) Q2: The input file is a flat file (.txt) parsed by "~" with 40 columns. Columns 2-40 has numbers (all integers, +ve and -ve numbers). Column 0 has items in alphanumeric and column 1 has labels i

RE: MySQL+foreach loop.........roy

2004-10-26 Thread Charles K. Clarkson
Roime bin Puniran <[EMAIL PROTECTED]> wrote: : I have a script that read some text file in the directory. All : the data inside the text file then would be extracted into my : sql, and i used foreach loop to read the text file, then doing : some loop while data are sorted. Here is my code. Yo