AW: AW: Need help to divert HTML print ETHL to file.txt

2004-02-19 Thread B. Fongo
I've finally got it. As suggested, I want back to declare my variables with my only within the scope where they're needed. Out of all those regex examples, I came out with one that solved my problem with ease. But I find the use of hash (suggested by Joseph) would have been better. Thanks to

Re: Reading tab delimited File sort everything according item 5 of every line

2004-02-19 Thread Bjorn Van Blanckenberg
thanks for help owen and Randy, Sorry it took so lang for responding and thanking you but I was on a long vacation I just want to say that I have made a mistake in the question, It doesn't have to sorted by item 5 but needs to look for everything that contains item 5 and than be sorted by item

Re: For NULL values. RE: Getting uninitialized value error msg., d on't know why (Win32::ODBC)

2004-02-19 Thread Rob Dixon
Chris McMahon wrote: This script: *** use warnings; use Win32:ODBC; my $db = new Win32::ODBC(TheDB); $db-Sql(SELECT * FROM dbo.foo); $db-FetchRow(); my @values = $db-Data; print @values; * Yields two Use of

Re: Problem with LWP::UserAgent

2004-02-19 Thread Rob Dixon
Rajesh Dorairajan wrote: I've had this problem for a long time and I am in a sort of a dead-end and could use some help. When I make a get request using the LWP UserAgent inside a function and I pass a URL to the function as a string I get a response. However, when I pass a variable that

RE: ways I might parse data in perl and give it to a telnet sessi on

2004-02-19 Thread West, William M
Is there any separate reason to use 'expect' Perl will happily talk telnet and ftp on its own. Rob well- namely that it works- i honestly don't know /how/ to get perl to talk telnet *laugh* i guess the proper module would help. i will investigate this possibility and see what happens :) off

Could I put commands in a variable

2004-02-19 Thread Joel
If I was using one specific group of commands, Could I put them inside a variable, then just use the variable when I needed the commands instead of copying and pasting them? i.e. print Hello world; if ($i == 50) { goto MAIN; } elsif ($t == 100) { goto SECONDARY; } as compared to

Re: Could I put commands in a variable

2004-02-19 Thread Rob Dixon
Joel wrote: If I was using one specific group of commands, Could I put them inside a variable, then just use the variable when I needed the commands instead of copying and pasting them? i.e. print Hello world; if ($i == 50) { goto MAIN; } elsif ($t == 100) { goto SECONDARY;

Re: ways I might parse data in perl and give it to a telnet sessi on

2004-02-19 Thread Rob Dixon
William M West wrote: Is there any separate reason to use 'expect'? Perl will happily talk telnet and ftp on its own. Rob well- namely that it works- i honestly don't know /how/ to get perl to talk telnet *laugh* i guess the proper module would help. i will investigate this

Re: Could I put commands in a variable

2004-02-19 Thread R. Joseph Newton
Joel wrote: If I was using one specific group of commands, Could I put them inside a variable, then just use the variable when I needed the commands instead of copying and pasting them? Yes. You could do that. It would be a step backward, though. Variables are for storing data or

RE: Could I put commands in a variable

2004-02-19 Thread Dan Muey
For instance: sub launch_viewer { my $for_path = shift; $message_viewer = create_main_viewer_window(); add_main_menu($message_viewer); add_header_list($message_viewer, $for_path); add_message_area($message_viewer); print get_viewer_option('Files|References'), \n;

Re: Re: RE: capture a website and process its data

2004-02-19 Thread scott . e . robinson
Great job, Rob! Thanks for the good code! Quite a timesaver. Scott Scott E. Robinson SWAT Team Data Mgt Practices Operations (DMPO) RR-690 -- 281-654-5169 EMB-2813N -- 713-656-3629 Safety is never an accident - Forwarded by Scott E Robinson/U-Houston/ExxonMobil on 02/19/04 09:29 AM

arrays/hashes

2004-02-19 Thread jeffrey_n_Dyke
Hello, I had a simple array in mind, but as i got reacquainted with PERL, with the help of the list, i realized i was thinking to small. (that's always dangerous) Anyway. I have an array/hash(still learning the technical differences) similar to (pardon syntax irregularities, just trying

Re: Re: RE: capture a website and process its data

2004-02-19 Thread Rob Dixon
Scott E Robinson wrote: Great job, Rob! Thanks for the good code! Quite a timesaver. K Gupta A wrote: wow Rob, thaz a masterpiece code!! 3 cheers for you!! Thanks guys, but I expected a few questions from that post. Please be sure you /understand/ as much as possible before you use it.

Re: ways I might parse data in perl and give it to a telnet sessi on

2004-02-19 Thread WC -Sx- Jones
West, William M wrote: Is there any separate reason to use 'expect' Perl will happily talk telnet and ftp on its own. expect.nist.gov expect ??? A fine, if under valued, development system. well- namely that it works- i honestly don't know /how/ to get perl to talk telnet *laugh* i guess the

Re: arrays/hashes

2004-02-19 Thread Rob Dixon
Hi Jeffrey. There are several questions here, so I've answered in-line. Jeffrey N Dyke wrote: I had a simple array in mind, but as i got reacquainted with PERL, with the help of the list, i realized i was thinking to small. (that's always dangerous) On the contrary, I think thinking BIG is

RE: An Old Question on Sorting Hash of Arrays by Array element an d th en by key

2004-02-19 Thread Smith Jeff D
Thanks for the feedback--maybe I screwed up but what happens for me is that the ordered array (1) only lists the keys, not the array values the hash key points to and (2) I still don't get an ordered list of the keys that are put in the ordered array--it comes out un-ordered. I took your line

Re: An Old Question on Sorting Hash of Arrays by Array element an d th en by key

2004-02-19 Thread WC -Sx- Jones
Smith Jeff D wrote: Thanks for the feedback--maybe I screwed up but what happens for me is that the ordered array (1) only lists the keys, not the array values the hash key points to and (2) I still don't get an ordered list of the keys that are put in the ordered array--it comes out un-ordered.

Re: Could I put commands in a variable

2004-02-19 Thread Rob Dixon
R. Joseph Newton wrote: i.e. print Hello world; if ($i == 50) { goto MAIN; Don't do this. For some perverse reason, goto was included in the Perl language. This may have been to support legacy programs. No new code should ever be written with such structures. They have been

Re: An Old Question on Sorting Hash of Arrays by Array element an d th en by key

2004-02-19 Thread James Edward Gray II
On Feb 19, 2004, at 10:25 AM, Smith Jeff D wrote: Thanks for the feedback--maybe I screwed up but what happens for me is that the ordered array (1) only lists the keys, not the array values the hash key points to and (2) I still don't get an ordered list of the keys that are put in the ordered

Re: An Old Question on Sorting Hash of Arrays by Array element and then by key

2004-02-19 Thread WC -Sx- Jones
%HofA = (orange=['ZZZ', 'ANDY'], red=['AAA', 'AL'], blue=['mmm','Betty'], yellow=['aaa', 'ZEUS'], green=['DDD','Mary Joe'], violet=['MMM','Hugo'] ); my @ordered_keys = sort { $HofA{$a}[0] cmp $HofA{$b}[1] || $a

Re: An Old Question on Sorting Hash of Arrays by Array element an d th en by key

2004-02-19 Thread Rob Dixon
Jeff Smith wrote: Thanks for the feedback--maybe I screwed up but what happens for me is that the ordered array (1) only lists the keys, not the array values the hash key points to and (2) I still don't get an ordered list of the keys that are put in the ordered array--it comes out

YA Win32::ODBC question: script hangs on 16th table.

2004-02-19 Thread McMahon, Chris
Hello... I'm leaving aside the NULL issue for the moment... Today's project is to get a complete list of column names for each table in the database, and the value for the first record (row) in each table. This code does the right thing for 15 tables and then hangs and quits

RE: An Old Question on Sorting Hash of Arrays by Array element an d th en by key

2004-02-19 Thread Smith Jeff D
I really need to order both the keys and one of the elements in the array stored as a value in the hash, preferably sort first on the first element of the array (my real application has four elements but the snippet I'm testing with has a two-element array) and then sort secondly on the key. So

RE: Problem with LWP::UserAgent

2004-02-19 Thread david
Rajesh Dorairajan wrote: Sorry the syntax error was by mistake. It's not in the actual code. next time when you post please do not retype your script. try copy and paste the whole script over so you can avoid typo. please do not top post. when you reply to any message, post your respond

Re: An Old Question on Sorting Hash of Arrays by Array element an d th en by key

2004-02-19 Thread WC -Sx- Jones
Smith Jeff D wrote: I really need to order both the keys and one of the elements in the array stored as a value in the hash, preferably sort first on the first element of the array (my real application has four elements but the snippet I'm testing with has a two-element array) and then sort

Re: An Old Question on Sorting Hash of Arrays by Array element an d th en by key

2004-02-19 Thread Rob Dixon
Jeff Smith wrote: I really need to order both the keys and one of the elements in the array stored as a value in the hash, preferably sort first on the first element of the array (my real application has four elements but the snippet I'm testing with has a two-element array) and then sort

Re: question about select

2004-02-19 Thread david
Papo Napolitano wrote: On Feb 18, 2004, at 4:45 PM, Papo Napolitano wrote: Heh, sorry... I simplified the code... I'm still not posting the full source because it's like 15 files :( while (1) { Fork(Whatever); sleep 60; } The first time you showed this loop, it had

Re: Could I put commands in a variable

2004-02-19 Thread Joel
Yes, BASIC is the only programming I have ever done. All I can really remember was PRINT, GOTO, and a variety of line numbers. I'm trying to write a text adventure (Don't look at me like that, Perl is a general purpose language!). I'm getting tired of writing large chunks of code that I reuse the

Re: arrays/hashes

2004-02-19 Thread jeffrey_n_Dyke
Hi Jeffrey. There are several questions here, so I've answered in-line. Rob, thanks a ton. that worked perfectly, as has the rest of the processing of the larger hash. Thought i'd address the build portion below, to see if i'm not utilizing PERL's strengths correctly. First PERL i've

Re: Could I put commands in a variable

2004-02-19 Thread Daniel Staal
--As of Thursday, February 19, 2004 2:22 PM -0500, Joel is alleged to have said: Yes, BASIC is the only programming I have ever done. All I can really remember was PRINT, GOTO, and a variety of line numbers. I'm trying to write a text adventure (Don't look at me like that, Perl is a general

Re: Could I put commands in a variable

2004-02-19 Thread James Edward Gray II
On Feb 19, 2004, at 1:22 PM, Joel wrote: Yes, BASIC is the only programming I have ever done. All I can really remember was PRINT, GOTO, and a variety of line numbers. Most of us were there at some point. We just don't talk about it much. :D I'm trying to write a text adventure (Don't look at

Re: arrays/hashes

2004-02-19 Thread James Edward Gray II
On Feb 19, 2004, at 1:25 PM, [EMAIL PROTECTED] wrote: Thought i'd address the build portion below, to see if i'm not utilizing PERL's strengths correctly. First PERL i've written in 3+ years. Perl. The language you are relearning is called Perl, not PERL. ;) James -- To unsubscribe,

Perl FTP error?

2004-02-19 Thread Jas
Still new to perl... trying to create an FTP connection to move backups from one machine to another. Code... #!/usr/bin/perl # Backup tyr web directory # to ODIN via FTP # Begin remote transfer of file(s) # use Net::FTP; $ftp = Net::FTP-new(hostname, Debug = 1) or die Could establish conneciton

FTP Errors?

2004-02-19 Thread Jas
Still new to using Perl, any help with this is appreciated. Code... #!/usr/bin/perl # Backup 192.168.0.1 web directory # to 192.168.0.2 via FTP # Begin remote transfer of file to ODIN for storage # use Net::FTP; $ftp = Net::FTP-new(192.168.0.2, Debug = 1) or die Could establish conneciton to

Re: Could I put commands in a variable

2004-02-19 Thread Joel
I'll post the code tommorow. I just need to change all the room descriptions and items, since the the characters and places depicted in the game are copyrighted. I wrote it as a fan work. Joel - Original Message - From: James Edward Gray II [EMAIL PROTECTED] To: Joel [EMAIL PROTECTED]

FTP Errors?

2004-02-19 Thread Jas
new to perl... I am recieving errors when trying open an FTP connection. Code... #!/usr/bin/perl # Backup 192.168.0.2 web directory # to 192.168.0.3 via FTP # Begin remote transfer of file to 192.168.0.3 for storage # use Net::FTP; $ftp = Net::FTP-new(192.168.0.3, Debug = 1) or die Could

Re: Could I put commands in a variable

2004-02-19 Thread Rob Dixon
Joel wrote: I'll post the code tommorow. I just need to change all the room descriptions and items, since the the characters and places depicted in the game are copyrighted. I wrote it as a fan work. You'll find lots of support here Joel. I fondly remember playing Dungeon on a 12-bit PDP8.

RE: Could I put commands in a variable

2004-02-19 Thread Bob Showalter
Joel wrote: Yes, BASIC is the only programming I have ever done. All I can really remember was PRINT, GOTO, and a variety of line numbers. I'm trying to write a text adventure (Don't look at me like that, Perl is a general purpose language!). I'm getting tired of writing large chunks of code

Re: An Old Question on Sorting Hash of Arrays by Array element an d th en by key

2004-02-19 Thread James Edward Gray II
On Feb 19, 2004, at 10:48 AM, Smith Jeff D wrote: I really need to order both the keys and one of the elements in the array stored as a value in the hash, preferably sort first on the first element of the array (my real application has four elements but the snippet I'm testing with has a

Re: Re: Re: RE: capture a website and process its data

2004-02-19 Thread K Gupta A
Hi Rob, I implemented your code and it gave perfectly desired answers. But I couldn't understand most of it. So, currently I went ahead with Dan's tips on my code only and would try to understand your code later after I meet a deadline for a small project of mine in college for tomorrow! So, no

Re: FTP Errors?

2004-02-19 Thread Rob Dixon
Hi Jas. Jas wrote: Still new to using Perl, any help with this is appreciated. Code... #!/usr/bin/perl # Backup 192.168.0.1 web directory # to 192.168.0.2 via FTP # Begin remote transfer of file to ODIN for storage # use Net::FTP; $ftp = Net::FTP-new(192.168.0.2, Debug = 1) or die

AW: Regex to find group of image files

2004-02-19 Thread B. Fongo
I thought I could solve the regex issue a different way, but failed. My $path = Mazda.1.jpg ; ($file, $dir, $ext) = fileparse ($path, '\..*' ); #I'm trying to get Mazda.2.jpg and Mazda.3.jpg. # $file contains Mazda, so why does this regex fail to deliver Mazda.2.jpg # and Mazda.3.jp? my

Memory problem? Threads problem? RE: YA Win32::ODBC question: s cript hangs on 16th table.

2004-02-19 Thread McMahon, Chris
More error diagnosis below: Hello... I'm leaving aside the NULL issue for the moment... Today's project is to get a complete list of column names for each table in the database, and the value for the first record (row) in each table. This code does the right thing for

Re: FTP Errors?

2004-02-19 Thread Wiggins d Anconia
Hi Jas. Jas wrote: [snip] $ftp-put(`../path/to/*-www.tar.gz`) or die Could not transfer files , $ftp-message; .. backticks in two statements! $ftp-quit; Error... Net::FTP Net::FTP(2.71) Net::FTP Exporter(5.566) Net::FTP Net::Cmd(2.24) Net::FTP

Re: FTP Errors?

2004-02-19 Thread Wiggins d Anconia
Hi Jas. Jas wrote: [snip] $ftp-put(`../path/to/*-www.tar.gz`) or die Could not transfer files , $ftp-message; .. backticks in two statements! $ftp-quit; Error... Net::FTP Net::FTP(2.71) Net::FTP Exporter(5.566) Net::FTP Net::Cmd(2.24) Net::FTP

switch statement

2004-02-19 Thread Anthony Vanelverdinghe
Hi Could anyone please tell me what's wrong with the following program? The compiler gives errors in the switch statement. Thx!! Anthony %commands=('v',0,'w',1,'t',2,'/pattern/',3,'s',4,'x',5); $end = 0; while (!end){ print bookmarks.html; $operation = ; chop $operation;

Re: switch statement

2004-02-19 Thread Daniel Staal
--As of Thursday, February 19, 2004 10:14 PM +0100, Anthony Vanelverdinghe is alleged to have said: Could anyone please tell me what's wrong with the following program? The compiler gives errors in the switch statement. --As for the rest, it is mine. You mean, besides the fact that Perl doesn't

Re: Perl FTP error?

2004-02-19 Thread Tim
At 10:53 AM 2/19/04 -0700, you wrote: Still new to perl... trying to create an FTP connection to move backups from one machine to another. Code... #!/usr/bin/perl # Backup tyr web directory # to ODIN via FTP # Begin remote transfer of file(s) # use Net::FTP; $ftp = Net::FTP-new(hostname, Debug =

Re: switch statement

2004-02-19 Thread Anthony Vanelverdinghe
Didn't know it wasn't in Perl, but I've just discovered it's possible with some file called Switch.pm From: Daniel Staal [EMAIL PROTECTED] Reply-To: Perl Beginners [EMAIL PROTECTED] To: Perl Beginners [EMAIL PROTECTED] Subject: Re: switch statement Date: Thu, 19 Feb 2004 16:21:22 -0500 --As of

Re: switch statement

2004-02-19 Thread James Edward Gray II
On Feb 19, 2004, at 3:14 PM, Anthony Vanelverdinghe wrote: Hi Howdy. Could anyone please tell me what's wrong with the following program? I'll try. The compiler gives errors in the switch statement. Perl doesn't have a native switch statement, but it is included as a module in 5.8+ Thx!!

Re: switch statement

2004-02-19 Thread Daniel Staal
--As of Thursday, February 19, 2004 10:29 PM +0100, Anthony Vanelverdinghe is alleged to have said: Didn't know it wasn't in Perl, but I've just discovered it's possible with some file called Switch.pm --As for the rest, it is mine. You mean the 'Switch' module. (Sorry, I should have mentioned

Re: An Old Question on Sorting Hash of Arrays by Array element an d th en by key

2004-02-19 Thread James Edward Gray II
On Feb 19, 2004, at 3:20 PM, Smith Jeff D wrote: Thanks, I must have missed it--I'll be getting back to it tomorrow morning to see what I missed in the original response. I thought I had run as printed below. No worries. You probably did run my original response, which was flawed. Mark gave

RE: An Old Question on Sorting Hash of Arrays by Array element an d th en by key

2004-02-19 Thread Smith Jeff D
Thanks, I must have missed it--I'll be getting back to it tomorrow morning to see what I missed in the original response. I thought I had run as printed below. Anyway, thank for the help...I think I may have braced when I should have paren'd... It so simple when someone else does it first I

Re: switch statement

2004-02-19 Thread WilliamGunther
The Advantage is you get to use the switch statement. The disadvantage is your code will run extraordinarily slow because the Switch module uses a run time Filter. In short: isn't an is-elsif-else statement enough?? In a message dated 2/19/2004 4:40:56 PM Eastern Standard Time, [EMAIL

Re: switch statement

2004-02-19 Thread u235sentinel
In addition, I've been playing around with the 'use diagnostics' feature in perl. That's in addition to 'use warnings'. I don't recommend it for regular coding but when stumped it may help. On Feb 19, 2004, at 3:14 PM, Anthony Vanelverdinghe wrote: Hi Howdy. Could anyone please

Re: Getting uninitialized value error msg., don't know why (Win32:: ODBC)

2004-02-19 Thread Jenda Krynicky
From: McMahon, Chris [EMAIL PROTECTED] Hello... This script: *** use warnings; use Win32:ODBC; my $db = new Win32::ODBC(TheDB); $db-Sql(SELECT * FROM dbo.foo); $db-FetchRow(); my @values = $db-Data; print @values;

Re: FTP Errors?

2004-02-19 Thread Rob Dixon
Wiggins D Anconia wrote: Rob wrote: The backticks are your problem: they will make Perl shell out to execute the string as a command. The 'sh: line1:' in your error message is the clue. Presumably you don't have execute permission for '../path/to/02192004-www.tar.gz'? Try this and

Re: switch statement

2004-02-19 Thread Rob Dixon
[EMAIL PROTECTED] wrote: The Advantage is you get to use the switch statement. The disadvantage is your code will run extraordinarily slow because the Switch module uses a run time Filter. In short: isn't an is-elsif-else statement enough?? Are you saying that 'if-elsif-else' is a

Re: An Old Question on Sorting Hash of Arrays by Array element an d th en by key

2004-02-19 Thread Rob Dixon
James Edward Gray II wrote: The Moral: Don't use the original message. Use this one. Far more reliable is: Don't do what I say, do what I mean. :) Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: switch statement

2004-02-19 Thread WilliamGunther
This: if ($op == 0) {} elsif ($op == 1) {} elsif ($op == 2) {} elsif ($op == 3) {} elsif ($op == 4) {} elsif ($op == 5) {} is faster than this: use Switch; switch ($op) { case 0 { last } case 1 { last } case 2 { last } case 3 { last } case 4 { last } case 5 { last } }

Re: question about select

2004-02-19 Thread Papo Napolitano
Papo Napolitano wrote: On Feb 18, 2004, at 4:45 PM, Papo Napolitano wrote: Heh, sorry... I simplified the code... I'm still not posting the full source because it's like 15 files :( while (1) { Fork(Whatever); sleep 60; } The first time you showed this loop,

Re: switch statement

2004-02-19 Thread Paul Johnson
On Thu, Feb 19, 2004 at 10:46:33PM -, Rob Dixon wrote: [EMAIL PROTECTED] wrote: The Advantage is you get to use the switch statement. The disadvantage is your code will run extraordinarily slow because the Switch module uses a run time Filter. In short: isn't an is-elsif-else

Re: Could I put commands in a variable

2004-02-19 Thread Joel
Here it is. Okay so it isn't tommorow. I shortened it a bit, but its the same really. Joel - Original Message - From: James Edward Gray II [EMAIL PROTECTED] To: Joel [EMAIL PROTECTED] Sent: Thursday, February 19, 2004 3:06 PM Subject: Re: Could I put commands in a variable (off list

Re: switch statement

2004-02-19 Thread James Edward Gray II
On Feb 19, 2004, at 5:21 PM, Paul Johnson wrote: The problem is that Switch.pm is a source filter, which is effectively an extra level of processing before compilation. Personally, I wouldn't use a source filter for anything I cared about. The docs for Switch state: There are undoubtedly

Help! Perl Substitution

2004-02-19 Thread Jeff Westman
I'm trying to help out another developer with a mini-Perl script. He has a file that contains one very long line, about 28M in size. He needs to do a replacement of all occurances of |^NEWLINE^|^ to a literal newline (HPUX, 0x0a or \n). When I ran this $ perl -ne

Re: switch statement

2004-02-19 Thread david
Rob Dixon wrote: [EMAIL PROTECTED] wrote: The Advantage is you get to use the switch statement. The disadvantage is your code will run extraordinarily slow because the Switch module uses a run time Filter. In short: isn't an is-elsif-else statement enough?? Are you saying that

Re: Help! Perl Substitution

2004-02-19 Thread david
Jeff Westman wrote: I'm trying to help out another developer with a mini-Perl script. He has a file that contains one very long line, about 28M in size. He needs to do a replacement of all occurances of |^NEWLINE^|^ to a literal newline (HPUX, 0x0a or \n). When I ran this $

Re: switch statement

2004-02-19 Thread John W. Krahn
Anthony Vanelverdinghe wrote: Hi Hello, Could anyone please tell me what's wrong with the following program? The compiler gives errors in the switch statement. %commands=('v',0,'w',1,'t',2,'/pattern/',3,'s',4,'x',5); $end = 0; while (!end){ print bookmarks.html; $operation = ; chop

Re: Help! Perl Substitution

2004-02-19 Thread Paul Johnson
On Thu, Feb 19, 2004 at 04:36:55PM -0800, david wrote: Jeff Westman wrote: I'm trying to help out another developer with a mini-Perl script. He has a file that contains one very long line, about 28M in size. He needs to do a replacement of all occurances of |^NEWLINE^|^ to a

Digest::MD5

2004-02-19 Thread Dave Tibbals
I am attempting to install the module Digest::MD5 and it fails with the makefile for the module. The error reported is *** missing separator. Stop. This is on a Red Hat WS 3 box with all the latest updates installed that includes perl 5.8. I thought Red Hat 7.3 had this same problem caused by

Re: Help! Perl Substitution

2004-02-19 Thread david
Paul Johnson wrote: [panda]# perl -ne 'BEGIN{$/=\10} s/\|\^NEWLINE\^\|\^/\n/g; print' [loadFile The trouble with this approach is that you will miss any separators which are split. Your example actually reads 10 bytes at a time, but using $/ is the right idea: perl -ple 'BEGIN {

Re: Help! Perl Substitution

2004-02-19 Thread Jeff Westman
Paul Johnson [EMAIL PROTECTED] wrote: On Thu, Feb 19, 2004 at 04:36:55PM -0800, david wrote: Jeff Westman wrote: I'm trying to help out another developer with a mini-Perl script. He has a file that contains one very long line, about 28M in size. He needs to do a replacement of

Re: Help! Perl Substitution

2004-02-19 Thread WC -Sx- Jones
Jeff Westman wrote: When I ran this $ perl -ne 's/|^NEWLINE^|^/\n/g;print' loadFile The program loads the ENTIRE loadfile and then splits characters at whitespace between characters and then prints every character followed by a newline. So, how big is loadfile?

Re: An Old Question on Sorting Hash of Arrays by Array element an d th en by key

2004-02-19 Thread John W. Krahn
Rob Dixon wrote: James Edward Gray II wrote: The Moral: Don't use the original message. Use this one. Far more reliable is: Don't do what I say, do what I mean. :) After all, Perl is a DWIM language. :-) John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL

Re: switch statement

2004-02-19 Thread WilliamGunther
I just benchmarked Filter, and it was worse than 100 times slower In a message dated 2/19/2004 6:53:56 PM Eastern Standard Time, [EMAIL PROTECTED] writes: last time i benchmark a source filter, it's about 100 times slower. has that change since v5.8? -Will

Re: Help! Perl Substitution

2004-02-19 Thread Jeff Westman
WC -Sx- Jones [EMAIL PROTECTED] wrote: Jeff Westman wrote: When I ran this $ perl -ne 's/|^NEWLINE^|^/\n/g;print' loadFile The program loads the ENTIRE loadfile and then splits characters at whitespace between characters and then prints every character followed by a

Re: Could I put commands in a variable

2004-02-19 Thread Daniel Staal
--As of Thursday, February 19, 2004 6:31 PM -0500, Joel is alleged to have said: Here it is. Okay so it isn't tommorow. I shortened it a bit, but its the same really. --As for the rest, it is mine. Here's a first approximation of a rewrite. ;-) (Major problem: it always asks what you want to

Re: Could I put commands in a variable

2004-02-19 Thread R. Joseph Newton
Rob Dixon wrote: IMO that's a bit strong. 'goto' will always have its place until language authors can predict all possible flows of control that could be wanted by a programmer. Perl is richer than most in that it has implicit gotos last, next, redo, return and die, but it still has no try

Re: Could I put commands in a variable

2004-02-19 Thread James Edward Gray II
On Feb 19, 2004, at 9:22 PM, R. Joseph Newton wrote: I don't know, Rob. I would be interested in hearing of any real-world problem that would demand this. I believe the text book example is a language that lacks support for something like Java's finally block. A goto can guarantee you get to

$self

2004-02-19 Thread Jacob Chapa
is $self a special scalar? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response

Re: $self

2004-02-19 Thread WilliamGunther
No. $self you'll usually see in a lot of Object Oriented applications. When a subroutine is called using the - operator ($mw = MainWindow-new, for example) the first arguement passed to that subroutine is the name of the package/class. So, $self is usually used to display this. So, a common

RE: $self

2004-02-19 Thread Ohad Ohad
No, but it's a cool convention From: Jacob Chapa [EMAIL PROTECTED] To: Perl Beginners [EMAIL PROTECTED] Subject: $self Date: Thu, 19 Feb 2004 22:23:14 -0600 is $self a special scalar? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Could I put commands in a variable

2004-02-19 Thread R. Joseph Newton
Dan Muey wrote: For instance: sub launch_viewer { my $for_path = shift; $message_viewer = create_main_viewer_window(); [snip pretty code IMHO] create_view_menu(); create_find_menu(); } Nice Joseph, If I'm looking at this right this is a GUI for viewing files?

bless

2004-02-19 Thread Jacob Chapa
what does bless do? -jake -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response

RE: YA Win32::ODBC question: script hangs on 16th table.

2004-02-19 Thread David le Blanc
Hello... I'm leaving aside the NULL issue for the moment... Is that wise ? :-) Today's project is to get a complete list of column names for each table in the database, and the value for the first record (row) in each table. This code does the right thing for 15 tables

RE: Re: RE: capture a website and process its data

2004-02-19 Thread David le Blanc
Scott E Robinson wrote: Great job, Rob! Thanks for the good code! Quite a timesaver. K Gupta A wrote: wow Rob, thaz a masterpiece code!! 3 cheers for you!! Thanks guys, but I expected a few questions from that post. Please be sure you /understand/ as much as possible before