Re: writing to a text file --> permission denied

2001-05-30 Thread Nichole Bialczyk
that's what i thought, too. but i already did that. - Original Message - From: "Asim Memon" <[EMAIL PROTECTED]> To: "Nichole Bialczyk" <[EMAIL PROTECTED]> Sent: Thursday, May 31, 2001 2:07 AM Subject: Re: writing to a text file --> permission denied > are you sure the permissions are se

writing to a text file --> permission denied

2001-05-30 Thread Nichole Bialczyk
when i put in the $! i get the error message Permission denied. i also tried to do it the standard way with the open...or die... statement, but then i got an internal server error 500. sometimes i think it's better to write your own code than to modify existing code. gr i really a

Re: writing to a text file

2001-05-30 Thread Hasanuddin Tamir
On Thu, 31 May 2001, Nichole Bialczyk <[EMAIL PROTECTED]> wrote, > Date: Thu, 31 May 2001 01:00:49 -0500 > From: Nichole Bialczyk <[EMAIL PROTECTED]> > To: [EMAIL PROTECTED] > Subject: writing to a text file > > i'm trying to write a log file and i can't seem to open it to write to. the file >d

Re: writing to a text file

2001-05-30 Thread Michael Fowler
On Thu, May 31, 2001 at 01:00:49AM -0500, Nichole Bialczyk wrote: > i'm trying to write a log file and i can't seem to open it to write to. the file >does exist. here is the code for opening the file: > > if(! open(LOG, ">xxx.txt)) { >print "Content-type: text/html\n\n"; >print "Can't op

writing to a text file

2001-05-30 Thread Nichole Bialczyk
i'm trying to write a log file and i can't seem to open it to write to. the file does exist. here is the code for opening the file: if(! open(LOG, ">xxx.txt)) { print "Content-type: text/html\n\n"; print "Can't open xxx.txt\n"; exit; } print LOG "At $date, $ENV{'REMOTE_HOST'} etc., etc.

Re: test for real number

2001-05-30 Thread Morten Sickel
Hi Mike, You wrote: >How do I test an input to see if it is a real number? I have a situation >something like: (slightly snipped) >if (input equals a real number) { >xx >} >else { > >} Do you mean 'if it really is a number' or 'a real number' in the matematical sense? If you

Re: how to copy a hash ?

2001-05-30 Thread ___cliff rayman___
that will only copy a shallow hash. that is, one that does not contain references to other hashes or arrays. if you want to copy all elements (a deep copy), here is a suggestion: use Storable qw(freeze thaw); %arr1=qw(key1 data1 key2 data2); $arr1{key3}=[qw(arrdata1 arrdata2)]; %arr2=%{thaw f

Re: how to copy a hash ?

2001-05-30 Thread baby lakshmi
hi what abt this?? %arr1=qw(this 1 is 2 a 3 sample 4 program 5); %arr2=%arr1; print $arr2{this}; >From: [EMAIL PROTECTED] >To: [EMAIL PROTECTED] >Subject: how to copy a hash ? >Date: Wed, 30 May 2001 18:05:32 +0800 > >hello, > >I have a question : > >how to copy a hash? > >example: $h is refer

Re: 'while' confusion

2001-05-30 Thread ___cliff rayman___
"E. Alan Hogue" wrote: > > > foreach $field (@fld_vals) { > while ($field = '') { i think u want an 'if' here. when you use a 'while', the program continues to loop if the condition is true. this usually implies you will do something to change the condition within the loop. since you a

Re: 'while' confusion

2001-05-30 Thread Me
> foreach $field (@fld_vals) { Means, iterate through @fld_vals. For each cell, make $field be an alias to that cell, then do the bracketed code that follows. So, if you assign to $field in the code that follows, you assign to the cell in the array too. The code gets done once for each cell. >

Re: 'while' confusion

2001-05-30 Thread Tony Cook
On Wed, 30 May 2001, E. Alan Hogue wrote: ... > foreach $field (@fld_vals) { > while ($field = '') { > push (@nulls,$id); > } > } > > My idea was that $id would be, for instance, the > primary key value so that I could go look at the > record later. > > Well, it didn't

'while' confusion

2001-05-30 Thread E. Alan Hogue
Hello, I'm new to this list and pretty much an absolute perl beginner. I'm really enjoying the list and would appreciate a little insight into the true meaning of 'while'. For some reason I'm having trouble using it. I was working on something today to help me find bad data in a text file. Among

Re: Why 'and' not '&&' ? (was Cleaning up 'uninitialized value')

2001-05-30 Thread Paul Johnson
On Wed, May 30, 2001 at 11:42:15AM -0700, Paul wrote: > > --- Peter Cornelius <[EMAIL PROTECTED]> wrote: > > > Use: > > > if (@ARGV and -T $ARGV[0]) { ... } > > > > Just wondering if there is a reason for using the lower precedence > > 'and' here instead of '&&'? I haven't been finding many u

RE: doubt about do/until

2001-05-30 Thread Peter Scott
At 11:32 AM 5/31/01 +1000, King, Jason wrote: >I notice that the copyright notice is 1996 .. so perhaps my memory is >failing me and that there was a version of Perl where did NOT grab >the line-ending character as well .. otherwise Tom really is human and has >made a mistake :) I would peg it a

RE: Perl script not running

2001-05-30 Thread King, Jason
David Olbersen wrote .. >On Thu, 31 May 2001, Henk Klos wrote: > >> I have just downloaded and installed the latest version of Perl for >> WinNT. Followed all the instructions, associated .pl with perl.exe, >> etc etc. However, not one sample htm file from the "eg" directory is >> working. What d

RE: doubt about do/until

2001-05-30 Thread King, Jason
[EMAIL PROTECTED] wrote .. >In http://www.cpan.org/doc/FMTEYEWTK/is_numeric.html, >( Is it a number? ), Tom Christiansen writes: >--- >If you do care about getting 0's, then do this: > do { > print "Number, please: "; > $

Re: Perl script not running

2001-05-30 Thread David Olbersen
On Thu, 31 May 2001, Henk Klos wrote: > I have just downloaded and installed the latest version of Perl for WinNT. > Followed all the instructions, associated .pl with perl.exe, etc etc. > However, not one sample htm file from the "eg" directory is working. > What did I forget??? Did you forget

Perl script not running

2001-05-30 Thread Henk Klos
Hi, I have just downloaded and installed the latest version of Perl for WinNT. Followed all the instructions, associated .pl with perl.exe, etc etc. However, not one sample htm file from the "eg" directory is working. What did I forget??? Thanks henk

RE: Can't locate loadable object for module ...

2001-05-30 Thread King, Jason
Margit Brunder wrote .. >I've written a cgi script and when Apache (version 1.3.6) tries to call >it, I get the error message "can't locate loadable object for module >HTML::Parser in @INC at ./HTML/entities.pm line 79" although the >module Parser.pm IS in the same directory as entities.pm Th

Re: Help recursing directories and java mod question

2001-05-30 Thread Michael Fowler
On Wed, May 30, 2001 at 04:41:13PM -0700, John Milardovic wrote: > for $var (@files) > { > print "$count++\t$var\n"; > } I hope you weren't expecting $count to be incremented there. ++ is not interpolated. Did you mean: for $var (@files) { print $count++, "\t$var\n"; }

Re: Help recursing directories and java mod question

2001-05-30 Thread John Milardovic
Or ... for $var (@files) { print "$count++\t$var\n"; } HTH John __ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/

doubt about do/until

2001-05-30 Thread Atul_Khot
Hi gurus, In http://www.cpan.org/doc/FMTEYEWTK/is_numeric.html, ( Is it a number? ), Tom Christiansen writes: -- If you do care about getting 0's, then do this: do { print "N

Re: Why 'and' not '&&' ? (was Cleaning up 'uninitialized value')

2001-05-30 Thread Peter Scott
At 11:18 AM 5/30/01 -0700, Peter Cornelius wrote: > > Use: > > > > if (@ARGV and -T $ARGV[0]) { ... } > >Just wondering if there is a reason for using the lower precedence 'and' >here instead of '&&'? I haven't been finding many uses for 'and' which >tells me I might not fully understand it. T

Re: help with script

2001-05-30 Thread Michael Fowler
On Wed, May 30, 2001 at 03:57:44PM -0700, Peter Lemus wrote: > Hi guys, I keep getting errors on the followin script. > I need the script to logout all users other then root > or ipl. > > 1 #!/usr/bin/perl As mentioned by John Joseph Trammell: #!/usr/bin/perl -w use str

Re: Help recursing directories and java mod question

2001-05-30 Thread Michael Fowler
On Wed, May 30, 2001 at 04:00:53PM -0700, Steve Best wrote: > But when I went to go print the elements of the array: > > sub print_array { >my($count) = 0; >print "Printing array...\n"; >while (@files) { > print "$count\t$files[$count]\n"; > $count++; >}; > }; > >

RE: Help recursing directories and java mod question

2001-05-30 Thread Steve Best
Yeah, I have these pages burned into my pupils by now, but I have been unable to modify them to my needs. I was able to get a little farther with this: sub find_class { use File::Find; sub finder { return unless -f; push (@files, $File::Find::name); }; find (\&finder,

Re: help with script

2001-05-30 Thread John Joseph Trammell
On Wed, May 30, 2001 at 03:57:44PM -0700, Peter Lemus wrote: > Hi guys, I keep getting errors on the followin script. > I need the script to logout all users other then root > or ipl. > > 1 #!/usr/bin/perl > 2 # > 3 #Purpose: To logout users off the system > during after hours.

help with script

2001-05-30 Thread Peter Lemus
Hi guys, I keep getting errors on the followin script. I need the script to logout all users other then root or ipl. 1 #!/usr/bin/perl 2 # 3 #Purpose: To logout users off the system during after hours. 4 # 5 open(STDERR,">/tmp/userlog.log") || die $!; 6 select

Re: Help recursing directories and java mod question

2001-05-30 Thread Peter Scott
At 03:44 PM 5/30/01 -0700, Steve Best wrote: >Howdy, I used to do a bit of Perl programming but its all washed away >through disuse. Sooo, I need to write a subroutine that will recurse from a >parent directory through all children directories, performing an action on >files that match a pattern,

Re: [meta] RE: On Beginners' Mindsets, Part II

2001-05-30 Thread Peter Scott
At 02:29 PM 5/30/01 -0400, Jeff Pinyan wrote: > >I've given my share of one-liner answers, but based on this particular > >thread, I personally am going to endeavor to inform others, as much as I > >am able, rather than just "answer questions". > >I am all for enlightening and sharing knowledge.

Help recursing directories and java mod question

2001-05-30 Thread Steve Best
Howdy, I used to do a bit of Perl programming but its all washed away through disuse. Sooo, I need to write a subroutine that will recurse from a parent directory through all children directories, performing an action on files that match a pattern, in this case *.class. I have the Perl cookbook,

Re: Problems with Net::SSLeay

2001-05-30 Thread Peter Scott
At 03:37 PM 5/30/01 -0700, I wrote: >At 01:25 PM 5/30/01 -0500, you wrote: >>Peter, >> >>I did what you suggested and here are the results. I'm going to upgrade >>to OpenSSL-0.9.6a and then try it again. >> >>Any other suggestions? > >Fraid not. This kind of thing is a bear. I'd be checking wh

Re: Problems with Net::SSLeay

2001-05-30 Thread Peter Scott
At 01:25 PM 5/30/01 -0500, you wrote: >Peter, > >I did what you suggested and here are the results. I'm going to upgrade >to OpenSSL-0.9.6a and then try it again. > >Any other suggestions? Fraid not. This kind of thing is a bear. I'd be checking whether my OpenSSL passed all *its* tests at t

RE: On Beginners' Mindsets, Part II

2001-05-30 Thread Peter Scott
A private correspondent wrote: >BUT... when the >code is posted for all to see, it gives the rest of us ideas of how to >handle such problems. Ah, that reminds me of a mini pearl of wisdom I wanted to put out there :-) Maybe it should go in the FAQ... Several people have replied to just me whe

Hash with multiple values per key

2001-05-30 Thread Ravi Channavajhala
Hi, Does anyone have a nifty way to do a sort and comparison of two or more hash keys with multiple values per key? I am building a hash with push (@{$a{$b}},$c); $b keeps changing, lets say in first instance it is "1" and "2" in second instance, and each instance has multiple values, e.g, ins

Re: Hash with multiple values per key

2001-05-30 Thread Paul
--- Ravi Channavajhala <[EMAIL PROTECTED]> wrote: > Hi, Howdy. > Does anyone have a nifty way to do a sort and comparison > of two or more hash keys with multiple values per key? > I am building a hash with > > push (@{$a{$b}},$c); Okay; %a is the hash, and each entry in the hash is an array

Re: test for real number

2001-05-30 Thread Carl Rogers
Good day; try::: if ($input =~ /\d+\.?\d+/){ xxx } The intent here is: \d+ ##one or more digits \.? ##followed by zero or one "." (there is a dot there) \d+ ##followed by one or more digits. I think this will work. Depending on how your reals will be input, you c

Re: Hash with multiple values per key

2001-05-30 Thread Jeff Pinyan
On May 30, Ravi Channavajhala said: >Does anyone have a nifty way to do a sort and comparison of two or more >hash keys with multiple values per key? >push (@{$a{$b}},$c); >$b keeps changing, lets say in first instance it is "1" and >"2" in second instance, and each instance has multiple values

Re: test for real number

2001-05-30 Thread Jeff Pinyan
On May 30, [EMAIL PROTECTED] said: >I'm new to the group and new to Perl and am very glad to have such a >resource available. Hopefully someday I'll be on the giving end of the >help list but for now I'm stumped. How do I test an input to see if it >is a real number? I have a situation someth

Re: test for real number

2001-05-30 Thread Paul
--- [EMAIL PROTECTED] wrote: > help list but for now I'm stumped. How do I test an input to see if > it is a real number? I have a situation something like: By "real number", exactly what do you mean? Do you mean a decimal fraction without characters other than 0123456789.+- or do you want to i

Re: qw

2001-05-30 Thread Paul
--- Nichole Bialczyk <[EMAIL PROTECTED]> wrote: > i'm trying to work my way throuh an existing script and it says > @array = qw("stuff", "more stuff", "even more stuff"); That looks like a typo, though they may have actually wanted the quotes and commas in the strings if you run that under -

Re: test for real number

2001-05-30 Thread Walt Mankowski
On Wed, May 30, 2001 at 01:56:40PM -0700, [EMAIL PROTECTED] wrote: > How do I test an input to see if it is a real number? $ perldoc -q float Found in /usr/local/lib/perl5/5.6.1/pod/perlfaq4.pod How do I determine whether a scalar is a number/whole/integer/float? Assuming that y

Re: qw

2001-05-30 Thread Walt Mankowski
On Wed, May 30, 2001 at 03:38:35PM -0500, Nichole Bialczyk wrote: > i'm trying to work my way throuh an existing script and it says > > @array = qw("stuff", "more stuff", "even more stuff"); > > what does the qw do? In your example, it's a broken way of trying to say: $array[0] = "stuff"; $arr

Hash with multiple values per key

2001-05-30 Thread Ravi Channavajhala
Hi, Does anyone have a nifty way to do a sort and comparison of two or more hash keys with multiple values per key? I am building a hash with push (@{$a{$b}},$c); $b keeps changing, lets say in first instance it is "1" and "2" in second instance, and each instance has multiple values, e.g, ins

RE: qw

2001-05-30 Thread Jeffrey Goff
Yep,caught that myself a few minutes -after- sending email. Apologies. -Original Message- From: Jeff Pinyan [mailto:[EMAIL PROTECTED]] On May 30, Jeffrey Goff said: >It's a shortcut for assigning words to an array. That statement would return >an array that looks roughly like this: > >(

test for real number

2001-05-30 Thread mikemckee
Hi, I'm new to the group and new to Perl and am very glad to have such a resource available. Hopefully someday I'll be on the giving end of the help list but for now I'm stumped. How do I test an input to see if it is a real number? I have a situation something like: $input = ; chom

RE: qw

2001-05-30 Thread Jeff Pinyan
On May 30, Jeffrey Goff said: >It's a shortcut for assigning words to an array. That statement would return >an array that looks roughly like this: > >('"stuff",', '"more stuff",', '"even more stuff"') # Note the double quotes. Nope, no matter what you do, qw() really splits on whitespace. f

Re: qw

2001-05-30 Thread Michael Fowler
On Wed, May 30, 2001 at 03:38:35PM -0500, Nichole Bialczyk wrote: > i'm trying to work my way throuh an existing script and it says > > @array = qw("stuff", "more stuff", "even more stuff"); > > what does the qw do? perldoc perlop: qw/STRING/ Returns a list of the words ex

RE: qw

2001-05-30 Thread Larry Shatzer
Here is the documentation on it. ( http://www.perldoc.com/perl5.6/pod/perlop.html#qw%2fSTRING%2f ) qw/STRING/ Evaluates to a list of the words extracted out of STRING, using embedded whitespace as the word delimiters. It can be understood as being roughly equivalent to: split(' ', q/STRING

RE: qw

2001-05-30 Thread Jeffrey Goff
It's a shortcut for assigning words to an array. That statement would return an array that looks roughly like this: ('"stuff",', '"more stuff",', '"even more stuff"') # Note the double quotes. Something like ("stuff","more stuff","even more stuff"); # was likely intended, without qw(). Search f

qw

2001-05-30 Thread Nichole Bialczyk
i'm trying to work my way throuh an existing script and it says @array = qw("stuff", "more stuff", "even more stuff"); what does the qw do? thanks, nichole

Re: regexp Help

2001-05-30 Thread Craig Moynes/Markham/IBM
from your small code sample everything checks out. I would be inclined to ensure that the parameter is being read in correctly with no trailing spaces or strange characters. If you need more help send a bigger code sample for us to peruse. - Craig Moynes [

RE: Email question

2001-05-30 Thread Robin Lavallee (LMC)
> -Original Message- > From: Gross, Stephan [SMTP:[EMAIL PROTECTED]] > Sent: Wednesday, May 30, 2001 1:12 PM > To: 'Beginner Perl' > Subject: Email question > > I'd like to a write a program that would tell me, for several specific > accounts/mailboxes on a Microsoft Exchange serv

Re: regexp Help

2001-05-30 Thread Stephen P. Potter
Lightning flashed, thunder crashed and "Kyrytow, Stefan" <[EMAIL PROTECTED] m> whispered: | Example. | I am writing a script to parse a web log and report on all the hosts in the | log. | However I have a command line option to exclude a domain from the report. | My problem is that I can't figure

Re: Why 'and' not '&&' ? (was Cleaning up 'uninitialized value')

2001-05-30 Thread Stephen P. Potter
Lightning flashed, thunder crashed and Peter Cornelius whispered: | > Use: | > | > if (@ARGV and -T $ARGV[0]) { ... } | | Just wondering if there is a reason for using the lower precedence 'and' | here instead of '&&'? I haven't been finding many uses for 'and' which | tells me I might not f

RE: On Beginners' Mindsets, Part II

2001-05-30 Thread Paul
--- "Wilson, Tom" <[EMAIL PROTECTED]> wrote: > My two cents sometimes getting the answer is more important that > learning it right away. There are many times in the various > languages that I've worked with that I've gotten the answer and later > on remembered the solution and incorporated

[OT} Re: Sleeping for less than a second

2001-05-30 Thread Jeff Pinyan
On May 30, Walt Mankowski said: >On Wed, May 30, 2001 at 01:47:55PM -0400, Jeff Pinyan wrote: >> =head1 Found in /usr/local/lib/perl5/5.00502/pod/perlfaq8.pod > >Looks like you're overdue for an upgrade... :-) Not my machine, it's just the ISP I used to work at -- I have a shell account there no

[meta] RE: On Beginners' Mindsets, Part II

2001-05-30 Thread Jeff Pinyan
On May 30, Wilson, Tom said: >My two cents sometimes getting the answer is more important that >learning it right away. There are many times in the various languages that >I've worked with that I've gotten the answer and later on remembered the >solution and incorporated it into something ne

Re: Sleeping for less than a second

2001-05-30 Thread Walt Mankowski
On Wed, May 30, 2001 at 01:47:55PM -0400, Jeff Pinyan wrote: > =head1 Found in /usr/local/lib/perl5/5.00502/pod/perlfaq8.pod Looks like you're overdue for an upgrade... :-) Walt -- Walter C. Mankowski Senior Software EngineerMyxa Corporation phone: (610) 234-2626 fax: (610) 2

Re: Why 'and' not '&&' ? (was Cleaning up 'uninitialized value')

2001-05-30 Thread Paul
--- Peter Cornelius <[EMAIL PROTECTED]> wrote: > > Use: > > if (@ARGV and -T $ARGV[0]) { ... } > > Just wondering if there is a reason for using the lower precedence > 'and' here instead of '&&'? I haven't been finding many uses for > 'and' which tells me I might not fully understand it. I'v

Re: Why 'and' not '&&' ? (was Cleaning up 'uninitialized value')

2001-05-30 Thread Jeff Pinyan
On May 30, Peter Cornelius said: >> if (@ARGV and -T $ARGV[0]) { ... } > >Just wondering if there is a reason for using the lower precedence 'and' >here instead of '&&'? I haven't been finding many uses for 'and' which >tells me I might not fully understand it. You must be careful about using

RE: On Beginners' Mindsets, Part II

2001-05-30 Thread Wilson, Tom
I am a beginning Perl programmer and really enjoy the Perl mail lists. While I don't understand everything that is written about here, I've saved notes that I'll understand down the road. My two cents sometimes getting the answer is more important that learning it right away. There are many t

[meta] RE: On Beginners' Mindsets, Part II

2001-05-30 Thread Jeff Pinyan
On May 30, Scott Thompson said: >While I couldn't agree more with both statements, I think it is the >unfortunate reality that, with the recent (last 2 years... ) boom and >subsequent bust of the Internet economy at large, there is a growing >majority of beginning programmers who will fall into t

Why 'and' not '&&' ? (was Cleaning up 'uninitialized value')

2001-05-30 Thread Peter Cornelius
> Use: > > if (@ARGV and -T $ARGV[0]) { ... } Just wondering if there is a reason for using the lower precedence 'and' here instead of '&&'? I haven't been finding many uses for 'and' which tells me I might not fully understand it. Thanks, Peter C.

RE: On Beginners' Mindsets, Part II

2001-05-30 Thread Scott Thompson
> -Original Message- > From: Jeff Pinyan [mailto:[EMAIL PROTECTED]] > Subject: Re: On Beginners' Mindsets, Part II > > On May 30, Peter Scott said: > > >*Curiosity* is an essential trait for the programmer. In all > seriousness, > >if you don't have a deep desire to find out how things wo

Multiple email addresses

2001-05-30 Thread Gross, Stephan
I figured out how to look at email through the Net::IMAP::Simple module. I now have a deeper question. I have one account that several different email accounts are tied to. For example, user account 'xyz' has mail at [EMAIL PROTECTED] , but there are other Exchange e

Re: Sleeping for less than a second

2001-05-30 Thread Paul
--- Craig Moynes/Markham/IBM <[EMAIL PROTECTED]> wrote: > Is there anyway to sleep for less than a second using the default > installation of perl ? Yes, though it isn't pretty. =o) select(undef, undef, undef, 0.25); # the last arg is seconds c.f. perldoc -f select ___

Re: Sleeping for less than a second

2001-05-30 Thread Walt Mankowski
On Wed, May 30, 2001 at 01:42:17PM -0400, Craig Moynes/Markham/IBM wrote: > Hi all, my DNS server is down so I can't check online. No need to check online. This answer is in the FAQ that comes with Perl. > Is there anyway to sleep for less than a second using the default > installation of perl

Re: Sleeping for less than a second

2001-05-30 Thread Jeff Pinyan
On May 30, Craig Moynes/Markham/IBM said: >Is there anyway to sleep for less than a second using the default >installation of perl ? friday:~ $ perldoc -q sleep =head1 Found in /usr/local/lib/perl5/5.00502/pod/perlfaq8.pod =head2 How can I sleep() or alarm() for under a second? If you want fin

Sleeping for less than a second

2001-05-30 Thread Craig Moynes/Markham/IBM
Hi all, my DNS server is down so I can't check online. Is there anyway to sleep for less than a second using the default installation of perl ? And if not what CPAN module should I use when I get my internet connection back up ? - Craig Moynes Internship

Re: On Beginners' Mindsets, Part II

2001-05-30 Thread Morbus Iff
>Secondly, want to understand *everything*. Even if you leave some parts >until later because they're less interesting or less relevant, strive to >understand an entire process from top to bottom. It's amazing how often I agree wholeheartedly with this statement. I've done the gambit of adv

Re: iinfinite loop

2001-05-30 Thread Jeff Pinyan
On May 30, David Gilden said: >$data = 'some >multi line >string'; > >while($data){ > push(@everyline, $_); >} You're confusing this with while () { # do something with $_; } You can do: @lines = split /\n/, $data; or you can download the IO::String module from

Re: iinfinite loop

2001-05-30 Thread Ondrej Par
1) better use $data = < The following seems to never break out of the loop, > any comments? > Thanks > > Dave > > #!/usr/bin/perl -w > > > $data = 'some > multi line > string'; > > > while($data){ > >push(@everyline, $_); > > } -- Ondrej Par Internet Securities Software Enginee

RE: iinfinite loop

2001-05-30 Thread Jeffrey Goff
Judging by the loop you seem to want, something like $data="Hey\nThis is\nmultiline"; @everyline = split(/\n/,$data); is probably more appropriate for your purposes. However the original comments re: $data never being modified still hold true. -Original Message- From: Brent Michalski [m

Re: iinfinite loop

2001-05-30 Thread Brett W. McCoy
On Wed, 30 May 2001, David Gilden wrote: > The following seems to never break out of the loop, > any comments? > Thanks > > Dave > > #!/usr/bin/perl -w > > > $data = 'some > multi line > string'; > > > while($data){ > >push(@everyline, $_); > > } Yes, it's going to loop infinitel

Re: iinfinite loop

2001-05-30 Thread Brent Michalski
OOps, hit send too soon... This is _not_ the same as reading from a filehandle! while () is NOT the same as while($variable) {unless $variable is a filehandle} If working with a filehandle, the while will loop until no data is left. With a string, it will just keep looping while true (data i

Re: iinfinite loop

2001-05-30 Thread Brent Michalski
Because the while loop will loop for as long as $data is "true" or contains data Considering that it has data in it, you have created an "infinite" loop David Gilden

Re: iinfinite loop

2001-05-30 Thread John Joseph Trammell
On Wed, May 30, 2001 at 01:25:07PM -0400, David Gilden wrote: > The following seems to never break out of the loop, > any comments? > Thanks > > Dave > > #!/usr/bin/perl -w > > > $data = 'some > multi line > string'; > > > while($data){ > >push(@everyline, $_); >

iinfinite loop

2001-05-30 Thread David Gilden
The following seems to never break out of the loop, any comments? Thanks Dave #!/usr/bin/perl -w $data = 'some multi line string'; while($data){ push(@everyline, $_); }

Email question

2001-05-30 Thread Gross, Stephan
I'd like to a write a program that would tell me, for several specific accounts/mailboxes on a Microsoft Exchange server, how many emails are there. I can use either POP3 or IMAP protocols. Any suggestions or pointers? ___ Stephan Gross

Re: On Beginners' Mindsets, Part II

2001-05-30 Thread Jeff Pinyan
On May 30, Peter Scott said: >*Curiosity* is an essential trait for the programmer. In all seriousness, >if you don't have a deep desire to find out how things work - in >particular, software - this may not be the field for you. Principally >because our tools are rarely so perfect at encapsu

regexp Help

2001-05-30 Thread Kyrytow, Stefan
If someone could please help me. I can't figure out how to use a variable in a regexp. Example. I am writing a script to parse a web log and report on all the hosts in the log. However I have a command line option to exclude a domain from the report. My problem is that I can't figure out how to

On Beginners' Mindsets, Part II

2001-05-30 Thread Peter Scott
Comments by Scott Thompson and Elaine Ashton prompt an early Part II. *Curiosity* is an essential trait for the programmer. In all seriousness, if you don't have a deep desire to find out how things work - in particular, software - this may not be the field for you. Principally because our t

Ca't locate loadable object for module...

2001-05-30 Thread Margit Brunder
I get the error message "can't locate loadable object for module HTML::Parser in @INC at ./HTML/entities.pm line 79" although the module Parser.pm is in the same directory as entities.pm The path where Parser.pm is located is included in @INC !! What's going wrong? Thanks Margit

Re: Hash tutorial?

2001-05-30 Thread Jeff Pinyan
On May 30, Paul said: >Just an elaboration -- you can do this: > > @hash{ qw( a b c ) } = qw( 1 2 3 ); > >which should give you the same as: > > %hash = ( a => 1, b => 2, c => 3 ); Only if %hash was previously empty. Assigning to a hash all at once clears it and sets the key-value pairs you p

Re: Hash tutorial?

2001-05-30 Thread Paul
--- Paul <[EMAIL PROTECTED]> wrote: > @ASCEBC{values %EBCASC} = keys %EBCASC; # flip for the compliment Just an elaboration -- you can do this: @hash{ qw( a b c ) } = qw( 1 2 3 ); which should give you the same as: %hash = ( a => 1, b => 2, c => 3 ); Though the second one is a lot more

Re: Hash tutorial?

2001-05-30 Thread Paul
--- Oliver Glass <[EMAIL PROTECTED]> wrote: > Hello, Hiya. =o) > Despite a fair amount of general coding experience I keep slipping up > with hashes... I learnt them in a hurry and so am working on loose > foundations. lol -- I've *never* done *that* before... > Could anyone reccomend a tut

RE: On Beginners' Mindsets, Part I

2001-05-30 Thread Peter Scott
At 08:42 AM 5/30/2001 -0500, Scott Thompson wrote: >For myself, I have learned >just as much about Perl -- sometimes MORE -- by "bucking" the tried-and-true >methods to discover my own path. Sometimes I'd come stumbling back to the >common wisdom, battered and bruised for my efforts. Other times

Re: Different releases of Perl for Win

2001-05-30 Thread Me
> different flavours of Perl Also check out http://cygwin.com/ which gives you a simulated unix environment on Windows. This way you can run identical perl setups on your w2k as on your linux machines rather than using activestate on the w2k machines.

RE: Re: how to copy a hash ?

2001-05-30 Thread Paul
--- [EMAIL PROTECTED] wrote: > i don't know what kinds of hash $h is. > maybe $h is hash of hashes, or $h is hashof array. > how to do that? c.f. Randall's post on deep copying. __ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail

Re: how to copy a hash ?

2001-05-30 Thread Paul
--- [EMAIL PROTECTED] wrote: > how to copy a hash? > example: $h is reference of a hash struct. > i want to copy this hash struct. Well, the simplistic answer would be: my %newHash = %{$h}; if $h = { a => 1, b => 2 }, then that's fine, but with subelements like in a hash of hashes or arra

Re: Binary and ASCII

2001-05-30 Thread Paul
--- Cameron Malchow <[EMAIL PROTECTED]> wrote: > In unix, specifically OS X, if you have a perl program that is either > binary or ascii how can you convert it to the opposite format? No binary version of Perl programs (at least that I'd recommend). Could you elaborate on what you mean? For nor

Re: 'sort(func(list))' <=same as=> 'sort func (list)' ?!?!?

2001-05-30 Thread Jeff Pinyan
On May 30, Mark Salazar said: >I was recently bitten by this, and it's not clear to me (and others) if >this is correct Perl behavior or not. > >If you have a user defined function 'func' that returns a list and you'd >like to sort that return value it's reasonable to try: > > sort(func(@list));

Re: Checking DOS timestamps

2001-05-30 Thread Paul
--- Steve <[EMAIL PROTECTED]> wrote: > My question is where do I get started with DOS file create modified > etc timestamps? perldoc perlfunc look at -M, and stat(). I don't think the fact that it's DOS will matter at all. =o) __ Do You Yahoo!

Re: 'sort(func(list))' <=same as=> 'sort func (list)' ?!?!?

2001-05-30 Thread Paul
--- Mark Salazar <[EMAIL PROTECTED]> wrote: > I was recently bitten by this, and it's not clear to me (and others) > if this is correct Perl behavior or not. > If you have a user defined function 'func' that returns a list and > you'd like to sort that return value it's reasonable to try: > sor

Czech speaking Perl help-desk

2001-05-30 Thread Ondrej Par
Dear subscribers, if some of you are speaking Czech language, and you find answers in your native language more useful than English ones, you may attend the discussion group, dedicated to Perl, which runs on WWW-based server Pruvodce: http://www.pruvodce.cz/kluby/perl I hope that rest of you

RE: use strict / explicit packages

2001-05-30 Thread Paul
--- David Gilden <[EMAIL PROTECTED]> wrote: > Did I touch a nerve here or what? LOL!!! It happens. ;o] > Ge, all of this totally is confusing me, Haven't got a clue what you mean. ~grin~ > So you know where I am coming from, I'm taking > a second on-line CGI/PERL class that leaves a

'sort(func(list))' <=same as=> 'sort func (list)' ?!?!?

2001-05-30 Thread Mark Salazar
I was recently bitten by this, and it's not clear to me (and others) if this is correct Perl behavior or not. If you have a user defined function 'func' that returns a list and you'd like to sort that return value it's reasonable to try: sort(func(@list)); but apparently Perl interprets this

Re: Cleaning up 'uninitialized value'

2001-05-30 Thread Ondrej Par
On Wednesday 30 May 2001 16:45, Craig Moynes/Markham/IBM wrote: > # If the first argument is a text file then store the name > if ( (-T $ARGV[0]) ) > # ^ This is the bad boy Replace it with if (defined($ARGV[0]) && (-T $ARGV[0])) or possibly if (@ARGV && (-T $ARGV[0])) whatev

Re: Cleaning up 'uninitialized value'

2001-05-30 Thread Jeff Pinyan
On May 30, Craig Moynes/Markham/IBM said: >I have a script that when it runs (with no parameters) I have warnings >displayed (we have all seen them but) : > >>Use of uninitialized value at ./log_prune.pl line 14. Because @ARGV is empty, $ARGV[0] is undef. >if ( (-T $ARGV[0]) ) Use: if (@ARG

  1   2   >