Hash Performance/Optimization

2002-02-07 Thread Gfoo
Hello, I' m using a hash with quite long strings (scalars) used for its keys and values. I'm wondering how the size of these strings used (for keys and values) and the number of elements in the hash affect the hash performance and memory consumption. Are there any suggestions about hashes rega

Re: File Attributes

2002-02-07 Thread Jon Molin
There's some good documentation about this at: perldoc -f chmod /Jon Roman Hanousek wrote: > > I can't remember how, But how do i change the attribute of a file from read > only to writable and then back gain. > > Thanks > Roman > >

off topic question : simple shell script

2002-02-07 Thread Rahul Garg
well i need to write a shell script, what i want to do is open a file,read each line ,do operations and then close a file. open(HANDLE,filename); @files = ; foreach $line(@files) { # } close(HANDLE); How will i do it in shell script.. Thanks, Rahul

File Attributes

2002-02-07 Thread Roman Hanousek
I can't remember how, But how do i change the attribute of a file from read only to writable and then back gain. Thanks Roman -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: is Shell.pm deprecated?

2002-02-07 Thread Dean Theophilou
Yeah, even bigger than that! :) Dean -Original Message- From: Brett W. McCoy [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 07, 2002 6:17 PM To: Dean Theophilou Cc: [EMAIL PROTECTED] Subject: RE: is Shell.pm deprecated? On Thu, 7 Feb 2002, Dean Theophilou wrote: > No, I meant ET

RE: is Shell.pm deprecated?

2002-02-07 Thread Brett W. McCoy
On Thu, 7 Feb 2002, Dean Theophilou wrote: > No, I meant ETA (Estimated Time of Arrival). By the way, I was only kidding. > However, should you actually do it, then think of all the fame and fortune it > will bring you. :) You mean aside from Jendra's name being next to Larry Wall's in the cre

HTML::TreeBNuilder

2002-02-07 Thread Daniel Falkenberg
G'day all, Just wondering what my best way to extract the second part of my table... NOT YET AVAILABLE  If I use the following code I can extract the phone number but I can't extract the coverage outcome... @headers = qw/number coverage/; $te = new HTML::TableExtract( headers => [@headers] );

RE: is Shell.pm deprecated?

2002-02-07 Thread Dean Theophilou
No, I meant ETA (Estimated Time of Arrival). By the way, I was only kidding. However, should you actually do it, then think of all the fame and fortune it will bring you. :) Dean Theophilou -Original Message- From: Jenda Krynicky [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 07

Re: execute dynamic block of code

2002-02-07 Thread John
Actually in this case it logically doesn't matter when they get eval'd (other than the trivial ms of eval'ing twice if I call and print the string and it's not eval'd at assignment), but you're right, it's easier with single quotes. At Thursday, 7 February 2002, you wrote: >On Thu, 7 Feb 2002

RE: passing a hash using cgi.pm

2002-02-07 Thread Josiah Altschuler
I have a question about passing data through URL's. I'm passing hashes in a CGI script, but sometimes when I click on a link that passes a larger hash, nothing happens. I don't get any message. I'm guessing there is a limit to the amount of data I can pass through a URL? If this is the case, a

Re: execute dynamic block of code

2002-02-07 Thread Brett W. McCoy
On Thu, 7 Feb 2002, John wrote: > if ( $file =~ m#${templatedata}[\\/]usbank[\\/]piper_news# ) > { > $str = "UCM::ucmPiperNewsDB( \"$file\", \"INTERNET_\" . uc( $env > ), $script )"; > } > elsif ( $file =~ >m#${templatedata}[\\/]commercial_business[\\/]powertrack_news_article# > ) > { >

Re: execute dynamic block of code

2002-02-07 Thread Jeff 'japhy' Pinyan
On Feb 7, Jeff 'japhy' Pinyan said: > ($func, $fname, @args) = ( >"UCM::ucmPiperNewsDB", >\&UCM::ucmPiperNewsDB, >$file, uc("INTERNET_$env"), $script, > ); > > print "Simulating $func(@args)\n"; I meant to print $fname here, not $func. -- Jeff "japhy" Pinyan [EMAIL PROTECTE

Re: execute dynamic block of code

2002-02-07 Thread Jeff 'japhy' Pinyan
On Feb 7, John said: >I don't know if this will make any sense out of context and without >the modules that are used, but here's the current code. >if ( $file =~ m#${templatedata}[\\/]usbank[\\/]piper_news# ) >{ >$str = "UCM::ucmPiperNewsDB( \"$file\", \"INTERNET_\" . uc( $env >), $script

Re: execute dynamic block of code

2002-02-07 Thread John
I don't know if this will make any sense out of context and without the modules that are used, but here's the current code. Thanks, -John if ( $file =~ m#${templatedata}[\\/]usbank[\\/]piper_news# ) { $str = "UCM::ucmPiperNewsDB( \"$file\", \"INTERNET_\" . uc( $env ), $script )"; } el

Re: accessing CGI.pm params directly

2002-02-07 Thread Jenda Krynicky
Date sent: Thu, 7 Feb 2002 18:13:05 -0500 (EST) From: "Brett W. McCoy" <[EMAIL PROTECTED]> To: Jenda Krynicky <[EMAIL PROTECTED]> Copies to: "Beginners (E-mail)" <[EMAIL PROTECTED]> Subject:Re: accessing CGI.pm params

Re: execute dynamic block of code

2002-02-07 Thread Brett W. McCoy
On Thu, 7 Feb 2002, John wrote: > I have a block of code which determines what subroutine to call and > what parameters to pass, I want to put the statement to execute in > a variable. At the end of the block I would like to output/print > the variable containing the subroutine to be called and

execute dynamic block of code

2002-02-07 Thread John
I have a block of code which determines what subroutine to call and what parameters to pass, I want to put the statement to execute in a variable. At the end of the block I would like to output/print the variable containing the subroutine to be called and call it. I played around with do and

Re: accessing CGI.pm params directly

2002-02-07 Thread Brett W. McCoy
On Thu, 7 Feb 2002, Jenda Krynicky wrote: > P.S.: I am not using Perl for CGI but ... I looked for a "proper" > widely used & tested HTML escape function in the common > modules and did not find any. I was not looking hard enough, right? You can use HTML::Entities and URI::Escape for escaping of

Re: accessing CGI.pm params directly

2002-02-07 Thread Jenda Krynicky
From: "Scott Lutz" <[EMAIL PROTECTED]> > I want to access parameters right out of the query_string with out > having to declare them into distinct variables first, but always come > up with hash reference errors. > > This is what I tried : > print qq{ value="$q->param('owner_em

Re: accessing CGI.pm params directly

2002-02-07 Thread Brett W. McCoy
On Thu, 7 Feb 2002, Scott Lutz wrote: > I want to access parameters right out of the query_string with out > having to declare them into distinct variables first, but always come up > with hash reference errors. > > This is what I tried : > print qq{ value="$q->param('owner_email')">\n}; > > and

accessing CGI.pm params directly

2002-02-07 Thread Scott Lutz
I want to access parameters right out of the query_string with out having to declare them into distinct variables first, but always come up with hash reference errors. This is what I tried : print qq{\n}; and get this output : Can anyone lend a learning hand here as to what I am doing wrong??

RE: Hash Question

2002-02-07 Thread Chas Owens
On Thu, 2002-02-07 at 14:27, Balint, Jess wrote: > After hours of pondering and sitting in wonder of simple it is, I have come > up with something. I do believe that this: > > for my $i (0..$#keys) { > > Quite possibly should be > > foreach ( @keys ) { > > Otherwise, why would yo

Re: Using the conditional operator

2002-02-07 Thread Brett W. McCoy
On Thu, 7 Feb 2002, Balint, Jess wrote: > Hello all. I have the following construct: > > $freqidx{$key}[$_] += $fields[$vars[$_-1]] for( 0..$#vars ); > > It is inside some type of loop. What I need to do is use the conditional > operator if possible to do something like this: > > if( $fie

Re: memory issues reading large files

2002-02-07 Thread Brett W. McCoy
On Thu, 7 Feb 2002, Brian Hayes wrote: > It appears the problem was using the foreach statement instead of while. > I have not tested this extensively, but using foreach the whole text > file (or output of pipe) is read into memory before continuing, but > using while (and probably for) each line

Re: perl module for Win32

2002-02-07 Thread Jenda Krynicky
From: "Morse, Loretta" <[EMAIL PROTECTED]> > Does anyone know of a perl module for Win32 that will set profile > strings in a .ini file? There are many. Win32::AdminMisc, Win32::FileOp, Win32-Tie-Ini, Config-Ini, Config-IniFiles ... Even c:\> PPM search INI gives you

Using the conditional operator

2002-02-07 Thread Balint, Jess
Hello all. I have the following construct: $freqidx{$key}[$_] += $fields[$vars[$_-1]] for( 0..$#vars ); It is inside some type of loop. What I need to do is use the conditional operator if possible to do something like this: if( $fields[$vars[$_-1]] ne "" ) { $freqidx{$key}[$_]

Re: memory issues reading large files

2002-02-07 Thread Brian Hayes
It appears the problem was using the foreach statement instead of while. I have not tested this extensively, but using foreach the whole text file (or output of pipe) is read into memory before continuing, but using while (and probably for) each line is processed as it is read. Thanks for all y

Re: retrieving info from function

2002-02-07 Thread John W. Krahn
Jesse Ahrens wrote: > > The gethostbyname() function returns 5 variables, the last on addrs is an > array. How do I specify the function to only return that array rather than > the 4 strings and 1 array? (undef,undef,undef,undef,@addrs) = gethostbyname( ... ); # OR @addrs = (gethostbyname( ..

Re: memory issues reading large files

2002-02-07 Thread Brian Hayes
> You should be using something like > > open(FILE, $file) or die "$!\n"; > while(){ > ## do something > } > close FILE; > __END__ This is what I am doing, but before any of the file is processed, the whole text file is moved into memory. The only solution I can think of is to break

perl module for Win32

2002-02-07 Thread Morse, Loretta
Hello, Does anyone know of a perl module for Win32 that will set profile strings in a .ini file? Thanks. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: memory issues reading large files

2002-02-07 Thread Brett W. McCoy
On Thu, 7 Feb 2002, Brian Hayes wrote: > > You should be using something like > > > > open(FILE, $file) or die "$!\n"; > > while(){ > > ## do something > > } > > close FILE; > > __END__ > > This is what I am doing, but before any of the file is processed, the > whole text file is moved in

Re: simple question

2002-02-07 Thread John W. Krahn
Stuart Clark wrote: > > # example values > $Charge = "55"; > $CreditCard = "423452345654532"; > > $VisaCard = /^4\d{15}/; > $BankCard = /^(6565\d{12})|(555[10]00\d{10})/; > > if ($Charge > 0 && (($VisaCard|$BankCard),$CreditCard) ) { # This bit > doesn't work? > > Print "The credit card

Re: is Shell.pm deprecated?

2002-02-07 Thread Brett W. McCoy
On Thu, 7 Feb 2002, Jenda Krynicky wrote: > I did not try. I don't use the shell for any scripts ... just as a place > to enter commands (and start PSH) at so I did not install any > "unix" shell. And I have to say ... I'm not a *nix person anyway. > > Now the question is ... if it used to wikr w

RE: memory issues reading large files

2002-02-07 Thread Nikola Janceski
You should be using something like open(FILE, $file) or die "$!\n"; while(){ ## do something } close FILE; __END__ if you use something like local $/; $contents = ; __END__ then you are mistaken... my perlscripts go up to almost a gig of mem sometimes (foolish yes), but quick

Re: is Shell.pm deprecated?

2002-02-07 Thread Jenda Krynicky
From: "Brett W. McCoy" <[EMAIL PROTECTED]> > On Thu, 7 Feb 2002, Jenda Krynicky wrote: > > > I liked the idea and didn't like the fact that it doesn't work under > > windows :-) > > Under the default command shell? I assume it works under Cygwin with > no problems. I did not

Re: is Shell.pm deprecated?

2002-02-07 Thread Brett W. McCoy
On Thu, 7 Feb 2002, Jenda Krynicky wrote: > I liked the idea and didn't like the fact that it doesn't work under > windows :-) Under the default command shell? I assume it works under Cygwin with no problems. > BTW, I have a version that does allow you to specify the path. And > even whether y

RE: is Shell.pm deprecated?

2002-02-07 Thread Jenda Krynicky
From: "Dean Theophilou" <[EMAIL PROTECTED]> > So, Jenda, what's the eta on the enhancement? :) "eta"? You mean "beta" ? http://Jenda.Krynicky.cz/Shell.pm > Dean Theophilou > > P.S. Don't forget to update the docs too (preferably in Word or html > format). : How about som

Re: memory issues reading large files

2002-02-07 Thread Brett W. McCoy
On Thu, 7 Feb 2002, Brian Hayes wrote: > Hello all. I need to read through a large (150 MB) text file line by > line. Does anyone know how to do this without my process swelling to > 300 megs? As long as you aren't reading that file into an array (which would be a foolish thing to do, IMHO), I

Re: is Shell.pm deprecated?

2002-02-07 Thread Jenda Krynicky
From: "Brett W. McCoy" <[EMAIL PROTECTED]> > On Thu, 7 Feb 2002, Jenda Krynicky wrote: > > > I guess there are two reasons. > > > > 1) Noone knows about it. > > > > 2) With the current version it's not possible to specify a path to > > the program to run. > > > > But IMHO if enh

memory issues reading large files

2002-02-07 Thread Brian Hayes
Hello all. I need to read through a large (150 MB) text file line by line. Does anyone know how to do this without my process swelling to 300 megs? I have not been following the list, so sorry if this question has recently come up. I did not find it answered in the archives. Thanks, Brian

RE: is Shell.pm deprecated?

2002-02-07 Thread Dean Theophilou
So, Jenda, what's the eta on the enhancement? :) Dean Theophilou P.S. Don't forget to update the docs too (preferably in Word or html format). : -Original Message- From: Brett W. McCoy [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 07, 2002 12:13 PM To: Jenda Krynicky Cc: [EM

Re: retrieving info from function

2002-02-07 Thread Brett W. McCoy
On Thu, 7 Feb 2002, Jesse Ahrens wrote: > The gethostbyname() function returns 5 variables, the last on addrs is an > array. How do I specify the function to only return that array rather than > the 4 strings and 1 array? gethostbyname() returns a list. You can coerce that list to become an arr

Re: Changing the default output channel

2002-02-07 Thread Brett W. McCoy
On Thu, 7 Feb 2002, Balint, Jess wrote: > Hello all. Might one be able to tell me how to change the default output > channel so that instead of: > > print FILE, "text"; > > I might use > > print "text"; perldoc -f select -- Brett http://www.chapelperilo

RE: Changing the default output channel

2002-02-07 Thread Balint, Jess
Whoops! I know that comma is not supposed to be in the first code snippet. Sorry! -Original Message- Hello all. Might one be able to tell me how to change the default output channel so that instead of: print FILE, "text"; I might use print "text"; ? Thank you. --Jess -- To unsubs

retrieving info from function

2002-02-07 Thread Jesse Ahrens
The gethostbyname() function returns 5 variables, the last on addrs is an array. How do I specify the function to only return that array rather than the 4 strings and 1 array? It's a menage a trois you and me and Heineken... -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional comma

Changing the default output channel

2002-02-07 Thread Balint, Jess
Hello all. Might one be able to tell me how to change the default output channel so that instead of: print FILE, "text"; I might use print "text"; ? Thank you. --Jess -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: multiple quotes

2002-02-07 Thread McDonald Patrick
you need to escape your inner quotes with a backslash like so. print "\n"; Pat - Original Message - From: "Mike Smith" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, February 07, 2002 2:01 PM Subject: multiple quotes > How do I get this to work? (too many quotes) > > print

append local file to remote file

2002-02-07 Thread Alex Harris
Apologies for the loosely interpreted perl issue below. I have rsh on my system and nothing else is available that I know of. I need to send a local file to a remote system and APPEND the local file to the remote file. All I can find in the man pages however is how to do just the reverse. I

Re: is Shell.pm deprecated?

2002-02-07 Thread Brett W. McCoy
On Thu, 7 Feb 2002, Jenda Krynicky wrote: > I guess there are two reasons. > > 1) Noone knows about it. > > 2) With the current version it's not possible to specify a path to the > program to run. > > But IMHO if enhanced a bit, this could be the easies way to run an > external command. Jenda --

Re: is Shell.pm deprecated?

2002-02-07 Thread Jenda Krynicky
From: Christopher Solomon <[EMAIL PROTECTED]> > Whenever I've had to execute system or shell commands, I use the > backtick operator, the system command, or filehandle half-pipes (or > whatever they are called :). And I've always seen these recommended > whenever someone asks ho

RE: Hash Question

2002-02-07 Thread Balint, Jess
After hours of pondering and sitting in wonder of simple it is, I have come up with something. I do believe that this: for my $i (0..$#keys) { Quite possibly should be foreach ( @keys ) { Otherwise, why would you have my @keys = (0, 1, 2, 3); Instead of just $keys = 3 and the

Re: What is the URL for the perlop page?

2002-02-07 Thread Chas Owens
On Thu, 2002-02-07 at 14:23, Mike Smith wrote: > What is the URL for the perlop page? > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] perlop is a section of the perl manual. try man perlop or perldoc perlop or if you must have a web

Re: What is the URL for the perlop page?

2002-02-07 Thread Brett W. McCoy
On Thu, 7 Feb 2002, Mike Smith wrote: > What is the URL for the perlop page? At the command line (Unix or Windows) type 'perldoc perlop'. It's bundled with your Perl installation. -- Brett http://www.chapelperilous.net/

What is the URL for the perlop page?

2002-02-07 Thread Mike Smith
What is the URL for the perlop page? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: ignoring some fields in a comparision of hashes

2002-02-07 Thread Christopher Solomon
%ignore = map { $_ => 1 } @ignore; @diff = map { $a{$_} ne $b{$_} } grep { !$ignore{$_} } keys %a; @diff will end up with a list of key/value pairs of %a that are different from %b, excluding those of %ignore. note: this is untested. Chris On 7 Feb 2002, Chas Owens wrote: > I have t

RE: multiple quotes

2002-02-07 Thread Murphy, Land
Use single quote marks inside your print statement. for instance print "\n"; Better yet, use CGI instead. HTH -Original Message- From: Mike Smith To: [EMAIL PROTECTED] Sent: 2/7/2002 1:01 PM Subject: multiple quotes How do I get this to work? (too many quotes) print "\n"; Mike

Re: multiple quotes

2002-02-07 Thread Brett W. McCoy
On Thu, 7 Feb 2002, Mike Smith wrote: > How do I get this to work? (too many quotes) > > print "\n"; print qq(\n); qq() is the generic form of "". You can also use qq{}, qq##, etc. See the perlop page for more details. -- Brett http://www.chapelperil

Re: multiple quotes

2002-02-07 Thread Chas Owens
On Thu, 2002-02-07 at 14:01, Mike Smith wrote: > How do I get this to work? (too many quotes) > > print "\n"; > > Mike Smith try qq (see perldoc perlop) print qq(\n); -- Today is Pungenday the 38th day of Chaos in the YOLD 3168 Kallisti! Missle Address: 33:48:3.521N 84:23:34.786W --

Re: multiple quotes

2002-02-07 Thread Jeff 'japhy' Pinyan
On Feb 7, Mike Smith said: >How do I get this to work? (too many quotes) > >print "\n"; You can either escape the " with a backslash... print "like \"this\"..."; but that gets to look REALLY ugly, REALLY fast. So use a different quoting operator instead: print "xyz"; print 'http://www.

RE: multiple quotes

2002-02-07 Thread Hanson, Robert
Two different ways. Use the qq operator or escape the quotes. print qq[\n]; print "\n"; Rob -Original Message- From: Mike Smith [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 07, 2002 2:02 PM To: [EMAIL PROTECTED] Subject: multiple quotes How do I get this to work? (too many quo

multiple quotes

2002-02-07 Thread Mike Smith
How do I get this to work? (too many quotes) print "\n"; Mike Smith -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: help with scalar references

2002-02-07 Thread Jeff 'japhy' Pinyan
On Jan 16, Karthik Gurumurthy said: >($a,$b,$c) = (\"1",\"2",\"3"); > >%hash = ($a=>"hello",$b=>"Perl"); You cannot use references as the keys to a hash, because hash keys must be strings. If you're REALLY desperate, you can use Tie::RefHash, but I don't think you should be so desperate. -- J

help with scalar references

2002-02-07 Thread Karthik Gurumurthy
hi! this is a simple program i wrote to understand references.. ($a,$b,$c) = (\"1",\"2",\"3"); %hash = ($a=>"hello",$b=>"Perl"); foreach $key (keys%hash){ $keyval = ${$key}; print "$keyval\n"; print ("The key is $$key and the value is $hash{$key}\n"); } the output is:

is Shell.pm deprecated?

2002-02-07 Thread Christopher Solomon
Whenever I've had to execute system or shell commands, I use the backtick operator, the system command, or filehandle half-pipes (or whatever they are called :). And I've always seen these recommended whenever someone asks how to do that. But recently, I saw the use of the Shell.pm module: use

Re: ignoring some fields in a comparision of hashes

2002-02-07 Thread Chas Owens
On Thu, 2002-02-07 at 13:21, Jeff 'japhy' Pinyan wrote: > On Feb 7, Chas Owens said: > > >I have two hashes (%a and %b) that contain data for one person from two > >different systems and I want to compare these hashes to see if the > >systems are out of sync. The catch is I know that some of the

RE: how can i do it? (RE: how big can I make it?)

2002-02-07 Thread Nikola Janceski
The onlym thing I can think of is to split the string into an array and write a subroutine to properly add one to correct elements. I am hoping there is something easier. -Original Message- From: Nikola Janceski [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 07, 2002 1:17 PM To: 'Ta

Re: ignoring some fields in a comparision of hashes

2002-02-07 Thread Jeff 'japhy' Pinyan
On Feb 7, Chas Owens said: >I have two hashes (%a and %b) that contain data for one person from two >different systems and I want to compare these hashes to see if the >systems are out of sync. The catch is I know that some of the fields >will always be different and I want to ignore those field

how can i do it? (RE: how big can I make it?)

2002-02-07 Thread Nikola Janceski
Let me be a little more specific. I want to take a BIG hex number and subtract 1 from it and print it out again. ie: FFF -> FE -Original Message- From: Tanton Gibbs [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 07, 2002 12:57 PM To: Nikola Janceski;

ignoring some fields in a comparision of hashes

2002-02-07 Thread Chas Owens
I have two hashes (%a and %b) that contain data for one person from two different systems and I want to compare these hashes to see if the systems are out of sync. The catch is I know that some of the fields will always be different and I want to ignore those fields. Below is my solution, does a

Re: how big can I make it?

2002-02-07 Thread Tanton Gibbs
You can use the Math::BigInt module. perldoc Math::BigInt - Original Message - From: "Nikola Janceski" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, February 07, 2002 12:54 PM Subject: how big can I make it? > I want to store a really really big integer... like: > 18488425

how big can I make it?

2002-02-07 Thread Nikola Janceski
I want to store a really really big integer... like: 184884258895036416 in a varible and do a -- on it. how can I store such a number? and what's the limit? (this is on a Solaris 2.6 machine). Nikola Janceski Summit Systems, Inc. 212-896-3400 If the facts don't fit the theory, change the facts

Re: Insert delimiter between number and alpha

2002-02-07 Thread Jeff 'japhy' Pinyan
On Feb 7, Frank Newland said: >I want to put a delimiter (#) between the rightmost number and the left most >alpha s/(\d)([^\W\d])/$1#$2/; You can't just say (\d)(\w), because \w INCLUDES \d. You could write something like (\d)(?!\d)(\w), which requires that the \w character after the \d NOT

Re: Insert delimiter between number and alpha

2002-02-07 Thread Frank
On Thu, Feb 07, 2002 at 11:27:53AM -0600, Frank wrote: > All, > > My input looks like this > == > 5544#1341343BORIS > 6200#321BOWSER > 89232652#6213VERONICA > === > I want to put a delimiter (#) between the rightmost number and the left most > alpha > Resulting in >

RE: Insert delimiter between number and alpha

2002-02-07 Thread Nikola Janceski
s/(\d)([a-z])/$1#$2/i; that's not a very good way to store women's phone numbers. I like to us a little black book. -Original Message- From: Frank Newland [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 07, 2002 12:28 PM To: [EMAIL PROTECTED] Subject: Insert delimiter between number

Insert delimiter between number and alpha

2002-02-07 Thread Frank Newland
All, My input looks like this == 5544#1341343BORIS 6200#321BOWSER 89232652#6213VERONICA === I want to put a delimiter (#) between the rightmost number and the left most alpha Resulting in 5544#1341343#BORIS 6200#321#BOWSER 89232652#6213#VERONICA Any

Re: HELP! : To write a script that reads numbers from STDIN andprint on STDOUT.

2002-02-07 Thread Tanton Gibbs
If you could show us what you have already done, maybe we could help show you what you are doing wrong...we normally don't do homework for other people :) - Original Message - From: "Bruce Ambraal" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, February 07, 2002 11:31 AM Subje

RE: HELP! : To write a script that reads numbers from STDIN and print on STDOUT.

2002-02-07 Thread John Edwards
Yeah. I can write code to do that. Thanks for asking. This has the hallmarks of a homework assignment... John -Original Message- From: Bruce Ambraal [mailto:[EMAIL PROTECTED]] Sent: 07 February 2002 16:31 To: [EMAIL PROTECTED] Subject: HELP! : To write a script that reads numbers from S

Re: TCl/Expect Question

2002-02-07 Thread William.Ampeh
This will do it: #!/usr/local/bin/expect -f #exp_internal 1 #<--- you could uncomment this to turn debug mod on set timeout 2 set prompt "(%|#|\\$) $";# default prompt log_user 1 catch {set prompt $env(EXPECT_PROMPT)} eval spaw

HELP! : To write a script that reads numbers from STDIN andprint on STDOUT.

2002-02-07 Thread Bruce Ambraal
Hi ALL Could any one write some coding for the following problem. In perl against Linx could someone help. --- I want to write a script that reads in four numbers from STDIN and add t

Re: simple question

2002-02-07 Thread Jeff 'japhy' Pinyan
On Feb 8, Stuart Clark said: >$Charge = "55"; >$CreditCard = "423452345654532"; > > >$VisaCard = /^4\d{15}/; >$BankCard = /^(6565\d{12})|(555[10]00\d{10})/; You can't store regexes that way. You need to use the qr// operator. $VisaCard = qr/^4\d{15}$/; # likewise for $BankCard >if ($Cha

Re: more reg exp help please

2002-02-07 Thread Jeff 'japhy' Pinyan
On Feb 8, Stuart Clark said: >if ($Charge > 0 && (($VisaCard|$BankCard),$CreditCard) ) { # This bit >doesn't work? What is ((A | B), C) trying to do? Perhaps you want: (($VisaCard || $BankCard) && $CreditCard) >}elsif ($CreditCard = "" && $Charge < 0 ) { # Is "" ok for a null entry? You ne

Re: reg exp question

2002-02-07 Thread Jeff 'japhy' Pinyan
On Feb 7, Stuart Clark said: >How do I match a pattern that starts with a 4 and has 16 numbers in it. > >I try /^4\d{16}/; That's quite vague. Do you mean the string must start with a 4 and consist ONLY of 16 digits? /^4\d{15}$/ >Also how do I match a 16 digit number that starts with eith

Re: Using =~ with a list

2002-02-07 Thread Randal L. Schwartz
> "Lysander" == Lysander <[EMAIL PROTECTED]> writes: Lysander> This doesn't seem to work... My webhost is running PERL 5.004_04 That's your problem. For older Perls, you can use for (@body) { s/foo/bar/ } >> This works: >> >> s/foo/bar/ for @body; >> >> presuming you have a re

Re: Never had this happen before!

2002-02-07 Thread Motherofperls
Sorry , I have been programming all night and found an oversight on my part. Perl reported and error in a sub routine, but the error was above the routine above some of my comment lines where I didn't expect it to be. That was part of html code that was out of place. Live and learn I gue

RE: simple question

2002-02-07 Thread Bob Showalter
> -Original Message- > From: Darren Simpson [mailto:[EMAIL PROTECTED]] > Sent: Thursday, February 07, 2002 11:17 AM > To: Perl List > Subject: RE: simple question > > > > what do the below actually do? they look like dutch to me > $VisaCard = /^4\d{15}/; /^4\d{15}/ is a regular express

RE: simple question

2002-02-07 Thread Nikola Janceski
I think the match is wrong... $BankCard = /^(6565\d{12})|(555[10]00\d{10})/; should be $BankCard = /^(?:(6565\d{12})|(555[10]00\d{10}))/; the first says starting with 6565 and 12 more digits or contains 555 and 0 or 1 and 00 and 10 digits So "dlsfkj55500099" will match. the second won't

RE: simple question

2002-02-07 Thread Darren Simpson
what do the below actually do? they look like dutch to me $VisaCard = /^4\d{15}/; $BankCard = /^(6565\d{12})|(555[10]00\d{10})/; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: pidof a process

2002-02-07 Thread walter valenti
Jorge Goncalvez wrote: $pid=$$; ### the special variable $$ contains the owner process Walter >Hi, Iw onder if there is a way to obtain the PID of a process with perl? >Thanks. > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: pidof a process

2002-02-07 Thread Bob Showalter
> -Original Message- > From: Jorge Goncalvez [mailto:[EMAIL PROTECTED]] > Sent: Thursday, February 07, 2002 10:51 AM > To: [EMAIL PROTECTED] > Subject: RE:pidof a process > > > Hi, Iw onder if there is a way to obtain the PID of a process > with perl? > Thanks. Do you mean your perl pr

RE: .dat files

2002-02-07 Thread Scott Lutz
The file(s) I really wanted to look into is the index.dat that contains all cookie information, and browser session info. I am going to try a hex editor to see what I can see. Thanks! -Original Message- From: Jenda Krynicky [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 07, 2002 3

RE:pidof a process

2002-02-07 Thread Jorge Goncalvez
Hi, Iw onder if there is a way to obtain the PID of a process with perl? Thanks. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Never had this happen before!

2002-02-07 Thread John Edwards
Magic?? Why don't you start by posting the errors that perl reports. It will save us having to guess... John -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: 07 February 2002 15:42 To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: Never had this happen

Re: Never had this happen before!

2002-02-07 Thread Brett W. McCoy
On Thu, 7 Feb 2002 [EMAIL PROTECTED] wrote: > My program won't compile when the sub routine is in the program, > but when I remove it from the program and put it into another file > that I call test.pl, and compile test.pl which contains only the sub > routine I'm checking, it compiles fine! > >

Re: Never had this happen before!

2002-02-07 Thread Motherofperls
My program won't compile when the sub routine is in the program, but when I remove it from the program and put it into another file that I call test.pl, and compile test.pl which contains only the sub routine I'm checking, it compiles fine! Why does it do that?

Re: Using =~ with a list

2002-02-07 Thread Jenda Krynicky
From: "Lysander" <[EMAIL PROTECTED]> > This doesn't seem to work... My webhost is running PERL 5.004_04 > > s/foo/bar/ for @body; Too old perl for this. Use for (@body) { s/foo/bar/; } instead. Jenda === [EMAIL PROTECTED] == http://

RE: Open a brand new browser window with Perl

2002-02-07 Thread Ron Goral
I hate it when I make a post and then answer my own questions, but Morbus made me recall the window resizing and moving methods useable via JavaScript. If I were to "print" the new page with an onLoad event that called the resizeTo and moveTo methods, I can resize and move my windows anywhere I

Re: Never had this happen before!

2002-02-07 Thread Jon Molin
[EMAIL PROTECTED] wrote: > > I was happily programming, getting close to the end of my project just trying > to figure out table placement in html within my largest function on the page. > > All of a sudden my function won't function! I didn't change any of the perl > code! And it was fine exc

Never had this happen before!

2002-02-07 Thread Motherofperls
I was happily programming, getting close to the end of my project just trying to figure out table placement in html within my largest function on the page. All of a sudden my function won't function! I didn't change any of the perl code! And it was fine except for table placement! Well, I r

Re: Using =~ with a list

2002-02-07 Thread Lysander
This doesn't seem to work... My webhost is running PERL 5.004_04 I tried just the following test.pl #!/usr/local/bin/perl -w use strict; my @body; $body[0] = "Test Data:\n"; $body[1] = "foo\n"; $body[2] = "I should be below bar\n"; s/foo/bar/ for @body; print @body; and I get sy

Re: Open a brand new browser window with Perl

2002-02-07 Thread Morbus Iff
>Is it possible to open a brand new browser window and set it's size, >location and characteristics (no menu bar, no status bar, etc.) using Perl >or is it necessary to always use the same window that has called the script? With Perl, no. But you can certainly tell Perl to send some javascript

  1   2   >