Re: Checking if a hash has blank values.

2002-04-09 Thread Tanton Gibbs
Yes, you don't want to print $hash{$hash_key}...instead, notice that I put a backslash before the first $ You just want to print $hash_key. If you escape the first $ then it will print out something like $hash{key1} is blank! - Original Message - From: "Daniel Falkenberg" <[EMAIL PROTECT

Re: Checking if a hash has blank values.

2002-04-09 Thread Daniel Falkenberg
Tanton, I must be so close! I just can't get it to print the key value that contains a null value. I think it is actually printing the value i.e $hash{$hash_key} which is the value? I want it to print the key! Does this sound correct to you? Regards, Dan > foreach my $hash_key (keys %hash)

Re: How to compress a file using PERL?

2002-04-09 Thread John W. Krahn
Loan Tran wrote: > > Hello all, Hello, > What's good way to compress a file using PERL? PERL? You probably meant Perl. my $file = '/home/loan/somefile.txt'; system 'bzip2', $file; John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,

Re: Checking if a hash has blank values.

2002-04-09 Thread Tanton Gibbs
Sure, you just about have it, but don't use $hash{$_} == "" as someone else said, just use $hash{$_} eq "" Also, if you name your iterator $hash_key, then don't use $_, use $hash_key...so the final code would be foreach my $hash_key (keys %hash) { if( $hash{$hash_key} eq "" ) { print "\$ha

Re: Checking if a hash has blank values.

2002-04-09 Thread Daniel Falkenberg
Hi Tanton, Yes, but what I really want it to do is go though all the values of the hash and if any of them contain null values then print that out and tell me whick key(s) value(s) contains null values? Is this possible? Therefore... foreach $hash_key (keys %hash) { if ($hash{$_} == "" || $h

Re: Checking if a hash has blank values.

2002-04-09 Thread Tanton Gibbs
If you want to test all of them, you can say $hash{$_} eq "" and die "Empty hash!" foreach( keys %hash ); - Original Message - From: "Eric Beaudoin" <[EMAIL PROTECTED]> To: "Daniel Falkenberg" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, April 10, 2002 2:22 AM Subject: Re: Ch

Re: Checking if a hash has blank values.

2002-04-09 Thread Eric Beaudoin
At 02:08 2002.04.10, you wrote: >Hey all, > >I have created a hash that looks similar to the following... > >%hash ( >'test1' => $test1, >'test2' => $test2, >'test3' => $test3, >); > >Now is it possible to have a little piece of code check the values of >that hash and see i

How to compress a file using PERL?

2002-04-09 Thread loan tran
Hello all, What's good way to compress a file using PERL? Thanks in advance. LT __ Do You Yahoo!? Yahoo! Tax Center - online filing with TurboTax http://taxes.yahoo.com/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-ma

Checking if a hash has blank values.

2002-04-09 Thread Daniel Falkenberg
Hey all, I have created a hash that looks similar to the following... %hash ( 'test1' => $test1, 'test2' => $test2, 'test3' => $test3, ); Now is it possible to have a little piece of code check the values of that hash and see if their are any blank fields? Something

Re: regular expression to get a file extension

2002-04-09 Thread Jeff 'japhy' Pinyan
On Apr 9, Ahmed Moustafa said: >John W. Krahn wrote: >> Ahmed Moustafa wrote: >> >>>Jeff, thanks a lot for your explanation. I really appreciate it. >>> >>>Jeff 'Japhy' Pinyan wrote: >>> Please use File::Basename. Save us all the headache. >>>I was thinking that avoiding modules would

Re: regular expression to get a file extension

2002-04-09 Thread Jeff 'japhy' Pinyan
On Apr 9, Ahmed Moustafa said: >Jeff, thanks a lot for your explanation. I really appreciate it. > >Jeff 'Japhy' Pinyan wrote: >> Please use File::Basename. Save us all the headache. > >I was thinking that avoiding modules would make the code more portable. >Am I right? File::Basename is a STA

Re: Splitting number into an array

2002-04-09 Thread John W. Krahn
Daniel Falkenberg wrote: > > Hey all, Hello, > $card_no = "1234567901234567" # 16 digit number > > How would I go about splitting that number into an array? $ perl -le '$card_no = "1234567901234567"; @array = split //, $card_no; print "@array"; @array = $card_no =~ /./g; print "@array"; @arr

Re: Password Encryption for MySQL field

2002-04-09 Thread Ron
Ooops! Correction: Incorrect -- connect("DBI:mysql:HOST", "DB", 'DB_PASSWORD'); Should be -- connect( "dbi:mysql:dbname", "username", 'DBpassword'); Ron === "Ron" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... This is my two-

Re: Perl 5.6.1 Frustration

2002-04-09 Thread Robert Brandtjen
On Tuesday 09 April 2002 11:58 pm, Kevin Queen wrote: > I installed Perl 5.6.1 and now none of my Perl programs run. It would > appear that my @INC directive is being ignored. None of my scripts find > strict.pm, vars.pm, or any .pm for that matter. How can I fix this? Let me guess, are you on

Re: Splitting number into an array

2002-04-09 Thread victor
@array = split("", $card_no); Tor. Daniel Falkenberg wrote: > > Hey all, > > $card_no = "1234567901234567" # 16 digit number > > How would I go about splitting that number into an array? > > Regards, > > Dan > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-m

Re: Splitting number into an array

2002-04-09 Thread Tirthankar C. Patnaik
Hi, perl -e '$r="123456789012345"; @Re=split(//,$r); print join ("|",@Re);' HTH, -tir > Ol=10 Apr 2002, Daniel Falkenberg wrote: >t(//,$r); print join ("|",@Re);' > Hey all, > > $card_no = "1234567901234567" # 16 digit number > > How would I go about splitting that number into an

Splitting number into an array

2002-04-09 Thread Daniel Falkenberg
Hey all, $card_no = "1234567901234567" # 16 digit number How would I go about splitting that number into an array? Regards, Dan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Perl 5.6.1 Frustration

2002-04-09 Thread Kevin Queen
I installed Perl 5.6.1 and now none of my Perl programs run. It would appear that my @INC directive is being ignored. None of my scripts find strict.pm, vars.pm, or any .pm for that matter. How can I fix this? Thanks, Kevin Q. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional comma

RE: declaring vars

2002-04-09 Thread Michael Gargiullo
Strangly, I received errors at first, but now not. It must have been another part of the code. - Not that I can see...are you getting an error? -Original Message- From: Michael Gargiullo To: Beginners Sent: 4/9/02 8:11 PM Subject: declaring vars I though I could define variable

Re: shrinking code

2002-04-09 Thread Tanton Gibbs
The x operator takes a string and a number and repeats the string number times. For example: print "dog" x 3; prints: dogdogdog You can look at perldoc perlop or buy Learning Perl from O'Reilly. - Original Message - From: "Glenn Meyer" <[EMAIL PROTECTED]> To: "Beginners" <" <[EMAIL PR

Re: shrinking code

2002-04-09 Thread Glenn Meyer
Please, tell me what your are doing here. I have seen similar short code before but have no idea how to read it or why it works. Can you point me to docs or a boox the would help? Thanks! On Tuesday 09 April 2002 10:14 pm, Tanton Gibbs wrote: > print "-" x 80; > - Original Message -

RE: declaring vars

2002-04-09 Thread Timothy Johnson
Not that I can see...are you getting an error? -Original Message- From: Michael Gargiullo To: Beginners Sent: 4/9/02 8:11 PM Subject: declaring vars I though I could define variables this way. Do I have the syntax wrong? our($opt_s, $opt_v, $opt_w, $opt_L, $opt_l, $opt_a); -Mike __

Re: regular expression to get a file extension

2002-04-09 Thread Ahmed Moustafa
John W. Krahn wrote: > Ahmed Moustafa wrote: > >>Jeff, thanks a lot for your explanation. I really appreciate it. >> >>Jeff 'Japhy' Pinyan wrote: >> >>>Please use File::Basename. Save us all the headache. >>> >>I was thinking that avoiding modules would make the code more portable. >>Am I right?

Re: regular expression to get a file extension

2002-04-09 Thread John W. Krahn
Ahmed Moustafa wrote: > > Jeff, thanks a lot for your explanation. I really appreciate it. > > Jeff 'Japhy' Pinyan wrote: > > Please use File::Basename. Save us all the headache. > > I was thinking that avoiding modules would make the code more portable. > Am I right? No, _using_ modules woul

Validating form date

2002-04-09 Thread Daniel Falkenberg
Hello all, I am just playing around with forms at the moment. What I want to do is have user enter data into form fiels then I want to validate that entered date. So far I can do things as basic as validating if fields contain characters and so forth. But what I want to do is something like th

RE: shrinking code

2002-04-09 Thread Michael Gargiullo
Thank you ___ print "-" x 80; - Original Message - From: "Michael Gargiullo" <[EMAIL PROTECTED]> To: "Beginners" <[EMAIL PROTECTED]> Sent: Tuesday, April 09, 2002 11:13 PM Subject: shrinking code > How can I write this smaller? > > while($m < 80){ > pr

Re: shrinking code

2002-04-09 Thread Tanton Gibbs
print "-" x 80; - Original Message - From: "Michael Gargiullo" <[EMAIL PROTECTED]> To: "Beginners" <[EMAIL PROTECTED]> Sent: Tuesday, April 09, 2002 11:13 PM Subject: shrinking code > How can I write this smaller? > > while($m < 80){ > print "-"; > $m++ > } > > -- > To unsubscribe, e

shrinking code

2002-04-09 Thread Michael Gargiullo
How can I write this smaller? while($m < 80){ print "-"; $m++ } -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

declaring vars

2002-04-09 Thread Michael Gargiullo
I though I could define variables this way. Do I have the syntax wrong? our($opt_s, $opt_v, $opt_w, $opt_L, $opt_l, $opt_a); -Mike _ Nothing is fool proof to a sufficiently talented fool! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For ad

Re: regular expression to get a file extension

2002-04-09 Thread Ahmed Moustafa
Jeff, thanks a lot for your explanation. I really appreciate it. Jeff 'Japhy' Pinyan wrote: > Please use File::Basename. Save us all the headache. I was thinking that avoiding modules would make the code more portable. Am I right? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

use of package in a script

2002-04-09 Thread drieux
volks, I think we need to address Gary Hawkin's questions about the package 'function' beyond the obligatory cf. perldoc -f package - and folks SHOULD check it out. it gives the simple introduction to doing 'name space management' - one of the reasons that 'lexical scoping' is IMPORTANT

Taint checking a bunch of word input

2002-04-09 Thread zentara
Hi, Taint checking has got me stumped. I'm using CGI to bring in a variable amount of data from a Textarea in a form. What's the best way to untaint a bunch of words? They may or may not span multiple lines. Everything I've tried will give me $1 being just the first word. For example: if ($comme

Re: Scope of variables. Lost in subs

2002-04-09 Thread drieux
On Tuesday, April 9, 2002, at 11:13 , Jenda Krynicky wrote: [..] > So if a module defines several classes it has to contain several > packages. > > Jenda yes I think I would modify that slightly it is simpler to deliver one long file as a singular 'package' that carries with

RE: Regex!

2002-04-09 Thread Jeff 'japhy' Pinyan
On Apr 10, Daniel Falkenberg said: >I just tried running $money = s/\$//: over It should be =~ not =. -- Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/ RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/ ** Look for "Regular Expressions in P

RE: Regex!

2002-04-09 Thread Daniel Falkenberg
Hi Tim, I just tried running $money = s/\$//: over $money = "$21.80"; And my returned result was nothing! I.e it removed everything? Any ideas, Dan On Wed, 2002-04-10 at 09:34, Timothy Johnson wrote: > > You have to escape the dollar sign in your regex just like you did in the > assignment

Re: extra space

2002-04-09 Thread Bryan R Harris
The following sort-code came from an old CPAN page. It seems to work just fine (it sorts a tab-delimited text file by the 3rd column), but if I have warnings (-w) turned on the compiler throws a whole bunch of "Use of uninitialized value" warnings about the line that starts "@newrefs ". What

Re: form and frames - HELP !!!

2002-04-09 Thread Jenda Krynicky
From: "Leon" <[EMAIL PROTECTED]> > - Original Message - > From: "zentara" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > > In the html page where you set up the original frameset, you assign > > names, like header, left and right to the individual fr

Re: extra space

2002-04-09 Thread John W. Krahn
Bryan R Harris wrote: > > > Bryan R Harris wrote: > > > > > > I suppose it does look a little bizarre. Actually, my goal is a little > > > more complex. We have a simulation that outputs data files, but often up > > > to 90% of the data is redundant. So I'm trying to write a filter for the > >

Re: form and frames - HELP !!!

2002-04-09 Thread Leon
- Original Message - From: "zentara" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > In the html page where you set up the original frameset, you assign names, > like header, left and right to the individual frames. So you either make your > links and forms point to the

RE: Regex!

2002-04-09 Thread Timothy Johnson
You have to escape the dollar sign in your regex just like you did in the assignment. $money = s/\$//; -Original Message- From: Daniel Falkenberg [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 09, 2002 5:10 PM To: [EMAIL PROTECTED] Subject: Regex! Hello All, Just wondering how I can

Regex!

2002-04-09 Thread Daniel Falkenberg
Hello All, Just wondering how I can remove unwanted characters from a simple variable. $money = "\$21.85"; Now I simply want to strip the $ sign from that variable. Easy? Well I thought it would be :) $money = s/$//; # Well thats what I thought! Regards, Dan -- To unsubscribe, e-mail:

RE: Scope of variables. Lost in subs

2002-04-09 Thread Jeff 'japhy' Pinyan
On Apr 9, Gary Hawkins said: >> From: Jeff 'japhy' Pinyan [mailto:[EMAIL PROTECTED]] >> >> Perhaps you're missing the point. > >Gee, maybe that was the reason for the question. Ya think? Why do you >hammer people for asking questions, that's what this place is for. I wasn't. I was saying that

RE: Scope of variables. Lost in subs

2002-04-09 Thread Gary Hawkins
> -Original Message- > From: Jeff 'japhy' Pinyan [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, April 09, 2002 11:58 AM > To: Gary Hawkins > Cc: [EMAIL PROTECTED] > Subject: RE: Scope of variables. Lost in subs > > Perhaps you're missing the point. Gee, maybe that was the reason for the ques

Re: Location of SendMail

2002-04-09 Thread Elaine -HFB- Ashton
@fro @ndy [[EMAIL PROTECTED]] quoth: *> *>My friend said that you cant use sendmail on a Windows machine so i am asking if this is true. If it is true are there any sendmail programs out there that would work with my current OS? Not true but you'd have to install it and, as I recall, it's a com

RE: default value

2002-04-09 Thread Michael Gargiullo
On Apr 9, Michael Gargiullo said: >While asking a few questions to run a script. How can I give a default >answer? > >print "File to use:"; >chomp(my $question = ); Most programs do it like so: my $default = "/foo/bar/blat"; print "File to use? [$default] "; chomp(my $question = ); $

RE: default value

2002-04-09 Thread Wagner-David
I usually display what the defaults are at first and then use a carriage return to signify that is what I want. You can test like: if ( $question eq '' ) { # place the default value into $question } I usually use a infinite loop and when values

Location of SendMail

2002-04-09 Thread @fro @ndy
Hello, I am running Apache HTTP Server Version 1.3 on my Windows 2000 Professional PC with ActiveState Perl. I was wondering if anyone knew where my SendMail program would be located? My friend said that you cant use sendmail on a Windows machine so i am asking if this is true. If it is true

Re: default value

2002-04-09 Thread Jeff 'japhy' Pinyan
On Apr 9, Michael Gargiullo said: >While asking a few questions to run a script. How can I give a default >answer? > >print "File to use:"; >chomp(my $question = ); Most programs do it like so: my $default = "/foo/bar/blat"; print "File to use? [$default] "; chomp(my $question = ); $q

default value

2002-04-09 Thread Michael Gargiullo
While asking a few questions to run a script. How can I give a default answer? Right now I'm asking my question like so: print "File to use:"; chomp(my $question = ); -Mike -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: substitution

2002-04-09 Thread Jeff 'japhy' Pinyan
On Apr 9, Raghupathy, Ramesh . said: > I am trying to translate the abbreviation of the form A(4) to . I >tried substitution as follows: >$wholefile =~ s/(\w)\((\d+)\)/$1{$2}/g; It seems like you think that x{y} syntax used in a regex can be used elsewhere -- nope. Instead, you need to u

substitution

2002-04-09 Thread Raghupathy, Ramesh .
Hi, I am trying to translate the abbreviation of the form A(4) to . I tried substitution as follows: $wholefile =~ s/(\w)\((\d+)\)/$1{$2}/g; This results in the abbrevation being replaced by spaces. How can I get this to work ? Thanks, Ramesh -- To unsubscribe, e-mail: [EMAIL PROTE

RE: rewrite without using two functions?

2002-04-09 Thread Nikola Janceski
Thanx... didn't know that it was an empty list... I thought it was '' > -Original Message- > From: Jeff 'japhy' Pinyan [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, April 09, 2002 5:18 PM > To: Nikola Janceski > Cc: '[EMAIL PROTECTED]'; 'Beginners (E-mail)' > Subject: RE: rewrite without us

RE: rewrite without using two functions?

2002-04-09 Thread Jeff 'japhy' Pinyan
On Apr 9, Nikola Janceski said: >Why are there still no empty elements in the returned array for the items >that didn't match the pattern? >> No; as my post stated, doing LIST = map BLOCK LIST; puts BLOCK in list >> context. A regex in list context will return the parenthetical >> captures if

Re: extra space

2002-04-09 Thread Bryan R Harris
I have to sort before I remove the lines at the top because the lines that have the zeros in column 5 are not at the top. The whole point of the task is not to sort the data, but to filter unneeded data. Some zeroes in column 5 are okay, but the redundant ones are the ones at the top after sort

RE: rewrite without using two functions?

2002-04-09 Thread David Gray
> Why are there still no empty elements in the returned array > for the items that didn't match the pattern? @must == 2 > > I am just befuddled but this "paradox" > > > > Thus, map { m!(.*)/\*! } LIST will return $1 or () for each > > element of the > > LIST. When you have LIST2 = map { m!^(.

RE: rewrite without using two functions?

2002-04-09 Thread Nikola Janceski
Why are there still no empty elements in the returned array for the items that didn't match the pattern? @must == 2 I am just befuddled but this "paradox" > -Original Message- > From: Jeff 'japhy' Pinyan [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, April 09, 2002 4:27 PM > To: Nikola Janc

RE: rewrite without using two functions?

2002-04-09 Thread Jeff 'japhy' Pinyan
On Apr 9, Nikola Janceski said: >my bad... you are right... interesting... is this a special case where map >return $1 instead of 1? >or is it a special case where /(PATTERN)MOREPATTERN/ evaluates to $1 when >true? (but why then no null elements?... interesting.. No; as my post stated, doing LIS

RE: rewrite without using two functions?

2002-04-09 Thread Nikola Janceski
my bad... you are right... interesting... is this a special case where map return $1 instead of 1? or is it a special case where /(PATTERN)MOREPATTERN/ evaluates to $1 when true? (but why then no null elements?... interesting.. > -Original Message- > From: David Gray [mailto:[EMAIL PROTEC

Re: rewrite without using two functions?

2002-04-09 Thread Jeff 'japhy' Pinyan
On Apr 9, Nikola Janceski said: >@must = map { m/(.*)\/\*/; $1 } grep m/\/\*/, @recomp; I'd do: @must = map m!(.*)/\*!, @recomp; The regex is in LIST context, so if it fails, () is returned. -- Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/ RPI Acacia brother

RE: regular expression to get a file extension

2002-04-09 Thread Jeff 'japhy' Pinyan
On Apr 9, Jason Larson said: > $extension =~ s/(^.+\.?)([^\.]*)$/$2/; > >Your regex will fail for a couple of different reasons: [snip] Your regex will fail, too. Here's why... assuming $extension is "foobar.txt", here is how the regex matches: ^ matches the beginning of the string

RE: rewrite without using two functions?

2002-04-09 Thread David Gray
> map returns the result of the last evaluated statement... > @must would have ones and zeros... I want the $1 portion but > only if it ends in '/*' there really isn't a speed issue... > it's more a "can i make this line look sweeter?" > > > > is there a way to write this without using map AND

Re: extra space

2002-04-09 Thread John W. Krahn
Bryan R Harris wrote: > > I suppose it does look a little bizarre. Actually, my goal is a little > more complex. We have a simulation that outputs data files, but often up > to 90% of the data is redundant. So I'm trying to write a filter for the > data. I have to: > > 1. open and load the

RE: rewrite without using two functions?

2002-04-09 Thread Nikola Janceski
map returns the result of the last evaluated statement... @must would have ones and zeros... I want the $1 portion but only if it ends in '/*' there really isn't a speed issue... it's more a "can i make this line look sweeter?" > -Original Message- > From: David Gray [mailto:[EMAIL PROTEC

RE: rewrite without using two functions?

2002-04-09 Thread David Gray
> is there a way to write this without using map AND grep AND > without making > it longer than it is? > @must = map { m/(.*)\/\*/; $1 } grep m/\/\*/, @recomp; > > where @recomp = qw( stuff/stuff.c > crap/* > morestuff/* > stuffy/stuff_stuff.c >

RE: Opening another script and changing variables

2002-04-09 Thread Nikola Janceski
I think Helen is trying what I once did... I wrote a script that setup a cgi web area using a template cgi script. The script changed the variable settings directly in the script. If I knew then what I know now.. I would have setup a file that contained these variable values and never touch the

Re: Opening another script and changing variables

2002-04-09 Thread John W. Krahn
Helen Dynah wrote: > > HI, Hello, > I have a perl script and I am trying to write another > perl script which will open my first perl script, change > the values of some variables, and run the script with > these new variables. perldoc -f use perldoc -f require perldoc -f do perldoc -q "How ca

Re: Search & Replace Issue

2002-04-09 Thread John W. Krahn
"Kristin A. I." wrote: > > I am trying to indent a scroll-thru menu which has been made > into a tree using the following database query: > select dept_id, LPAD(' ',2*(Level-1))||dept_name dept_name > from depts > start with dept_id = 1 > connect by dept_parent = PRIOR dept_id; > My probl

Re: Opening another script and changing variables

2002-04-09 Thread bob ackerman
On Tuesday, April 9, 2002, at 12:29 PM, bob ackerman wrote: > > On Tuesday, April 9, 2002, at 11:06 AM, Helen Dynah wrote: > >> >> HI, >> >> I have a perl script and I am trying to write another perl script which >> will open my first perl script, change the values of some variables, and >>

Re: Opening another script and changing variables

2002-04-09 Thread bob ackerman
On Tuesday, April 9, 2002, at 11:06 AM, Helen Dynah wrote: > > HI, > > I have a perl script and I am trying to write another perl script which > will open my first perl script, change the values of some variables, and > run the script with these new variables. Does anyone know if this is >

rewrite without using two functions?

2002-04-09 Thread Nikola Janceski
is there a way to write this without using map AND grep AND without making it longer than it is? @must = map { m/(.*)\/\*/; $1 } grep m/\/\*/, @recomp; where @recomp = qw( stuff/stuff.c crap/* morestuff/* stuffy/stuff_stuff.c stuffy

RE: Scope of variables. Lost in subs

2002-04-09 Thread Jeff 'japhy' Pinyan
On Apr 9, Gary Hawkins said: >I was thinking there might be an instance where 'package bar' is >essential, or the best way to go. Perhaps you're missing the point. The package directive allows you to change namespaces. Your Perl program operates in package 'main'. Most modules operate in thei

perl script to .exe?

2002-04-09 Thread Collins, Joe (EDSI\\BDR)
Does anyone know of an inexpensive way to turn a perl script (under windows/msdos) to an .exe file? I am aware of perl2exe but I think there may be better and less expensive methods. Thanks, Joe -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Scope of variables. Lost in subs

2002-04-09 Thread Jenda Krynicky
From: "Gary Hawkins" <[EMAIL PROTECTED]> > > > How many "things" can packages be? Is this foo a file? > > > > No this "foo" doesn't have to be a file. You can "have" several > > packages in one file and "switch" between them. > > > > I don't know how to explain what ARE packages though. > > Try

Opening another script and changing variables

2002-04-09 Thread Helen Dynah
HI, I have a perl script and I am trying to write another perl script which will open my first perl script, change the values of some variables, and run the script with these new variables. Does anyone know if this is possible and if so how I would do this. Thanks everyone. Helen ---

Re: Date Handling

2002-04-09 Thread bob ackerman
On Tuesday, April 9, 2002, at 10:19 AM, Schroeter, Richard wrote: > Greetings, > I am having a problem with Perl providing me the correct date when I > subtract 86400 from the date. This is only happening when I set the > computer's system's date to today's date. If I set the system's date to

Re: Reference troubles

2002-04-09 Thread Jonathan E. Paton
> I'm having troubles getting a what seems to be a simple item to work > right.. Basically, I'm trying to search through a data structure and if > a hash value is eq a test value it has to add the test value to a hash > in a different branch of the data structure using the same key. The > data s

RE: Scope of variables. Lost in subs

2002-04-09 Thread Gary Hawkins
> > How many "things" can packages be? Is this foo a file? > > No this "foo" doesn't have to be a file. You can "have" several > packages in one file and "switch" between them. > > I don't know how to explain what ARE packages though. > Try if > perldoc perlmod > makes sense to you. After

Reference troubles

2002-04-09 Thread Jeff Pream
Hi, I'm having troubles getting a what seems to be a simple item to work right.. Basically, I'm trying to search through a data structure and if a hash value is eq a test value it has to add the test value to a hash in a different branch of the data structure using the same key. The data struct

Date Handling

2002-04-09 Thread Schroeter, Richard
Greetings, I am having a problem with Perl providing me the correct date when I subtract 86400 from the date. This is only happening when I set the computer's system's date to today's date. If I set the system's date to tomorrows date or yesterday's date it works fine. My code is: $TIME = time

RE: regular expression to get a file extension

2002-04-09 Thread Jason Larson
> -Original Message- > From: Ahmed Moustafa [mailto:[EMAIL PROTECTED]] > Subject: regular expression to get a file extension > > I had the following regular expression to get the extension > from a file > name: > > > $extension = $filename; > $extension =~ s/(^.+\.)([^\.]+)$/$2/; > >

Re: extra space

2002-04-09 Thread Bryan R Harris
I suppose it does look a little bizarre. Actually, my goal is a little more complex. We have a simulation that outputs data files, but often up to 90% of the data is redundant. So I'm trying to write a filter for the data. I have to: 1. open and load the file 2. strip all comments (marked

Re: Search & Replace Issue

2002-04-09 Thread bob ackerman
On Tuesday, April 9, 2002, at 09:39 AM, Kristin A. I. wrote: > I am trying to indent a scroll-thru menu which has been made into a tree > using the following database query: > select dept_id, LPAD(' ',2*(Level-1))||dept_name dept_name > from depts > start with dept_id = 1 > connect by

RE: Search & Replace Issue

2002-04-09 Thread Hanson, Robert
I'm sure that this can be done is less steps, but it works... #!/usr/bin/perl -w use strict; my $line = " stuff\n"; print chgSpace($line); sub chgSpace { my $line = shift; my ( $spaces ) = $line =~ /^(\s+)/; $spaces =~ s/ /_/g; $line =~ s/^\s+/$spaces/; return $line; }

Search & Replace Issue

2002-04-09 Thread Kristin A. I.
I am trying to indent a scroll-thru menu which has been made into a tree using the following database query: select dept_id, LPAD(' ',2*(Level-1))||dept_name dept_name from depts start with dept_id = 1 connect by dept_parent = PRIOR dept_id; My problem is that the query uses spaces to ind

RE: Pinging

2002-04-09 Thread Timothy Johnson
Check out the Net::Ping module. You can find it on PPM. # use Net::Ping; $p = Net::Ping->new('icmp',2); foreach(@computers){ if($p->ping($_){ print "$_ is there.\n"; }else{ print "$_ could not be contacted.\n"; } }

Pinging

2002-04-09 Thread Najamuddin, Junaid
hi, I am new to perl and looking to ping an oracle database located on an unix machine from win NT Has anyone have any idea how this can be accomplished thanks junaid -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: milliseconds

2002-04-09 Thread Jeff 'japhy' Pinyan
On Apr 9, Babichev Dmitry said: >How can I get time (time period) in milliseconds? Download the Time::HiRes module from CPAN; go to http://search.cpan.org/. -- Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/ RPI Acacia brother #734 http://www.perlmonks.org/ htt

RE: Scope of variables. Lost in subs

2002-04-09 Thread Jenda Krynicky
From: "Gary Hawkins" <[EMAIL PROTECTED]> > > #!perl -w > > my $x = 'Ahoj'; > > print "$x\n"; > > package foo; > > print "$x\n"; > > __END__ > > > > I believe packages are completely irrelevant to lexical (declared > > with my()) variables. > > > > I was following it up un

Re: Timed Redirection between Subs

2002-04-09 Thread p
Andrew, You could use 'sleep' to delay the program for a few seconds, but I'm not sure that's what you want. You want one page to be displayed, then wait a few seconds, then show another page? Try a simple HTML re-direct instead: Stick that in above your tag. All you have to do then is mak

Re: strict problem

2002-04-09 Thread Felix Geerinckx
on Tue, 09 Apr 2002 08:26:01 GMT, Connie Chan wrote: > I have this statement > if ( $ENV{REQUEST_METHOD} eq "GET") > { > ... > ... > } > > That works fine if I don't use -w , but if I use -w, > it tells "Use of uninitialized value in string eq at." It doesn't work fine without '-

Re: PROBLEM WITH THE USES OF USE STRICT

2002-04-09 Thread Carl Franks
Jaimee, You should also change: chop(my$input_answer = ); to read as: chomp(my$input_answer = ); 'chomp' removes a linebreak,if there is one, from the end of the input, which is what you want here. 'chop' removes the last character (regardless of what it is) from the end of the input, whic

Re: strict problem

2002-04-09 Thread Jonathan E. Paton
> I have this statement > if ( $ENV{REQUEST_METHOD} eq "GET") > { > ... > ... > } > > That works fine if I don't use -w , but if I use -w, > it tells "Use of uninitialized value in string eq at." > why? Enviroment variables come via the shell (or CGI server), and you can't trust t

milliseconds

2002-04-09 Thread Babichev Dmitry
Hello, beginners. Sorry to trouble you. How can I get time (time period) in milliseconds? Thank you in advance. -- Babichev L. Dmitry -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Microsoft Access/Running program as a service on Win2k

2002-04-09 Thread mrtlc
I think you need both DBI and DBD::ODBC. Timothy Johnson <[EMAIL PROTECTED]> wrote in message C0FD5BECE2F0C84EAA97D7300A500D5002581294@SMILEY">news:C0FD5BECE2F0C84EAA97D7300A500D5002581294@SMILEY... > > Oops. I think that was DBD, not DBI. > > -Original Message- > From: Timothy Johnson [

strict problem

2002-04-09 Thread Connie Chan
Dear all, I have this statement if ( $ENV{REQUEST_METHOD} eq "GET") { ... ... } That works fine if I don't use -w , but if I use -w, it tells "Use of uninitialized value in string eq at." why ? Is that related to declare it first such as : my $req = $ENV{REQUEST_METHOD}; Thanks

RE: Scope of variables. Lost in subs

2002-04-09 Thread Gary Hawkins
> > > If you declare a variable with my() its scope will be from the > > > declaration to the end of the enclosing block. Which for variables > > > declared outside any {} block or eval"" means ... to the end of the > > > file. > > > > > > > Wrong. > > > > You forgot about 'package'. > > What do y