RE: HASH PRINTING

2003-04-03 Thread David Olbersen
Eric, Use Data::Dumper, it'll do this very well if it's just for debugging purposes. Check out the documentation on cpan.org: http://search.cpan.org/author/JHI/perl-5.8.0/ext/Data/Dumper/Dumper.pm or `man Data::Dumper` if you're on a UNIX machine. --

RE: Command line argurments to perl program

2003-04-02 Thread David Olbersen
> There's also modules if it's a complicated list of command options. > > Not sure of the name exactly, just go to search.cpan.org and > take a look. That'd be Getopt::Long and Getopt::Std -- should be part of the default perl package. --

RE: Retrieving word and sourounding text

2003-04-02 Thread David Olbersen
Jim, You could start by defining what a word is, using some regex: $wordRegex = qr/... something here .../; Then build up from there: ($match) = $input =~ /($wordRegex{10}\s$word\s$wordRegex{10})/; Just an idea. -- David Olbersen iGuard Engineer 11415 West Bernardo

RE: should be simple perl cgi

2003-03-31 Thread David Olbersen
There's a quoting issue in your rsh line, unless it's been created by your email program. ------ David Olbersen iGuard Engineer 11415 West Bernardo Court San Diego, CA 92127 1-858-676-2277 x2152 > -Original Message- > From: Distribution List

RE: How to pull all attachments from an email and save as unique ids?

2003-03-28 Thread David Olbersen
David, Take a look at perlmonks.org, somebody wrote a script that does something very similar to what you're looking for. Specifically, http://www.perlmonks.com/index.pl?node_id=12287 has a good starting point! It uses the MIME tools if memory serves me... --

RE: INFO PLEASE

2003-03-26 Thread David Olbersen
Eric, On a UNIX system you could try something very slow like: find /usr /home -type f -name "*.pm" -ls You'd need to do that as root to make sure you could search all the sub-directories. With respect to available functions, read the man pages! --

RE: how can I delete a line?

2003-03-25 Thread David Olbersen
All'adr, Something like (untested) this? while( <> ) { print $_ unless( $. == 132 or $. == 133 or $. == 134 ); } -- David Olbersen iGuard Engineer 11415 West Bernardo Court San Diego, CA 92127 1-858-676-2277 x2152 > -Original Messa

RE: Simple perl program

2003-03-25 Thread David Olbersen
For the second script, read up on the CGI module. It should do a lot of what you want. You'll also need to read up on the `` (backtick) operator. ------ David Olbersen iGuard Engineer 11415 West Bernardo Court San Diego, CA 92127 1-858-676-2277 x2152 > -Origi

RE: Simple perl program

2003-03-25 Thread David Olbersen
=~ $search_string) { print "yes\n"; exit(); } } print "no\n"; The problem that you're having is that "$_ =~ $search_string" is missing something: what that =~ operator should do! Try changing that to "$_ =~ m/$search_string/&

RE: calculating length of a number

2003-03-21 Thread David Olbersen
0 and > -20.00 (s denotes a whitespace charcater). Gufran, In that case you were close. This will work: $length = scalar( split( //, $number[$i] ) ); Since split() returns an array, and any array passed to scalar() returns it's length, this should be what you want. ---

RE: calculating length of a number

2003-03-21 Thread David Olbersen
Gufranul, Why not just use sprintf()? That should be much easier than doing it yourself. perldoc -f sprintf -- David Olbersen iGuard Engineer 11415 West Bernardo Court San Diego, CA 92127 1-858-676-2277 x2152 > -Original Message- > From: Gufranul

RE: Run System Command against every line in a specific file

2003-03-21 Thread David Olbersen
omain ${dom} done That's it! ------ David Olbersen iGuard Engineer 11415 West Bernardo Court San Diego, CA 92127 1-858-676-2277 x2152 > -Original Message- > From: John B [mailto:[EMAIL PROTECTED] > Sent: Friday, March 21, 2003 9:57 AM > To: [EMAI

RE: Sending attachements with perl!

2003-03-21 Thread David Olbersen
Look at the Mail::Sendmail module. This will do more than you could ever want...well...maybe. Anyway, Tom, it'll send attachments. -- David Olbersen iGuard Engineer 11415 West Bernardo Court San Diego, CA 92127 1-858-676-2277 x2152 > -Original

RE: Removing what was matched

2003-03-18 Thread David Olbersen
the other hoops I had to jump through! I never like using the reserved variables (aside from $_) if I can help it. My script made me feel dirty for looking at the internals like that! -- David Olbersen iGuard Engineer 11415 West Bernardo Court San Diego, CA 92127

RE: Removing what was matched

2003-03-18 Thread David Olbersen
I figured it out, nevermind! If anybody already replied and it just hasn't made it through the mail servers yet, thanks anyway! -- David Olbersen iGuard Engineer 11415 West Bernardo Court San Diego, CA 92127 1-858-676-2277 x2152 > -Original Message

Removing what was matched

2003-03-18 Thread David Olbersen
latantly wrong? Is there a better way to do this? Does anybody need more information? ------ David Olbersen iGuard Engineer 11415 West Bernardo Court San Diego, CA 92127 1-858-676-2277 x2152 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: PERL OSX --- reading a local text file

2003-03-18 Thread David Olbersen
(FH,$data) || die "could not open $data $!"; while( ) { my( $k, $v ) = split /,/; $prices{$k} = $v; } close FH; for my $key (keys %prices) { print "$key = $prices{$key}\n"; } ------ David Olbersen iGuard Engineer 11415 West Bernardo Cou

RE: Evaluating parts of a string

2003-03-18 Thread David Olbersen
Ex: $fileName = "File"; > $var = '1>>$fileName'; Do you just mean something like: $filename = "File"; $var = "1>>$fileName"; ? Notice the double quotes (which means "put the value of $fileName") on the second line.

RE: help with whois code

2003-03-17 Thread David Olbersen
Quoting issues, I think you meant: perl -MCarp -e "croak('croaked')" ------ David Olbersen iGuard Engineer 11415 West Bernardo Court San Diego, CA 92127 1-858-676-2277 x2152 > -Original Message- > From: Brett W. McCoy [mailto:[EMAIL

RE: pb of listing and renaming files

2003-03-17 Thread David Olbersen
Change your first line to #!/usr/bin/perl insetead of #!/usr/bin/perl (take out the leading space) That's causing your shell to think it's a bash script, instead of perl, hence the errors. ------ David Olbersen iGuard Engineer 11415 West Bernardo Court San

RE: Slightly OT

2003-03-14 Thread David Olbersen
Outstanding, exactly what I was looking for. Thank you very much! -- David Olbersen iGuard Engineer 11415 West Bernardo Court San Diego, CA 92127 1-858-676-2277 x2152 > -Original Message- > From: R. Joseph Newton [mailto:[EMAIL PROTECTED] > Sen

Slightly OT

2003-03-14 Thread David Olbersen
ase64 encoded version of a 1k file still take up 1k? -- David Olbersen iGuard Engineer 11415 West Bernardo Court San Diego, CA 92127 1-858-676-2277 x2152 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: apache error

2003-03-14 Thread David Olbersen
ith your script. -- David Olbersen iGuard Engineer 11415 West Bernardo Court San Diego, CA 92127 1-858-676-2277 x2152 > -Original Message- > From: Francesco del Vecchio [mailto:[EMAIL PROTECTED] > Sent: Friday, March 14, 2003 8:16 AM > To: [EMAIL PROTECTED] > Subject

RE: File Transfer

2003-03-13 Thread David Olbersen
Like with Net::FTP? -- David Olbersen iGuard Engineer 11415 West Bernardo Court San Diego, CA 92127 1-858-676-2277 x2152 > -Original Message- > From: Luinrandir Hernsen [mailto:[EMAIL PROTECTED] > Sent: Thursday, March 13, 2003 7:13 AM > To: [EMA

RE: Excel spreadsheet: creating charts

2003-03-12 Thread David Olbersen
Rich, I know for a fact that you can generate any of the formulas and data you might need with Spreadsheet::WriteExcel -- I'm not so sure about the graphs though. I think those would still need to be done manually. -- David Olbersen iGuard Engineer 11415 West Ber

RE: MIME::Decode Help

2003-03-12 Thread David Olbersen
Peter, Outstanding! Thank you VERY much! *sniff* I love CPAN *sniff* -- David Olbersen iGuard Engineer 11415 West Bernardo Court San Diego, CA 92127 1-858-676-2277 x2152 > -Original Message- > From: Peter Scott [mailto:[EMAIL PROTECTED] > Sent:

RE: PipeDelimited Input / Three File Output (Positional Characters)

2003-03-11 Thread David Olbersen
Since you haven't provided any code, I can't either. Read up on 'split' though, that should help quite a bit. ------ David Olbersen iGuard Engineer 11415 West Bernardo Court San Diego, CA 92127 1-858-676-2277 x2152 > -Original Message---

MIME::Decode Help

2003-03-11 Thread David Olbersen
n't found anything like that. Is this just a bad idea that can't be done? -- David Olbersen iGuard Engineer 11415 West Bernardo Court San Diego, CA 92127 1-858-676-2277 x2152 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: return a regex substitution in one line

2003-03-11 Thread David Olbersen
Dan, return ($_[0] =~ s/^\<|\>$|\n|\r|\s$//g)[0]; ? -- David Olbersen iGuard Engineer 11415 West Bernardo Court San Diego, CA 92127 1-858-676-2277 x2152 > -Original Message- > From: Dan Muey [mailto:[EMAIL PROTECTED] > Sent: Tuesday, March 1

RE: return a regex substitution in one line

2003-03-11 Thread David Olbersen
ean by "on one line?" do you mean without \n or \r's anywhere in the string? ------ David Olbersen iGuard Engineer 11415 West Bernardo Court San Diego, CA 92127 1-858-676-2277 x2152 > -Original Message- > From: Dan Muey [mailto:[EMAIL PROTECTED

RE: Search and Replace

2003-03-11 Thread David Olbersen
%domains, and anytime $domains{$key} == 1, print it out! -- David Olbersen iGuard Engineer 11415 West Bernardo Court San Diego, CA 92127 1-858-676-2277 x2152 > -Original Message- > From: Jay Kidd [mailto:[EMAIL PROTECTED] > Sent: Tuesday, March 11, 20

Re: map question

2001-06-08 Thread David Olbersen
On Fri, 8 Jun 2001 [EMAIL PROTECTED] wrote: > Gurus, > perldoc -f map says, > > >- > map BLOCK LIST > map EXPR,LIST > Evaluates the BLOCK or EXPR for each ele

Re: split - maxSplit

2001-05-31 Thread David Olbersen
On Thu, 31 May 2001, Brian Shoemaker wrote: > I've never used the maxSplit parameter in my scripts. By not using the > maxSplit parameter am I slowing things down? As per `perldoc -f split` If LIMIT is specified and positive, splits into no more than that many fields (though it may split into f

Good job everybody!

2001-05-31 Thread David Olbersen
I'd just like to say that I'm really impressed with how quickly you can get a question answered on this list. Keep up the good work everybody! -- Dave

Re: writing to a text file ... sorry

2001-05-31 Thread David Olbersen
On Thu, 31 May 2001, Jeff Pinyan wrote: > Mortal::Kombat (by me) allows you to say: > > flawless victory; # to end a program successfully > > and > > fatality "you have been thoroughly thrashed"; # like die() Oh japhy, you rule. `perl -MCPAN -e shell;` here I come! -- Dave

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