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: [EMAIL

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.

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 in

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 $dir

Reading from a filehandle in while-loop

2004-10-26 Thread Bastian Angerstein
Why does this don´t work in my Script? open (TEST, /tmp/test.txt); while (TEST) { print $_; # or just print; } -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response

Re: Reading from a filehandle in while-loop

2004-10-26 Thread Flemming Greve Skovengaard
Bastian Angerstein wrote: Why does this dont work in my Script? open (TEST, /tmp/test.txt); while (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, TuxPower

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 $_. -Ursprngliche Nachricht- Von: Flemming Greve Skovengaard [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 26. Oktober 2004 11:45 An: [EMAIL PROTECTED] Cc: Bastian Angerstein Betreff: Re:

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 $_. -Ursprngliche Nachricht- Von: Flemming Greve Skovengaard [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 26. Oktober 2004 11:45 An: [EMAIL PROTECTED] Cc: Bastian

Re: Reading from a filehandle in while-loop

2004-10-26 Thread Flemming Greve Skovengaard
Bastian Angerstein wrote: I noticed that while ($test=TEST) works on my system perfectly but while (TEST) dont ... dont 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

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

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

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 I

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, /tmp/test.txt); while (TEST) { print $_; # or just print; } You are making the assumption that 'TEST' sets '$_' which is not true. Oddly, perl makes

RE: Reading from a filehandle in while-loop

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

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] http://learn.perl.org/ http://learn.perl.org/first-response

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, $line); unless

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 : numbers

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',

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

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 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 does 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 ( $_ =~

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 MySQL command line

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 printed

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:

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

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 printed to the MY

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] http://learn.perl.org/

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 hundreds of

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,

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 nothing is being printed to the MY

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, please

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. SO

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 learning

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] http://learn.perl.org/ http://learn.perl.org/first-response

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 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] wrote: I

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] http://learn.perl.org/ http://learn.perl.org/first-response

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: [EMAIL

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( /tmp/savedata/new/$_)

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 [EMAIL

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; #my $fh = IO::File-new(

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: 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 a

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 hard to

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

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 and a regular

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()

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

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/2454

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] http://learn.perl.org/ http://learn.perl.org/first-response

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

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

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: , sort(keys

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 %sequences) {

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: 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 'TEST' sets '$_' which is not David true. Oddly, perl makes '' set $_, but not FILE... dunno why No, that's completely wrong. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777

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 disagrees then. I

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