Re: print output from HTML::Parser

2003-03-08 Thread Scott R. Godin
Steven Massey wrote: > Hi all > > perl script below works, and does what I hoped it would, but I don't seem > to understand how to get it to print out the result to a new file as > opposed to stdout. > > Thanks for any help > > #!/usr/bin/perl -w > use strict; > use HTML::Parser; > > open(OUT,

Re: Test for empty list

2003-03-08 Thread Scott R. Godin
> #!/usr/bin/perl -w > > use strict; > > my @array = ('', 0, "", 1); > > my $hasTruth; > foreach (@array) { > if ($_ ){ > $hasTruth = "yezzindeedydo!"; > last; > } > } > if ($hasTruth) {print "$hasTruth has truth\n";} > else {print "Does not have truth";} > > > Joseph #!/usr/bin/

Re: Help! What am I doing wrong?

2003-03-08 Thread Scott R. Godin
>> foreach $AddrToCheck (@AddrArray) { > > Beware that at this point you may well still have newlines > at the end of each record. Make sure you have 'chomp'ed > each record, otherwise it won't validate as an email > address. > > Also, the easiest way to put all the lines from a file > into an a

Re: special caracters in variables in patternmatching

2003-03-08 Thread Scott R. Godin
Rob Dixon wrote: >> > I'm having problemsdue (i suppose) to the special chars in the >> > $var1 string the s/// don't match anything. >> > What can I do to? >> >> s{\Q$var1\E}{$var2} is usually what you want, except that may very >> well 'quote' out the $ in $var. > > I guess you mean $var2?

Re: tnx to Scott Godin

2003-03-08 Thread Scott R. Godin
w Subject: line. ;-) does this make any sense or should I e-mail you a screenshot of what I mean so you can *see* it ? :) > Second, Scott...you are great!...I solved my problem with your suggestion. > Thank a lot...this is a great mailing list!!! Wheee, glad I was able to help :) -- To uns

Re: Simple Regex Problem.

2003-03-08 Thread Scott R. Godin
Rob Dixon wrote: >> you want to know what's failing, right? > > Wrong. John was just pointing out that $1 would remain > defined from a previous regex match in my previous post. > This would mean that there was no way of telling in > retrospect if the match had suceeded. The context of > the prob

Re: special caracters in variables in patternmatching

2003-03-07 Thread Scott R. Godin
Francesco Del Vecchio wrote: > suppose this: > == > $string 'I saw Roger and I said :roger? what the @*$!'; > > $var1 = "roger? what the @*$!"; > $var2 = "Hi roger...nice to meet you"; > > $string=~ s/$var1/$var2/; > === >

RE: cpan problems

2003-03-07 Thread Scott R. Godin
Dan Muey wrote: >> ([EMAIL PROTECTED](/home/dmuey):101)# perl -MCPAN -e shell; >> >> cpan shell -- CPAN exploration and modules installation >> (v1.48) ReadLine support available (try ``install Bundle::CPAN'') >> >> cpan> relaod index >> Unknown command 'relaod'. Type ? for help. >> >> cpan> r

RE: cpan problems

2003-03-07 Thread Scott R. Godin
Dan Muey wrote: > I've also had trouble using CPAN and so I did the reload index > mentioned in this thread and that seemed to go thought but I s > til can't get it to go. > > It's the same error everytime ( diff module names of course ) :: could not > open y... There is a direct > perl -MCAPN =e

Re: Module listing

2003-03-07 Thread Scott R. Godin
Rob wrote: > Is there a perl command to list installed modules? #!/usr/bin/perl use warnings; use strict; foreach my $mod ( sort CPAN::Shell->expand("Module","/./") ) { next unless $mod->inst_file; print $mod->id; print ": ", $mod->inst_version if $mod->inst_version; pri

Re: Simple Regex Problem.

2003-03-07 Thread Scott R. Godin
Rob Dixon wrote: > Paul Johnson wrote: >> Rob Dixon said: >> >> > $data =~ m/ <([^>]*)> /x; >> > my $newdata = $1; >> >> And if the match fails? > > Well I think it's likely that you'd want to do: > > $data =~ m/ <([^>]*)> /x or die "Malformed data"; > > or at least: > > $data

Re: Simple Regex Problem.

2003-03-07 Thread Scott R. Godin
David wrote: > Gregg R . Allen wrote: > >> It was close but what I got is : "JohnDoe.com" Instead of >> "[EMAIL PROTECTED]". >> >> I think it has something to do with escaping the "@" sign. I've been >> experimenting, but without much luck. >> > > that's because Perl thinks @Someplace is an

Re: Commands inside a reg-ex substitution problems

2003-03-06 Thread Scott R. Godin
John W. Krahn wrote: >> ($_pattern, $_start) = (shift, shift); >> print "Starting search at: $_start\n"; >> >> chdir "$_start"; > > Useless use of quotes. You should verify that chdir worked. > > unless ( chdir $_start ) { > print STDERR "Cannot chdir to $_start: $!"; > exit 1; > }

RE: How to look into every subdirectory

2003-03-05 Thread Scott, Deborah
I need to make an HTML page that lists all files and directories and then links to them. The following script, with a subroutine, looks like what I need. I should just need to add some html tags to the Print statements. Does that sound right to you all? Or do you have better suggestions? (I'm a r

RE: Simple script requires simple soulution

2003-03-05 Thread Scott R. Godin
Aimal Pashtoonmal wrote: > Hello, > > I have the script below giving the folowing error meesages. > > =>Useless use of string in void context at > extract_data_from_IPR_HMM_libs.pl > line 12. > =>Useless use of a constant in void context at > extract_data_from_IPR_HMM_libs.pl lin

Re: Newby first little script. (Lots of errors and wrong ways of doing things)

2003-03-04 Thread Scott R. Godin
George P. wrote: [snip] >> > I noticed that you've said >> > "open () or die()" >> > and >> > "close() or die()" >> > >> > If open fails, the program will kill itself, so >> > the close function will never be called. >> > Therefore there is no need to say "close() or die()" >> >> I don't follow t

Re: Newby first little script. (Lots of errors and wrong ways of doing things)

2003-03-04 Thread Scott R. Godin
George P. wrote: > I noticed that you've said > "open () or die()" > and > "close() or die()" > > If open fails, the program will kill itself, so the close function > will never be called. > Therefore there is no need to say "close() or die()" not true. > You've done it thrice in this email, so

Re: Blacklist an array

2003-03-04 Thread Scott R. Godin
John W. Krahn wrote: > "Scott R. Godin" wrote: >> >> use Quantum::Superpositions; >> >> my @notinarray1 = >> map { $_ } > ^^ > >> eigenstates( any(@Array2) ne

Re: Newby first little script. (Lots of errors and wrong ways of doing things)

2003-03-03 Thread Scott R. Godin
Johann Snyman wrote: > Hello there, > > I am a newby trying to learn pearl. I wrote my first little script, > and I would love to se where I could have done things better (in a > more proffesional way). > > Feedback would be appreciated! Well you are off to a good start with lines two and three

Re: How do I recursively look in every directory

2003-03-03 Thread Scott R. Godin
Randal L. Schwartz wrote: [snip] > John> Use the File::Find module. > > John> perldoc File::Find > > I have many examples of this module (including a two-parter that > recently appeared in Linux Magazine) on my site. Google > for > > site:stonehenge.com "File::Find" > > for the examples.

Re: Blacklist an array

2003-03-03 Thread Scott R. Godin
Philipp Gruemmer wrote: > A small correction (thanks to Carlos Diaz) > >> Isn't shis code supposed to read the first line of the @input array then >> read the first line of the @blacklist array, see if the $line contains a >> $cond and then ptrint "true". After that it should carry on with the >>

Re: unsubscribing.... [OT]

2003-03-03 Thread Scott R. Godin
Todd W wrote: > > "Paul" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> This is too fun, and so occupies far to much of what should otherwise >> be a productive workday. >> >> Alas, I must unsubscribe again. >> >> *sigh* >> >> Later, all. :) >> > > You can point your news reade

Re: Get list of available modules?

2003-03-03 Thread Scott R. Godin
Dave K wrote: > >> Greetings! > Hello >> >> I'm trying to do some Perl for a non-profit organization. The computer >> administrator doesn't know very much about Perl or about the server. >> If I were to ask him what Perl modules were available, he'd probably >> just have to call somebody else an

Re: jumping to the end of a loop

2003-03-02 Thread Scott Taylor
print "$dbname, $dbemail, $dbpwd, $dbusrname\n"; # or whatever you want to do with these vars. } $dbh->disconnect( ); } else { print "Need Drivers for MySQL!\n"; } - Hope this helps you get to where you want to be. Scott. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: jumping to the end of a loop

2003-03-02 Thread Scott Taylor
At 09:42 PM 3/1/2003 +, Anadi Taylor wrote: Thank you - this helps a lot - its good to also know that the SQL problem I was having is a mySql thing - not me ! That may be true, I not too sure though. You never did disclose how you are using Perl to build the SQL command and send it to th

DBI install problems

2003-02-28 Thread Scott Taylor
ad installation problems: RPC::PlServer DBI Any one know what's going on, or if there is a better place for me to ask this, or a FAq that I have over looked. I'm having a very hard time tracking this down, and suggestions would be great. Thanks. Scott. -- To unsubscribe, e-ma

Perl version of xcopy on Win32?

2003-02-28 Thread Scott Ellis
Hi, I've searched far and wide for this with no success. Is there a win32 perl module with the same functionality as the win32 'xcopy' command, i.e. that will recursively copy a directory structure from one place to another? Thanks, Scott -- To unsubscribe, e-mail: [EMAIL

RE: Out of memory while finding duplicate rows

2003-02-23 Thread Peter Scott
on the database table (like all good tables should have anyway) and you're done. (Or if the "duplicate" criterion involves some other column, put a UNIQUE constraint on it.) Then all inserts of duplicate records will fail automatically. Just make sure that RaiseError

How to display dir contents on web page?

2003-02-19 Thread Scott, Deborah
Does anyone know where I can get a script that looks into the contents of a directory and outputs the contents of the directory into a list that is displayed on an HTML page? (Also, the names should contain hyperlinks to those contents.) Or, how would I do this? Thanks! Deborah

Can't load module DBD::Interbase

2003-02-18 Thread Scott Taylor
start? I'm thinking maybe there is a file locked or socket or some such, but I just don't know where or what. I don't think this error message is giving the truth, according to the lines near 200 in Dynaloader.pm. FirebirdSS is working just fine, and Perl seams to work as long as

RE: help with HTTP::Request for POST

2003-02-18 Thread Scott Lutz
I think I am going to move this over to the CGI list! :o) Scott Lutz Pacific Online Support Phone: 604.638.6010 Fax: 604.638.6020 Toll Free: 1.877.503.9870 http://www.pacificonline.com -Original Message- From: Scott Lutz Sent: February 17, 2003 4:58 PM To: [EMAIL PROTECTED] Subject

help with HTTP::Request for POST

2003-02-18 Thread Scott Lutz
7;https://domains/perl/reg_system.cgi', [ domain => $q->param("domain"), affiliate_id => $q->param("affiliate_id"), action => $q->param("lookup"), ]); } Please do not hesitate to contact me directly i

RE: perl4 vs. perl5

2003-02-05 Thread Peter Scott
Check CPAN. Quite probably some operations that your scripts spend hundreds of lines performing can be replaced with a single call to a module. Point out the benefit of using code maintained by someone else; use the phrase "make or buy". Slap all that into a PowerPoint presentation and you

RE: including subroutines from other files ...

2003-02-04 Thread Scott, Joshua
This is how I've done this for my scripts: do "/filename"; Then I just call the sub in the normal method. -Original Message- From: Jamie Risk [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 04, 2003 2:11 PM To: [EMAIL PROTECTED] Subject: including subroutines from other files ...

Re: Sorting Hash of arrays by how many elements

2003-02-03 Thread Peter Scott
undef - look up autovivification). <=> puts its arguments in scalar context, hence we are comparing number of elements in each array, and since $b is on the left hand side we get descending order. I'll leave the rest to your further reading. -- Peter Scott http://www.perldebugged.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Graphing Data

2003-01-31 Thread Scott, Joshua
nce I decide on where to output, I'd like to write a script that will graph the results of this command. If you've done anything like this, I'd greatly appreciate the assistance. Thank you, Joshua Scott Security Systems Analyst

MS Active Directory

2003-01-30 Thread Scott, Joshua
7;d really like to avoid having to require a Windows machine just for this. Am I better off just doing this from a Windows box? Thanks you in advance for any assistance. Joshua Scott Security Systems Analyst, CISSP 62

RE: Email function question

2003-01-28 Thread Scott, Deborah
>To make this work, you have to specify the list variable ($i): >$file = "/suidbin/sendmail -t"; >$var = "the_file.txt"; > >open(FILE, "$var") || die "cant open text file"; >@file = ; >close(FILE); >foreach $i (@addressee) { > open(MAIL, "|$file $addressee") || die "can't open sendmail"; >

RE: Email function question

2003-01-27 Thread Scott, Deborah
> >if your file is a text file > >#! /usr/bin/perl -w > >$file = "/suidbin/sendmail -t"; >$var = "the_file.txt"; > >open(FILE, "$var") || die "cant open text file"; >@file = ; >close(FILE); > >##open pipe to sendmail >open(MAIL, "|$file") || die "cant open sendmail"; >print MAIL "To: blah\@devn

Re: Deleting last 12 lines of a large file

2003-01-26 Thread Peter Scott
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Rob Dixon) writes: >Peter Scott wrote: >> Anyway, here's a way that doesn't require keeping more than 12 lines >> in memory and doesn't require reading twice: >> >> $^I = ".bak"; >

Re: Deleting last 12 lines of a large file

2003-01-26 Thread Peter Scott
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (R. Joseph Newton) writes: >Peter Scott wrote: > >> I$^I = ".bak"; >> my @queue; > >Hmmm. > >push (@queue, $somevar); >somevar = pop(@queue); > >...and double-H! > >Could it be that

Re: Deleting last 12 lines of a large file

2003-01-26 Thread Peter Scott
e (<>) { push @queue, $_; print shift @queue if @queue > 12; } -- Peter Scott http://www.perldebugged.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Email function question

2003-01-24 Thread Scott, Deborah
I asked this before, but I probably made the question too long and confusing to follow. How do I send an email using perl? The path for the sendmail program is: h:/blah/blah/SENDMAIL/sendmail.exe I want it to open the contents of a particular file. Then send the contents of the file as a

RE: used sendmail to send an attachment

2003-01-24 Thread Scott, Deborah
Wow, this is kinda freaky Usually my perl email goes directly into a "perl" mail directory, but your two emails just popped into my work-inbox. I was just now starting to test a script for sending mail that works perfectly on a unix machine, but isn't working correctly on an NT server. That's

My Mistake

2003-01-22 Thread Scott Barnett
Hi Again, Never mind I was looking at the Perl Dev Kit, which is an evaluation. Scott Barnett Home Care Medical - Technical Support Specialist 1-800-369-6939 1-262-786-9870 ext.214 E-Mail [EMAIL PROTECTED] Confidentiality Notice: This e-mail message, including any attachments, is for the sole

Getting Perl

2003-01-22 Thread Scott Barnett
Hi All, Is there a free version of Perl that I can get that will run on Win98 machine. I want to start learning Perl. checked ActiveState but it looks like that is only a 15 or 30 day evaluation, I may be wrong? Thanks, Scott Barnett Home Care Medical - Technical Support Specialist 1-800-369

RE: Splitting a variable

2003-01-16 Thread Scott, Joshua
I figured regular expressions where the solution but I'm just starting to learn how to use regular expressions. Also, only the first field always has a comma between the quotes. The other fields are not consistent. Joshua Scott Security Systems Analyst, CISSP 626-568-7024 -Ori

Splitting a variable

2003-01-16 Thread Scott, Joshua
; The problem is with the fields that contain the commas between the quotes. It's splitting the fields at each of these fields as well and I'd like to know how to avoid that. Any help is greatly appreciated

RE: Perl Subroutines

2003-01-14 Thread Scott, Joshua
and voila. Thanks to everyone who posted comments. Joshua Scott Security Systems Analyst, CISSP -Original Message- From: Jenda Krynicky [mailto:[EMAIL PROTECTED]] Sent: Friday, January 10, 2003 7:04 AM To: [EMAIL PROTECTED] Subject: RE: Perl Subroutines From: "Scott, Joshua&quo

Re: Re[2]: Titlecase

2003-01-13 Thread Peter Scott
;> > to titlecase. >Try >$title =~ s/\b(\w+)\b/\u\L$1/g; The \b are redundant in that regex. -- Peter Scott http://www.perldebugged.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Epoch midnight

2003-01-10 Thread Scott, Deborah
I thought I understood the answer, but I need more details. What exactly would I enter if I want a program to find the epoch time for midnight each night? I know how to find "current" time and date in both "human" time and epoch time. I want to generate a report that displays the events that are

RE: Perl Subroutines

2003-01-09 Thread Scott, Joshua
Wow, that was really easy! Thank you very much for your help!! Joshua Scott Security Systems Analyst, CISSP 626-568-7024 -Original Message- From: Rob Dixon [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 09, 2003 5:11 PM To: [EMAIL PROTECTED] Subject: Re: Perl Subroutines Hi

RE: Perl Subroutines

2003-01-09 Thread Scott, Joshua
le without modifying the subs code. Joshua Scott Security Systems Analyst, CISSP 626-568-7024 -Original Message----- From: Scott, Joshua Sent: Thursday, January 09, 2003 4:07 PM To: [EMAIL PROTECTED] Subject: Perl Subroutines I've created a group of Perl subroutines to handle t

Perl Subroutines

2003-01-09 Thread Scott, Joshua
}; I call the sub from webpages the standard way. I sure hope I explained this clearly. I'm still getting used to Perl. Thank you for any help you can provide! Joshua Scott == NOTICE - This communication may

RE: Help with end-time start-time sorting problem

2003-01-09 Thread Scott, Deborah
Yes, I think so. THANKS! This is a great fantastic group. Glad I found it. >Have got what you need yet? >Wags ;) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Help with end-time start-time sorting problem

2003-01-09 Thread Scott, Deborah
Here's the txt file. Thanks! -Original Message- From: Wagner, David --- Senior Programmer Analyst --- WGO [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 09, 2003 2:32 PM To: Scott, Deborah; [EMAIL PROTECTED] Subject: RE: Help with end-time start-time sorting problem

Help with end-time start-time sorting problem

2003-01-09 Thread Scott, Deborah
I have a txt data file that has several fields. Two of the fields are start time and end time (listed in epoch time). I need to write a perl program that finds (and prints) events that occur between midnight "last night" and "midnight tonight." First problem: The date for midnight "last night" a

Re: Debugging Problem: Phantom line numbers!

2003-01-07 Thread Peter Scott
At 06:16 PM 1/7/03 -0600, Christopher D. Lewis wrote: >On Tuesday, January 7, 2003, at 11:19 AM, Peter Scott wrote: > >>[responding to replacement of sub displayResults with {print __LINE__ >>. " sub displayResults";}] >>That needs to be __LINE__, not __line__

Re: Debugging Problem: Phantom line numbers!

2003-01-07 Thread Peter Scott
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Christopher D . Lewis) writes: > >On Tuesday, January 7, 2003, at 10:31 AM, Peter Scott wrote: > >> [EMAIL PROTECTED] (Christopher D . Lewis) writes: >>> My problem is that the errors Perl coughs up end with: &g

Re: Debugging Problem: Phantom line numbers!

2003-01-07 Thread Peter Scott
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Christopher D . Lewis) writes: > >On Tuesday, January 7, 2003, at 10:31 AM, Peter Scott wrote: > >> >> What line numbers do your text editors say the above statements are >> actually on? >>> the erro

Re: Debugging Problem: Phantom line numbers!

2003-01-07 Thread Peter Scott
count ends at 304. > >Ideas? What line numbers do your text editors say the above statements are actually on? Sprinkle a few print __LINE__; statements around and see what Perl thinks the line numbers are. This program hasn't been near a Windoze system, has it? Check

Can't make Storable

2003-01-07 Thread Scott Lutz
I need some pointers as to why the Storable module won't compile on my Intel/Debian machine. I am not sure if recompiling DynaLoader would help, so if any one has any ideas, I would be most grateful. This has failed using both CPAN and using the older 2.05 version I have. Here is the complete ou

Re: Need help converting/sorting date field from within a Perl scrip t

2002-12-26 Thread Peter Scott
use. I haven't actually done sorting in queries there, but you'd use setSort() to define the sorting order and then query() to get the results in that order. N.B. For a "new" Perl user, this is pretty advanced stuff. *Make sure* you get some instruction or educatio

Re: Resolving DNS/IP

2002-12-24 Thread Peter Scott
le '@x = gethostbyname("cnn.com"); \ print inet_ntoa($_) for @x[4..$#x]' 64.236.24.20 64.236.24.28 64.236.16.20 64.236.16.52 64.236.16.84 64.236.16.116 64.236.24.4 64.236.24.12 -- Peter Scott

Re: postcode regex problem - again.

2002-12-18 Thread Peter Scott
other than \n greedily (this is superfluous), plus 1 or 2 non-digits, 1 or 2 digits, 0 or 1 white space characters, a digit, and 2 non-digits, followed by 0 or more white space characters (also superfluous). Ponder the meaning of "non-" for a bit and then chew on this: /([A-Z

Installed Modules don't run Properly

2002-12-16 Thread Scott Lutz
chine . . . ;o| Here is the error that gets returned when trying to run the module : perl: relocation error: /usr/lib/perl5/auto/DBD/mysql/mysql.so: undefined symbol: perl_get_sv Any thoughts? thanks in advance! scott -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e

Re: Mail::Audit + STDOUT

2002-11-26 Thread Peter Scott
Oops, Meng pointed out that the print method is inherited from Mail::Internet where of course it is documented. I suggested instead that the inheritance be documented a bit more clearly. -- Peter Scott http://www.perldebugged.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

Re: Mail::Audit + STDOUT

2002-11-26 Thread Peter Scott
thod, "print". So you can do $mail->print(\*STDOUT); Of course you shouldn't rely on undocumented methods being around forever, but in this case I think it was left out by accident; I'll copy the author. -- Peter Scott http://www.perldebugged.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: How to find list of variables and sub routines loaded, dynamically.

2002-11-22 Thread Peter Scott
7;t visible in %main::. You need the PadWalker module from CPAN to list them. -- Peter Scott http://www.perldebugged.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Use of Search::Dict

2002-11-18 Thread Peter Scott
. How should the input file be opened (as a text file or binary)? Text. >2. Do all lines have to have the same length? No. >3. Once I get the return line position (if I get that far), how do I retrieve the >line? -- Peter Scott http://www.perldebugged.com -- To unsubscribe,

Re: [OT] Farewell for now..

2002-11-11 Thread Peter Scott
;to rely solely on my skillz and books. E-mail me direct if you have an idea, >as of this e-mail I am unsubscribed. > >(no I don't want to do the digest because it's not as fun!) Use the NNTP interface via news.perl.org. I switched all my perl.org mailing lists to that se

RE: ?????????:failure notice

2002-11-09 Thread Scott Lutz
Change that line from : use Win32:ODBC; to : use Win32::ODBC; (note the double colon) -Original Message- From: Angel Iliev Kafazov [mailto:angel.kafazov@;mail.bg] Sent: November 9, 2002 10:38 AM To: [EMAIL PROTECTED] Subject: ?:failure notice Hi, I am trying to write a scipt wh

RE: removing modules

2002-11-08 Thread Scott Lutz
Never mind. A small case of the Mondays :o) scott lutz -Original Message- From: Scott Lutz Sent: November 8, 2002 10:37 AM To: Beginners (E-mail) Subject: removing modules Does anyone have experience with removing modules installed using CPAN? A Debian machine seg faults everytime I

removing modules

2002-11-08 Thread Scott Lutz
Does anyone have experience with removing modules installed using CPAN? A Debian machine seg faults everytime I try to install a module, and so I want to try to remove the Compress::Zlib module. Thanks for the help! scott lutz -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

RE: Declaring a Hash

2002-11-07 Thread Peter Scott
PM >To: [EMAIL PROTECTED] >Subject: RE: Declaring a Hash > > >In article ><[EMAIL PROTECTED]>, > [EMAIL PROTECTED] (Colin Johnstone) writes: >>Here is how you declare hash. >> >>my %hash = (); > >The "= ()" is entirely redundant. Just "

Re: Pattern matching - external website

2002-11-07 Thread Peter Scott
the letters m,y,s,i,t,e,c,o,m are redundant with the \w. You need to understand character classes. -- Peter Scott http://www.perldebugged.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Declaring a Hash

2002-11-07 Thread Peter Scott
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Colin Johnstone) writes: >Here is how you declare hash. > >my %hash = (); The "= ()" is entirely redundant. Just "my %hash" does exactly the same thing. -- Peter Scott http://www.perldebugged.com -- To un

Re: die not working

2002-11-07 Thread Peter Scott
l" 3rd ed (Schwartz & Phoenix) and at least one book about CGI programming (e.g., "CGI Programming with Perl", Meltzer & Michalski). -- Peter Scott http://www.perldebugged.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: die not working

2002-11-06 Thread Scott, Joshua
Change your open line to read as follows: open (IN,"$file1") or die("Cannot Open: $!"); Joshua Scott Security Systems Analyst, CISSP 626-568-7024 -Original Message- From: Johnstone, Colin [mailto:Colin.Johnstone@;det.nsw.edu.au] Sent: Wednesday, November 06, 2002

Sorting a hash with keys generated on the fly

2002-11-05 Thread Scott, Joshua
ve gotten wonderful help from this group. Don't know what I'd do without you! Joshua Scott Security Systems Analyst, CISSP 626-568-7024 == NOTICE - This communication may contain confidential and privi

RE: Mail::Sendmail Module

2002-11-05 Thread Scott, Joshua
How exactly could I accomplish combining the values? Forgive me, I'm still a little wet behind the ears using Perl. Joshua Scott Security Systems Analyst, CISSP 626-568-7024 -Original Message- From: LRMK [mailto:lrmk@;rakhitha.cjb.net] Sent: Tuesday, November 05, 2002 9:18

RE: Help with Hash values and variable interpolation

2002-11-04 Thread Scott, Joshua
I figured it out already! I ran a replace on the dst_port and replaced it with a whitespace which threw off the count. I've modified it to delete the whitespace and all works perfect. Joshua Scott Security Systems Analyst, CISSP 626-568-7024 -Original Message- From: Scott, J

Help with Hash values and variable interpolation

2002-11-04 Thread Scott, Joshua
Hello all, I've got a file which contains ports and hostnames. I'd like to count the number of instances that each item occurs in my file. I'm having a difficult time with this. This is my script: Basically I'm splitting the first line a few times to get the data I need. What am I doing wro

Re: V Unpretty code

2002-11-04 Thread Peter Scott
print DFILE; next OUTER }; } s/A/?/; } If it weren't for the fact that sometimes you increment two variables I'd have used a hash for the increments instead. Might still be better to have a hash instead of all those little variables. -- Peter Scott http://www.perldebugged.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: SQL table updates

2002-10-31 Thread Scott Taylor
At 08:06 AM 10/31/02, you wrote: One way. ? Of the 3 fields which is unique field..I'll assume FuelCrd.. after ..print "$FuelCrd, $TrkID, $FuelCmp\n"; .insert this my ($check) = $dbh->selectrow_array ("SELECT fuelCrd FROM cardlock WHERE fuelCrd = ?", undef,$F

SQL table updates

2002-10-31 Thread Scott Taylor
d first record in table where id = 'blah' if not available record then create record. assign values to record. Cheers. Scott. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Mail Problem

2002-10-31 Thread Scott Lutz
Dan, you might want to post the line in which you call config.cgi. Are you using 'require'? cheers, scott -Original Message- From: Palm Optins [mailto:bootscat@;bellsouth.net] Sent: Wednesday, October 30, 2002 2:30 PM To: [EMAIL PROTECTED] Subject: Mail Problem Importance: Hi

Re: c shell commands in perl script

2002-10-30 Thread Peter Scott
script in bash and c >> shell depending on an argument. >>since my default shell is bash the commands i give work. >>but for c shell the set of commands don't execute. >>i mean the subsequent commands after i go to c shell (system >> "csh";) doesn't work. >> >>any suggestions??? >>thanks u -- Peter Scott http://www.perldebugged.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: The 'use' pragma vs. Foo::bar syntax (Correction)

2002-10-29 Thread Peter Scott
y /tmp]$ cat Bar.pm package Bar; require Exporter; use strict; @Bar::ISA = qw(Exporter); @Bar::EXPORT_OK = qw(bar); sub bar { print "$_[0]: Bar::bar\n" } 1; [peter@tweety /tmp]$ ./prog >From main: Foo::foo >From Foo::foo: Bar::bar >From main: Bar::bar [peter@tweety /tmp]$ -- Peter Scott http://www.perldebugged.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: The 'use' pragma vs. Foo::bar syntax

2002-10-28 Thread Peter Scott
w(testvolts testamps testohms); > >You don't need to qualify these variables with package names. You do if you've got a use strict higher up. I know the posting didn't have that, but it's a good idea nonetheless. Although I'd be more inclined to say

RE: using 'map' with mixture of scalars and array refs...

2002-10-23 Thread Peter Scott
t;@values = (12398712984, 19286192879); >>$hashofarrays{'family'}{'arrayref'} = \@values; >>$hashofarrays{'family'}{'scalar'} = 12938712938; >@combined = map { @{$_->{arrayref}||[]}, exists $_->{scalar} ? $_->{scalar} >: () } > values %hashofarrays; -- Peter Scott http://www.perldebugged.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Long Time Script Suddenly Failing

2002-10-23 Thread Peter Scott
url\n" if ($VERBOSE); print "$resstring\n" if ($VERBOSE); # Check the outcome of the response if ($res->is_success) { my $content = $res->content; $content =~ m/.* ([0-9]+)<\/b>.*/s; my $traffic = $1;

Re: using 'map' with mixture of scalars and array refs...

2002-10-22 Thread Peter Scott
do both at once? >I'm guess I could do it using a conditional that checks the hash value and >executes one of the above statements as I iterate through the hash keys, but >if theres a better way... @combined = map { @{$_->{arrayref}||[]}, exists $_->{scalar} ? $_->{scalar} : () } values %hashofarrays; -- Peter Scott http://www.perldebugged.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Long Time Script Suddenly Failing

2002-10-22 Thread Peter Scott
I predict that if you insert BEGIN { $|=1; print "Content-type: text/plain\n\n" } after the #! line of that script, you will see something illuminating when you next visit it through a browser. If you still get a 500, then most likely the file permissions are wrong. -- P

Re: OOP Mailing lists

2002-10-22 Thread Peter Scott
There is an on-line forum for people who have read Damian Conway's book, at http://www.manning.com/getpage.html?project=conway&filename=forum.html And anyone who is serious about OO Perl will read that book. -- Peter Scott http://www.perldebugged.com -- To unsubscribe, e-mai

Re: How do I know if a perl module is installed?

2002-10-21 Thread Peter Scott
% perl -MSome::Module -e 0 Absence of output indicates the module is installed. -- Peter Scott http://www.perldebugged.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Nice

2002-10-20 Thread Peter Scott
ss.pm Only you'll be using the priority, not the niceness. -- Peter Scott http://www.perldebugged.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Is this correct? print syntax

2002-10-13 Thread Peter Scott
AIL PROTECTED]/msg33969.html for a recent >discussion on that. It's an indirect filehandle syntax, which is close. There's some interesting stuff here: $ perldoc -q indirect Found in /usr/lib/perl5/5.6.1/pod/perlfaq5.pod How can I use a filehandle indirectly? [...] --

Re: Using Perl to write to an Access 97 database (*.mdb)

2002-10-13 Thread Peter Scott
In article <005c01c27168$5c6c15c0$0924fea9@spy>, [EMAIL PROTECTED] (Josimar Nunes De Oliveira) writes: >I´m a beginner with perl and I need to find the DBI.pm module for Win32. >Does anybody know where I could find it? C:\> ppm PPM> install DBI -- Peter Scott http://ww

Re: Is this correct? print syntax

2002-10-13 Thread Peter Scott
be enormous, I >do it without the block. However, I think print(FOO @list) looks really >odd, so I'd probably do > > (print FOO @list), next if $condition; The parens feel funny to me. I usually write this as print FOO @list and next if $condition; -- Peter Sco

<    3   4   5   6   7   8   9   10   11   12   >