RE: PERL IS NOT A HIGH LEVEL LANGUAGE

2001-08-17 Thread Mooney Christophe-CMOONEY1
HAHAHAHAHA !! -Original Message- From: Humberto Varela [mailto:[EMAIL PROTECTED]] Sent: Friday, August 17, 2001 1:19 PM To: [EMAIL PROTECTED] Subject: Re: PERL IS NOT A HIGH LEVEL LANGUAGE - the understanding of more advanced data structures...with 2 >years of serious cobol for example

RE: [ADMIN] Re: [ADMIN] Re: FW: F*** YOU

2001-08-14 Thread Mooney Christophe-CMOONEY1
Agreed. It would be nice not to have to deal with jerks on this list. -Original Message- From: Michael Kelly [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 14, 2001 12:47 PM To: [EMAIL PROTECTED] Subject: Re: [ADMIN] Re: [ADMIN] Re: FW: F*** YOU On 8/14/01 9:48 AM, [EMAIL PROTECTED]

RE: number of elements in array is -1?

2001-08-10 Thread Mooney Christophe-CMOONEY1
I thought so. You read through the entire file, so by the time you get to your second while loop, you're at the very end of the file. You need to rewind. -Original Message- From: Tyler Longren [mailto:[EMAIL PROTECTED]] Sent: Friday, August 10, 2001 9:29 AM To: Brett W. McCoy Cc: [EMAIL

RE: number of elements in array is -1?

2001-08-10 Thread Mooney Christophe-CMOONEY1
if $#scans==-1, then the array is empty (of course!) Are you checking to make sure LOGFILE opened correctly? -Original Message- From: Tyler Longren [mailto:[EMAIL PROTECTED]] Sent: Friday, August 10, 2001 9:19 AM To: Perl-Beginners Subject: number of elements in array is -1? Hello ever

RE: escape sequence for @

2001-08-09 Thread Mooney Christophe-CMOONEY1
If you need to use double quotes, you can say: print "somebody\@somewhere.com" but if you're not using any other escape sequences or variables, then just use single quotes: print '[EMAIL PROTECTED]' Single quotes force perl to take the string as it is instead of trying to inse

RE: compilation error - simple program

2001-08-09 Thread Mooney Christophe-CMOONEY1
> #!/usr/bin/perl > open(INFILE, "testin"); > open(OUTFILE, ">testout"); > > $x=getc(INFILE); > while($x!=eof(INFILE){ ^ You have mismatched parentheses here. Should be: while ($x!=eof(INFILE)){ >print ("$x"); >$x=getc(INFILE); > } > close(INFILE); > close(OUTFILE

RE: Hit counters

2001-08-08 Thread Mooney Christophe-CMOONEY1
this explains a lot. only in Windows ... ;) -Original Message- From: Matthew Peter Lyon [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 08, 2001 4:34 PM To: Sharon Carter; [EMAIL PROTECTED] Subject: Re: Hit counters this is a virus. don't open it. - Original Message - From:

RE: Deleting leading/trailing whitespace

2001-08-08 Thread Mooney Christophe-CMOONEY1
> From: Sudarsan Raghavan [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, August 08, 2001 1:48 PM > To: Sophia Corwell > Cc: [EMAIL PROTECTED] > Subject: Re: Deleting leading/trailing whitespace > > > ($temp) = $temp =~ m/^\s+(\S*)\s+$/; No, because this won't match the following string: $

RE: heredoc

2001-08-08 Thread Mooney Christophe-CMOONEY1
This seems to work: @array=split /\n/,

RE: Loading file into hash

2001-08-08 Thread Mooney Christophe-CMOONEY1
Quite easily: open(IN,$file) || die "could not open $file: $!\n"; while () { s:#.*$::; # weed out comments next unless /\S/; # make sure there's something to input ($from,$to)=split /\s+/; # split the line by the whitespace $hash{$from}=

RE: list archives

2001-08-08 Thread Mooney Christophe-CMOONEY1
I apologize. You're right. There are newer dates at the bottom. thanks! christopher -Original Message- From: Elaine -HFB- Ashton [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 07, 2001 5:51 PM To: Mooney Christophe-CMOONEY1 Cc: [EMAIL PROTECTED] Subject: Re: list archives M

RE: Create an array of arrrays from a scalar

2001-08-07 Thread Mooney Christophe-CMOONEY1
hehe -- i tried to do the exact same thing last year. The solution? Mail::*Client from CPAN (your example looks like IMAP, but i'm not sure ...) You may not be crazy now, but if you continue down this dark path, you'll certainly end up there. Trust me. ;) -Original Message- From: C

RE: Frustrated installing modules!?!

2001-08-07 Thread Mooney Christophe-CMOONEY1
What's PPM? Is this similar to CPAN? -Original Message- From: Wagner-David [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 07, 2001 3:55 PM To: [EMAIL PROTECTED] Subject: RE: Frustrated installing modules!?! Here is my setup for AS using ppm: PPM interactive shell (2.1.2) - t

RE: list archives

2001-08-07 Thread Mooney Christophe-CMOONEY1
-Original Message- From: Elaine -HFB- Ashton [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 07, 2001 3:08 PM To: Mooney Christophe-CMOONEY1 Cc: [EMAIL PROTECTED] Subject: Re: list archives Mooney Christophe-CMOONEY1 [[EMAIL PROTECTED]] quoth: *>Got a question related to this list: *> *&

RE: pls ignore last msg

2001-08-07 Thread Mooney Christophe-CMOONEY1
Too late -- i already posted. Oh, well! ;) -Original Message- From: Barry Carroll [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 07, 2001 11:12 AM To: '[EMAIL PROTECTED]' Subject: pls ignore last msg sorry guys i got it, silly mistake -- To unsubscribe, e-mail: [EMAIL PROTECTE

RE: Newbie Question about subroutine

2001-08-07 Thread Mooney Christophe-CMOONEY1
@_ is a list and $vInput is a scalar. A list in scalar context returns the number of elements in the array. So, $vInput=@_ will put the number of elements in @_ into $vInput, which, naturally, is always one. To extract the single argument from the list, do this: $vInput=shift; This will tak

RE: magic import of extensions?

2001-08-07 Thread Mooney Christophe-CMOONEY1
Actually, i think the 'use MyPackage' statement is what Edwin is trying avoid, hence the term "magic" ... ? It's not really a good idea to do this, but you could create a second perl command in another location (or rename it in the same location ...) which says: /old/perl -MMyPackage $*

list archives

2001-08-07 Thread Mooney Christophe-CMOONEY1
Got a question related to this list: I went to the specified archive because i wanted to find an older post, but it looks like the list only contains this month's postings. Does anyone know where the older posts are? Are they lost and gone forever? -- To unsubscribe, e-mail: [EMAIL PROTECTED]

RE: removing a line!!!

2001-08-07 Thread Mooney Christophe-CMOONEY1
Sounds dangerous! ;) perldoc perlrun Look for the '-i' entry. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 07, 2001 10:02 AM To: [EMAIL PROTECTED] Subject: removing a line!!! hi there, i am just a 2 days perl beginner and trying to do so

RE: Remove White Space

2001-08-06 Thread Mooney Christophe-CMOONEY1
Actually, \s takes care of any whitespace, including tabs. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Monday, August 06, 2001 4:09 PM To: [EMAIL PROTECTED] Cc: Perl Help; 'Mooney Christophe-CMOONEY1' Subject: RE: Remove White Space make su

RE: Remove White Space

2001-08-06 Thread Mooney Christophe-CMOONEY1
PROTECTED]] Sent: Monday, August 06, 2001 4:10 PM To: 'Mooney Christophe-CMOONEY1' Cc: Perl Help Subject: RE: Remove White Space No error messages or anything, but the white space is still in there. I did, however change the syntax to $var=~ s/\s*//g; From $var=~/\s*//g; Because I got

RE: Remove White Space

2001-08-06 Thread Mooney Christophe-CMOONEY1
What happens when you try? -Original Message- From: Scott Martin [mailto:[EMAIL PROTECTED]] Sent: Monday, August 06, 2001 4:05 PM To: 'Mooney Christophe-CMOONEY1' Cc: 'Perl Help' Subject: RE: Remove White Space That's what I thought it would be but still no luc

RE: Remove White Space

2001-08-06 Thread Mooney Christophe-CMOONEY1
$var=~/\s*//g; # ;) -Original Message- From: Scott Martin [mailto:[EMAIL PROTECTED]] Sent: Monday, August 06, 2001 3:56 PM To: Perl Help Subject: RE: Remove White Space After I sent it out, I actually came up with the idea myself after some digging. (go figure) any case, I am now havin

RE: Remove White Space

2001-08-06 Thread Mooney Christophe-CMOONEY1
$var=~s/^\s*//; -Original Message- From: Scott Martin [mailto:[EMAIL PROTECTED]] Sent: Monday, August 06, 2001 3:13 PM To: Perl Help Subject: Remove White Space How can I remove white space from the beginning of a variable? -Scott -- To unsubscribe, e-mail: [EMAIL PROTECTED] For a

RE: Did I violate?

2001-08-06 Thread Mooney Christophe-CMOONEY1
.. -Original Message- From: Tom Malone [mailto:[EMAIL PROTECTED]] Sent: Monday, August 06, 2001 2:12 PM To: Mooney Christophe-CMOONEY1 Subject: Re: Did I violate? Sorry!!! I thought it was well-known GAIM is a Linux client for AOL Instant Messenger. It does everything AOL's IM

RE: Did I violate?

2001-08-06 Thread Mooney Christophe-CMOONEY1
What's GAIM? -Original Message- From: Tom Malone [mailto:[EMAIL PROTECTED]] Sent: Monday, August 06, 2001 1:59 PM To: [EMAIL PROTECTED] Subject: Did I violate? Hey everyone! I hope that I did not violate some rule of list etiquette with my messages about writing Perl scripts for GAIM

RE: get rid of the same elements in an array/hash

2001-08-06 Thread Mooney Christophe-CMOONEY1
You will never have duplicate keys in a hash. If you try to use the same key more than once, it will simply overwrite the previous definition: %blah=('a_key' => 'first definition', 'a_key' => 'second definition', 'a_key' => 'YES!!') the key 'a_key' appeared three times, but each time it overwri

RE: == vs eq What's the difference?

2001-08-06 Thread Mooney Christophe-CMOONEY1
== converts the arguments to numbers. So, even though ("1 blah blah blah" eq 1) is FALSE, ("1 blah blah blah" == 1) is TRUE. Similarly, ("nichts" eq 0) is FALSE, but ("nichts" == 0) is TRUE. -Original Message- From: CDitty [mailto:[EMAIL PROTECTED

RE: execute if NOT true.

2001-08-06 Thread Mooney Christophe-CMOONEY1
You were close! $url !~ /maincat/ -Original Message- From: Scott Martin [mailto:[EMAIL PROTECTED]] Sent: Monday, August 06, 2001 12:17 PM To: [EMAIL PROTECTED] Subject: execute if NOT true. I am testing a string like so: if ($url =~ /maincat/) { block } but I want to execute if it d

RE: check array element (HELP)

2001-07-31 Thread Mooney Christophe-CMOONEY1
st reference my $n= $#{$list};# subscript of last list element for my $i (0..$n-1) { for my $j ($i+1..$n) { if ($list->[$i] eq $list->[$j]) {return 1} } } return 0; } if (repeated_elements(\@whatever)) { print "There are repeated elem

RE: perl and graphics

2001-07-31 Thread Mooney Christophe-CMOONEY1
I believe you're looking for Image::Magick from CPAN (www.cpan.org) -Original Message- From: Matt Behrens [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 31, 2001 11:19 AM To: [EMAIL PROTECTED] Subject: perl and graphics Hi all- I'm currently trying to find a way to batch the conversion

RE: Splitting a string into a Array of Arrays

2001-07-31 Thread Mooney Christophe-CMOONEY1
You're actually very close. I would just change a couple of things. First of all, you don't need @data as well as @rows. $element is aliased to each element in the array as it loops, so you can re-assign right back into the same array when you split. This will cause the loop to independent of

RE: Security Question

2001-07-31 Thread Mooney Christophe-CMOONEY1
. ;) -Original Message- From: Mooney Christophe-CMOONEY1 [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 31, 2001 9:41 AM To: Perl Beginners Subject: RE: Security Question 'rm -rf .' is a unix command that removes everything in the current direcotry PERMANENTLY and UNCONDITION

RE: Security Question

2001-07-31 Thread Mooney Christophe-CMOONEY1
'rm -rf .' is a unix command that removes everything in the current direcotry PERMANENTLY and UNCONDITIONALLY -Original Message- From: Customer Service [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 31, 2001 9:44 AM To: Perl Beginners Subject: Security Question Dear Sirs, I first of all

RE: How do I extract 2 elements....

2001-07-31 Thread Mooney Christophe-CMOONEY1
@fo=@foo[2,5]; ^ -Original Message- From: Santosh M Hulkund [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 31, 2001 9:02 AM To: [EMAIL PROTECTED] Subject: How do I extract 2 elements Hi, I am new to perl, this is question is very silly and stupid. So, Please spare me..

RE: check array element (HELP)

2001-07-31 Thread Mooney Christophe-CMOONEY1
I would probably do this, although i'm sure some smarty-pants could come up with a one-liner ;) sub repeated_elements { my %found_one; for (@_) { return 1 if $found_one{$_}++; } return 0; } if (repeated_elements @whatever) { # ther

RE: ref problems

2001-07-30 Thread Mooney Christophe-CMOONEY1
case for trying to make my modules god-like. I guess it's just an art--one i have yet to master. ;) -Original Message- From: Jos I. Boumans [mailto:[EMAIL PROTECTED]] Sent: Monday, July 30, 2001 10:14 AM To: Mooney Christophe-CMOONEY1; [EMAIL PROTECTED] Subject: Re: ref problems Hi,

ref problems

2001-07-30 Thread Mooney Christophe-CMOONEY1
Hello, all -- i have come across an interesting problem. When i run the following script, i get that '$this' in dog::bark is undefined. When i think about it, this makes sense, since call $a_dog->{'speak'}() is like saying "dog::bark". Saying $a_dog->{'speak'}($a_dog) on the last line w

RE: Read text files only into a hash

2001-07-27 Thread Mooney Christophe-CMOONEY1
Sorry -- let me try that again ... Why don't you change your next statement to: next unless -T "$dir/$file" || /^\./; -Original Message- From: Shepard, Gregory R [mailto:[EMAIL PROTECTED]] Sent: Friday, July 27, 2001 3:47 PM To: [EMAIL PROTECTED] Subject: Read text files only into a hash

RE: Read text files only into a hash

2001-07-27 Thread Mooney Christophe-CMOONEY1
Why don't you change your next 'next unless -T "$dir/$file"'; That will skip over any non-text files, including dirs and '.' -Original Message- From: Shepard, Gregory R [mailto:[EMAIL PROTECTED]] Sent: Friday, July 27, 2001 3:47 PM To: [EMAIL PROTECTED] Subject: Read text files only into

RE: Recursive find for a file within a directory

2001-07-27 Thread Mooney Christophe-CMOONEY1
use File::Find;) -Original Message- From: Sudarsan.Raghavan [mailto:[EMAIL PROTECTED]] Sent: Friday, July 27, 2001 2:52 PM To: [EMAIL PROTECTED] Subject: Recursive find for a file within a directory Hello, I am new to perl. I want to find for a file recursively within a directory. Is t

RE: in over my head in hashes again

2001-07-27 Thread Mooney Christophe-CMOONEY1
it just takes practice. %T_QUESTION = ( d4 => { names => { "1" => { "Q" => "What is your name", "C" => ["Jerry","Ron","Tony","Jack"],

RE: lost in hashes

2001-07-27 Thread Mooney Christophe-CMOONEY1
bject: RE: lost in hashes > -Original Message----- > From: Mooney Christophe-CMOONEY1 [mailto:[EMAIL PROTECTED]] > Sent: Friday, July 27, 2001 10:21 AM > To: begginners > Subject: RE: lost in hashes > > ...Also, when you reference some field from $T{d4}, you need to >

RE: lost in hashes

2001-07-27 Thread Mooney Christophe-CMOONEY1
Not hard to do when dealing with references! ;) The problem is that you are assigning a REFERENCE TO A HASH to the HASH itself, because you're using '{}' when assigning to %T. $T{d4} has the opposite problem -- it needs to be associated with a SCALAR, ie. a REFERENCE TO A HASH. '()' is a LIS

pushing into a hash

2001-07-26 Thread Mooney Christophe-CMOONEY1
Does anyone know of a slick way to put an array into a hash? For example, given %a= ( -a => 1, -b => 2, -c => 3 ); @b=qw/-x 24 -y 25 -z 26/; Is there a nice way to merge the hash implied by @b into %a to get %a= ( -a => 1, -b => 2, -c => 3,

RE: "last until eof unless" question

2001-07-26 Thread Mooney Christophe-CMOONEY1
I don't think 'last until eof' will do what you think it's going to do. If 'eof' is true, then the loop exits, and if it's false then it exits anyway because of the 'last' statement. If you're trying to read from STDIN until you get a proper response from the user, then do something like this:

RE: __TAGS__

2001-07-26 Thread Mooney Christophe-CMOONEY1
perlDATA!! thank you! -Original Message- From: Paul Johnson [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 26, 2001 2:11 PM To: [EMAIL PROTECTED] Cc: Mooney Christophe-CMOONEY1; [EMAIL PROTECTED] Subject: Re: __TAGS__ On Thu, Jul 26, 2001 at 12:21:38PM -0400, Jeff 'japhy/Mari

RE: if in a list

2001-07-26 Thread Mooney Christophe-CMOONEY1
sorry -- that should read if you're creating the list element-by-element like this: push @mylist, $whatever; you can replace it with this: $myhash{$whatever}=1; -Original Message- From: Mooney Christophe-CMOONEY1 [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 26, 2

RE: if in a list

2001-07-26 Thread Mooney Christophe-CMOONEY1
That depends on what you're using @mylist for. If you're simply using it to check to see if an element is in the list, then use a hash instead. If you're creating the list element - b push @mylist, $whatever; you can say $myhash{$whatever}=1; Then your search-loop collapses into

RE: __TAGS__

2001-07-26 Thread Mooney Christophe-CMOONEY1
A__ blah blah blah __BEGIN__ print while ; ... ? -Original Message- From: Jeff 'japhy/Marillion' Pinyan [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 26, 2001 11:22 AM To: Mooney Christophe-CMOONEY1 Cc: [EMAIL PROTECTED] Subject: Re: __TAGS__ On Jul 26, Mooney Christophe-CMOONEY1 said:

__TAGS__

2001-07-26 Thread Mooney Christophe-CMOONEY1
Where can i find out more information about the __TAGS__ ? BTW what are they really called? Are they directives? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: code doesn't work

2001-07-26 Thread Mooney Christophe-CMOONEY1
i think you want to use 'unless' instead of 'until'. also, take advantage of $_'s magic in your print statement: print TEMP unless /ancre/; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Creating Variable Number of Arrays

2001-07-25 Thread Mooney Christophe-CMOONEY1
perldoc perllol # ;) -Original Message- From: saliminl [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 25, 2001 3:36 PM To: [EMAIL PROTECTED] Subject: Creating Variable Number of Arrays How could I create a variable number of arrays? For example, I need 20 arrays named @array1, @arr

RE: Getting values from a file

2001-07-25 Thread Mooney Christophe-CMOONEY1
That's certainly the way i would do it, but if you really want them stored in scalars instead of hashes, then you can use eval. In other words, instead of: $conf{$key} = $val you can say: eval "\$$key = q/$val/" Of course if your lines all start with '-', as you posted, then you'l

RE: chompping periods

2001-07-25 Thread Mooney Christophe-CMOONEY1
If you're sure that there's always a period at the end of the string, use 'chop $str'. If you want to be safe, use '$str=~s/\.$//'. -Original Message- From: Tyler Longren [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 25, 2001 1:29 PM To: Perl Beginners Subject: chompping periods Is t

Re: Changing to new directory.

2001-07-25 Thread Mooney Christophe-CMOONEY1
$pathname =~ s!/[^/]*$!!; -Original Message- From: Yvonne Murphy [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 25, 2001 8:04 AM To: [EMAIL PROTECTED] Subject: Changing to new directory. Hi all, Thanks for all your help with previous questions I've had. What I need to figure out now i

RE: foreach question

2001-07-24 Thread Mooney Christophe-CMOONEY1
It's talking about stuff like this: $_='a,b,c,d,e,f,g,h,i,j,k,l'; foreach $word (split /,/) { print $word; } foreach $word (grep /blah/, @somearray) { print $word; } -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: basename ?

2001-07-24 Thread Mooney Christophe-CMOONEY1
Why not just use a regex? ($basename)=$file_string=~m!([^/]+)$!; -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 24, 2001 1:44 PM To: [EMAIL PROTECTED] Subject: Re: basename ? Gary, In article <[EMAIL PROTECTED]>, Gary Stainburn wrote: >The bi

RE: Concatenation

2001-07-24 Thread Mooney Christophe-CMOONEY1
Personally, i prefer $date="$month-$year"; You could also use $date=join '-', $month, $year; but that's a little more awkward. -Original Message- From: John Edwards [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 24, 2001 9:46 AM To: 'shweta shah'; [EMAIL PROTECTED] Subject: RE: Concat

RE: regexp issues

2001-07-23 Thread Mooney Christophe-CMOONEY1
The expression you're using will match letters at the beginning of a string, but will allow for other stuff at the end. To avoid this, put a $ at the end of your regex. Also, [a-zA-Z] can be replaced with \w, which does the same thing. So, you have $name =~ /^\w+$/ -Original Message-

RE: Variable scope and definition

2001-07-20 Thread Mooney Christophe-CMOONEY1
'use strict' does not require that variables be preDEFINED, but that they be preDECLARED. The my statement accomplishes this. In fact, it doesn't matter where you DEFINE your variables. You could just as easily say: my ($user,$test);# or, alternatively use vars qw/$user $test/; and

Re: stupid question (Use strict)

2001-07-20 Thread Mooney Christophe-CMOONEY1
Although i don't necessarily consider myself one of the "smarter people here", i can give you some advice. ;) I assume your script is a CGI and you're calling it through some sort of browser ... ? Try running it independently of the browser. Most likely it will tell you about a some variables

Re: math

2001-07-20 Thread Mooney Christophe-CMOONEY1
'use integer' will force integer calculations. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

cpan installation

2001-07-20 Thread Mooney Christophe-CMOONEY1
I am running CPAN as non-root, installing modules into a wierd location. Now i need the location of a GNU library i installed, which is installed at the same wierd location. I have makepl_arg set to 'PREFIX=/wierd/dir'. What do i need to 'o conf' to make it search '/wierd/dir' for the requir

RE: Help: Starting a script with command line arguments

2001-07-19 Thread Mooney Christophe-CMOONEY1
Command line arguments are passed to the script in the array '@ARGV', not '@_'. '@_' is used for subroutines. -Original Message- From: Bob Bondi [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 19, 2001 12:51 PM To: [EMAIL PROTECTED] Subject: Help: Starting a script with command line argu

RE: Comparing Arrays

2001-07-19 Thread Mooney Christophe-CMOONEY1
"That's an excellent question," i said to myself; "i'll bet there's a module for that!" So, i looked on cpan, and it looks like Array::Compare will do the trick. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: if something equals nothing

2001-07-17 Thread Mooney Christophe-CMOONEY1
ired!\n\n"; exit; } - Original Message - From: "Mooney Christophe-CMOONEY1" <[EMAIL PROTECTED]> To: "Perl Beginners" <[EMAIL PROTECTED]> Sent: Tuesday, July 17, 2001 12:59 PM Subject: RE: if something equals nothing > Exactly like that, excep

RE: if something equals nothing

2001-07-17 Thread Mooney Christophe-CMOONEY1
Exactly like that, except using 'eq' instead of '=='. A slightly easier way, though, would be to say if (!$something) { ... blah blah ... } Since $something will return false in a boolean context (if it is empty) -Original Message- From: Tyler Longren [mailto:[EMAIL PROTECTED]] Sent: Tu

while ... continue loops

2001-07-17 Thread Mooney Christophe-CMOONEY1
I have been programming perl for quite some time, but i have never used a 'continue' block. It seems just as easy to put any code that one would normally put in a continue right into the loop itself. What is the purpose of a continue block? Is there a time where a continue might be prefered to

RE: effect of while on filehandle

2001-07-17 Thread Mooney Christophe-CMOONEY1
After the while statement on line 9 is finished, the entire file has been read and there is nothing left to read. You either close or reopen, or a better alternative might be to use the 'seek' function -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, J

RE: If value missing?

2001-07-16 Thread Mooney Christophe-CMOONEY1
An empty string will return false in a boolean context. So, unless ($date1) { $date1=$date2; } will work. Personally, i prefer: $date1 ||= $date2; It seems more 'perlish' ;) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: upper-casing the first char & hashs of hashs

2001-07-16 Thread Mooney Christophe-CMOONEY1
use ucfirst instead of uc -Original Message- From: David Gilden [mailto:[EMAIL PROTECTED]] Sent: Monday, July 16, 2001 12:28 PM To: [EMAIL PROTECTED] Subject: upper-casing the first char & hashs of hashs Hello, The following uppercase'S the whole string, when all I want is the first l

RE: Regex......some help quickly!!!!

2001-07-13 Thread Mooney Christophe-CMOONEY1
do::h!! it looks like friday is getting the best of me, too! while () { if (/^#include\s+"([^"]+)"/) {push @headers, $1} } -Original Message----- From: Mooney Christophe-CMOONEY1 [mailto:[EMAIL PROTECTED]] Sent: Friday, July 13, 2001 10:02 AM To: [EMAIL PROTECT

RE: Regex......some help quickly!!!!

2001-07-13 Thread Mooney Christophe-CMOONEY1
This will take all of the include files it finds in FILE and store them in the array @headers. while () { /^#include\s+"([^"]+)"/; push @headers, $1; } Fridays can definitely be killers! ;) -Original Message- From: Yvonne Murphy [mailto:[EMAIL PROTECTED]] Sent: Friday, J

RE: concatenate $FILENAME and .yyy

2001-07-12 Thread Mooney Christophe-CMOONEY1
make like pacman and CHOMP IT !!! ;) $FILENAME = ; chomp $FILENAME; ... -Original Message- From: Jennifer Pan [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 12, 2001 3:49 PM To: [EMAIL PROTECTED] Subject: concatenate $FILENAME and .yyy Hello all, I stdin a file name: xxx.txt and I w

RE: searching for a string of characters after another string of characters

2001-07-12 Thread Mooney Christophe-CMOONEY1
t or regex. -Original Message- From: Grossner, Tim X. (AIT) [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 12, 2001 3:28 PM To: Mooney Christophe-CMOONEY1 Subject: RE: searching for a string of characters after another string of characters No, I have already extracted the line, and i put

FW: searching for a string of characters after another string of characters

2001-07-12 Thread Mooney Christophe-CMOONEY1
If i understand you correctly, you're trying to extract exactly one line out of a file. I would do this: while () { if (/^hostname\s+(\S+)$/) # or some other regex derivative { $hostname=$1; last; } } -Original Message- From: Gross

RE: multiple entry/exit points

2001-07-12 Thread Mooney Christophe-CMOONEY1
Personally, i am very liberal with my lasts/breaks/returns/gotos. There is definitely something to be said for strictness. From a theoretical point of view, the code flows better. For example, it is easier to diagram and easier to debug. If i write code for the company i work for, i follow the

RE: open FILE problem

2001-07-12 Thread Mooney Christophe-CMOONEY1
In your die command, say: die "cannot open $LINE: $!\n"; This will give you a hint as to what's going wrong. -Original Message- From: Maxim Berlin [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 12, 2001 11:51 AM To: [EMAIL PROTECTED] Subject: Re: open FILE problem Hello Jennifer, Th

RE: Problem with associative array

2001-07-12 Thread Mooney Christophe-CMOONEY1
Ah -- of course. you need to chomp your $key when you read from STDIN. -Original Message- From: jatuporn [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 12, 2001 9:54 AM To: [EMAIL PROTECTED] Subject: Problem with associative array I try to write a program that reads a file with two fi

RE: How could I call a C-Programm

2001-07-12 Thread Mooney Christophe-CMOONEY1
You can embed your C in perl using XS. perldoc perlxstut is an excellent place to start! -Original Message- From: Akshay Arora [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 12, 2001 8:15 AM To: Jürgen Prietl Cc: [EMAIL PROTECTED] Subject: Re: How could I call a C-Programm system cal

RE: Simple question about "whiles" and files...

2001-07-11 Thread Mooney Christophe-CMOONEY1
actually, from what i understand, while () and while (<>) are special syntaxes. as soon as you add the &&, perl doesn't interpret it in the special way (ie. setting $_ to each line of the file) i usually do this: while (<>) { last if /End of list/; bla bla bla