Re: vaiables global and local

2003-09-30 Thread david
z'; print $x,"\n"; } doMe; __END__ there is no way for Perl to access the outer local $x from within doMe because the inner local $x shadow the outer local $x. why would you want to name 2 local variables the same name anyway? all this is explained at: perldoc

Re: vaiables global and local

2003-09-30 Thread david
2 variables with exactly the same name and if the variables are both declared as local or global, you won't be able to access the outer most one. >> ' $x="abc";' creates a global visible inside and outside the script. see reasons above. > >

Re: Group list elements

2003-10-02 Thread david
;; $t = $1 while($s =~ s/,(@{[$t+1]})(?=,|\z)//); $n .= $t - $o > 1 ? "$o..$t," : $t == $o ? "$t," : "$o,$t,"; } substr($n,-1)=''; print $n,"\n"; __END__ prints: 0..5,8,9,20..25,27,28,31..33 david -- $_=q,015001450154015

RE: Chopping off first&last character in a string

2003-10-07 Thread david
) IV = 1234 PV = 0x805c5a8 "1234"\0 CUR = 4 LEN = 5 in both cases, there are no offset string because you are not removing stuff from the beginning. david -- $_=q,015001450154015401570040016701570162015401440041,,*,=*|=*_,split+local$"; map{~$_&1&&{$,<<=1,[EMAIL PROTECTED]||3])=>~}}0..s~.~~g-1;*_=*#, goto=>print+eval -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Chopping off first&last character in a string

2003-10-07 Thread david
="\n1234"; s/.//; print' 234 [panda]$ perl -le '$_="\n1234"; substr($_,0,1,""); print' 1234 if you decided to use the regex version, you might as well do s/.//s instead. i believe the substr version will be much faster. david -- $_=q,01500145015401540

RE: Inplace edit regex fun

2003-10-08 Thread david
27;datax'; > print qx(perl -pi -e 's/^$u:hello:([^:]*):/$u:goodbye:$1/;' file); qx interpolates variables. by the time $1 gets to perl, it's already gone. try: print qx(perl -pi -e 's/^$u:hello:([^:]*):/$u:goodbye:\$1/;' fil

RE: How to truncate a string?

2001-06-06 Thread Wagner-David
my $MyPrtVar = $var; if ( length($var) > 8 ) { $MyPrtVar = substr($var,0,8) . '...'; } Wags ;) -Original Message- From: Bruno Veldeman [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 06, 2001 12:16 To: [EMAIL PROTECTED] Subject: How to truncate a string? Hi, I have been looking f

RE: grep and regular exp.

2001-06-06 Thread David Blevins
orget. ;) Thanks David John Joseph Trammell wrote: > > On Wed, Jun 06, 2001 at 02:02:33PM -0500, David Blevins wrote: > [snip] > >my @list1 = grep(/$year_$month_.*01\.txt/, @allFiles); > >my @list2 = grep(/$year_$month_.*01a\.txt/, @allFiles); > [snip] > > These re

RE: counting problem

2001-06-07 Thread Wagner-David
Not sure what you doing with the $size = @pwfile but this gives you a count of the number of entries within that array which you then add to base. Unclear what you are attempting here, since no comments to say what you are after. Wags ;) -Original Message- From: Raven [mailto:[E

RE: regexp question

2001-06-07 Thread Wagner-David
Since you are not anchoring in way or another(\b or ^ or \W), it meets your criteria of any character then n then Wags ;) -Original Message- From: Martin Weinless [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 07, 2001 08:25 To: [EMAIL PROTECTED] Subject: regexp question Hello,

avoiding duplicate values

2001-06-07 Thread David Gilden
Is this the correct way to avoid getting the same value twice? # Text colors @colors = qw[ #F0F8FF #00 #7FFFD4 #F0 #F5F5DC #FFE4C4 #4169E1 #8B4513 #FA8072 #F4A460 #2E8B57 #A0522D ]; # choose a color! $color_choice1 = rand $#colors; # make sure we don't get same color twice $color_c

Re: avoiding duplicate values

2001-06-07 Thread David Gilden
> On Jun 7, David Gilden said: > > >@colors = qw[ #F0F8FF #00 #7FFFD4 #F0 #F5F5DC #FFE4C4 #4169E1 > >#8B4513 #FA8072 #F4A460 #2E8B57 #A0522D ]; > > > > > ># choose a color! > >$color_choice1 = rand $#colors; On Thursday, June 7, 2001 at 3:40

RE: Substitution Problem

2001-06-08 Thread Wagner-David
One thing is that you are doing a numeric compare(ie == vs eq) Perl tries it best to come up with a valid response. Since you are doing the compare, why not just do the re as $doc =~ s/^\s{6}$/11/; which says if you have six whitespace then change to 1's or whatever.

RE: DBI w/ JDBC Error

2001-06-08 Thread David Blevins
getting support, I recommend getting a new JDBC driver. Go here for more info: http://industry.java.sun.com/products/jdbc/drivers Good luck, David Blevins > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]]On Behalf > Of Brian Hanley > Sent: Friday,

Changing unix/linux passwords with Perl?

2001-06-08 Thread david . poon
Hi Perl People, I'm creating a web interface to a linux server and was wondering if there are perl modules that can be used to change linux passwords? The idea is to be able to administrate a linux box without having to use the command prompt, so somebody doesn't have to know how

RE: Matching one array against another

2001-06-08 Thread Wagner-David
You use a hash for holding your elements to check against and use the values within the array as a key to know whether it is a hit or not. If unsure on how data coming in, then make sure you use a lc or uc against your data and the data coming in, unless CAP is different from cap. Wags ;) ps fol

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: ensuring that there *is* an \@ symbol

2001-06-12 Thread Wagner-David
you need only !~ for does not contain vs =~ does contain Wags ;) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 12, 2001 11:16 To: Perl Discuss Subject: ensuring that there *is* an \@ symbol i am trying: } elsif ( $add_destination !=~ /\@/

RE: simple Perl question

2001-06-12 Thread Wagner-David
Unsure exactly what you are really after, but you would code your program into subs with one while loop or some controlling mechanism which would allow you to go where you wanted within your program. sub suba { } sub subb { } sub subcc { } while ( 1 ) { print "Please enter value:"

RE: A Term::ReadKey question -- keep cursor put!

2001-06-13 Thread Wagner-David
This appeared either on this list or the Perl-Win32 list as the same question. You can use select(0,0,0,25) I believe which will pause for .25 of a second. You may need also to set autoflush to 1(ie, $|=1 ), so each IO will be displayed. Wags ;) -Original Message- From: Dave Newton [m

uninitialized value in numeric error

2001-06-13 Thread David Kenneally
than 12 hours, and those that are newer (then I will build on it to do better things than just print). Thanks David

RE: uninitialized value in numeric error

2001-06-13 Thread David Kenneally
Hello- I get the error both when it is quoted and when it is not. It still works, and I guess this is just a notification, but I was hoping there might be a more correct way. Thanks! David "Not quite a Saint" Kenneally >David, >Verily, on Wednesday June 13, 2001, t

avoiding duplicates

2001-06-14 Thread David Gilden
Greetings, a couple of questions here, --- # Text colors @colors = qw[ #F0F8FF #00 #7FFFD4 #F0 #F5F5DC #FFE4C4 #00 #FF #8A2BE2 #A52A2A #5F9EA0 #7FFF00 #FF7F50 #DC143C #00 #8B #008B8B #B8860B #FA8072 #F4A460 #2E8B57 #A0522D #6A5ACD #00FF7F #4682B4 #D2B48C #008080

Slicing and dicing

2001-06-14 Thread David Gilden
Is one style better then the other here? Thanks, Dave - sub print_table_rows { my $name = shift; my $key = shift; my $date = shift; print < $thread{$key} $name$date data --- alt sub print_table_rows { my ($name,$key,$date) = @_[0..2] print < $thread{$key} $name$date data

Sort hash by values

2001-06-14 Thread David Gilden
Hello, Stuck here, The first sort block works like a charm! if ($sort_order == 1) { # sort by name # $key is really the filename with out the path and '.html' foreach my $key (sort {lc($a) cmp lc($b)} keys %subjects){ my $name; ($name = $key ) =~ s/_(\d+)$//; $name =~ tr/_/ /

RE: Sort hash by values

2001-06-14 Thread Wagner-David
Use of keys, map and sort (untested) foreach my $subject (sort {lc($a) cmp lc($b)} map {[ $_, $subjects{$_}]} keys %subjects){ printf "%-40s: %-s\n", $subjects{$subject->[0]}, $subject->[0]; } Wags ;) -Original Message- From: David Gilden [mailto:[EMAIL PROTECTED]

RE: Sort hash by values

2001-06-14 Thread Wagner-David
Sorry, but as soon as I saw the input coming back I knew it was really untested. Should be sort {lc($a->[1]) cmp lc($b->[1])} and NOT sort {lc($a) cmp lc($b)} Wags ;) -Original Message- From: Wagner-David Sent: Thursday, June 14, 2001 13:21 To: 'David Gilden';

RE: PARSING A FILE

2001-06-14 Thread Wagner-David
Major assumptions: format you stated (ie name, line 1, line 2) No checking at this point, other than the first read should be > . Also assumed from your input that you wanted ALL white space removed. Untested, but a starting point. Also assumed you will setup the open for input and output accor

RE: counting regex matches

2001-06-14 Thread Wagner-David
I only get a one when doing it that way. I had to do the following: my $string = 'abcadebavdacde'; my $MyCount = 0; while ( $string =~ /a/g ) { $MyCount++}; printf "String:\n%-s\nCount: %4d\n", $string, $MyCount; Output: String: abcadebavdacde Count:4 Wags ;) -Original Message-

New

2001-06-15 Thread David Farnum
Hello I have been using Linux for 1 year and I am just starting Perl. I just want to say that it is great to have a new user mailing list with out fear of looking stupid in the programing world. I have about 4 books on Perl I am reading now and just from what I have learned I can say I love th

Re: New

2001-06-15 Thread David Farnum
"Brett W. McCoy" wrote: > On Fri, 15 Jun 2001, David Farnum wrote: > > > Hello I have been using Linux for 1 year and I am just starting > > Perl. I just want to say that it is great to have a new user mailing > > list with out fear of looking stupid in the

sort by number...

2001-06-15 Thread David Gilden
Good day, keys look like: Dowda_23241506142001 This is wrong, but not sure how the syntax is, Where are $a,$b coming from, I thought of a sub, but how do assign $a, $b foreach my $key (sort { /_(\d+)$/; $a <=> $b } (keys %subjects)) { # /_(\d+)$/ grabs the number at the end of the string,

Re: Reading versus Referencing Books

2001-06-15 Thread David Farnum
Scott Thompson wrote: > > -Original Message- > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On > > Behalf Of David Farnum > > Subject: New > > > > Hello I have been using Linux for 1 year and I am just starting > > Perl. I just want

Re: MS-DOS

2001-06-15 Thread David Farnum
Crystal Gruetzmacher wrote: > Once upon a time I could use MS-Dos to run my Perl scripts at the C:\Perl > prompt. Then use Perl nameofscript.pl or whatever the name was. That isn't > working anymore. Anyone have any idea why? What can I do to fix it. I've > tried reinstalling Perl but that doesn'

More sorting

2001-06-15 Thread David Gilden
_rows { my ($fileName, $subject, $date) = @_; ($name = $fileName) =~ s/_\d+$//; $name =~ tr/_/ /; print < $subject $name$date data } -- From: Wagner-David Sorry, but as soon as I saw the input coming back I knew it was really untested. Should be sort {lc($a->[1]) cmp lc($b-

$hash{$_}++

2001-06-18 Thread David Gilden
I am having trouble understanding just what the following does, and how to you use it: $hash{$_}++ i.e. are we increment the value or the key? I would appreciate any guidance here! Thanks, Dave G.

RE: Sort hash by values

2001-06-18 Thread David Gilden
Thanks for all who helped with my Perl coding, I thought some folks here might benefit from me posting the final code I used on a current project: ---snip--- if ($sort_order == 1) { # sort by name (front part of the key) foreach my $key (sort {lc($a) cmp lc($b)} keys %index){ &print_ta

Re: $hash{$_}++

2001-06-18 Thread David Gilden
How about a an example or 2 where you would use this, $hash{$_}++ Thnx, Dave, Looking for Web Talent, You found it! portfolio: www.coraconnection.com/web/ email: [EMAIL PROTECTED] tel/fax: (860) 231-9988

RE: Selection Mask - 2nd Attemp

2001-06-19 Thread Wagner-David
If the code is actually as you state, then you are using [ twice which would make the mask incorrect. The lines 54/56 show the vairable as being encased in [] and in line 76 you show [$mask] which would equate to /^[[2,A-Z]]/ which is not really what you want. Wags ;) -Original Message-

RE: populating an array with unique integers.

2001-06-19 Thread Wagner-David
Use a hash vs array, use the number as a hash key. If key exists, then get the next number until you have the number of unique numbers desired. next if ( exists $Unique{$RandomNumber} ); $Unique{$RandomNumber} = 1; for printing: foreach my $MyKey (sort k

RE: populating an array with unique integers.

2001-06-19 Thread Wagner-David
Sorry but foreach should be: foreach my $MyKey (sort keys %Unique ) { Wags ;) -Original Message- From: Wagner-David Sent: Tuesday, June 19, 2001 09:57 To: [EMAIL PROTECTED] Subject: RE: populating an array with unique integers. Use a hash vs array, use the

RE: populating an array with unique integers.

2001-06-19 Thread Wagner-David
undef %Random; or %Random = (); Wags ;) -Original Message- From: Scott Taylor [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 19, 2001 11:52 To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: populating an array with unique integers. At 10:30 AM 06/19/01, Jeff 'japhy' Pinya

RE: variable losing it's value

2001-06-19 Thread Wagner-David
You are overlaying $line each time you read a line from <>. SO it will be the last line from whatever files if any were passed. Wags ;) -Original Message- From: Bob Mangold [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 19, 2001 13:25 To: [EMAIL PROTECTED] Subject: variable losing it's v

RE: Complex RegEx Question

2001-06-21 Thread Wagner-David
I don't think the you need a regex for getting the data in. You only need to do something like: my $MyData = '' while ( ) { chomp; if ( /^DataSource\s+Name\s+/ ) {# Hit on start of data proc_search($MyData) if ( $MyData gt '' ); # MyData has dat

RE: 2 regex questions

2001-06-22 Thread Wagner-David
Is this not saying Add if neither joe and fred are in the line while what is desired is Joe yes, Fred No ? Wags ;) -Original Message- From: Chas Owens [mailto:[EMAIL PROTECTED]] Sent: Friday, June 22, 2001 08:50 To: [EMAIL PROTECTED] Subject: Re: 2 regex questions On 22 Jun 200

RE: comparing strings

2001-06-22 Thread Wagner-David
You are using numeric comparsion when you want string(change to lt (less than), le (less than and equal), etc. so 'a'< 'b' should be 'a' lt 'b' Wags ;) -Original Message- From: Nick Transier [mailto:[EMAIL PROTECTED]] Sent: Friday, June 22, 2001 12:31 To: [EMAIL PROTECTED] Sub

RE: How do I determine number of matches in a regex?

2001-06-22 Thread Wagner-David
That is one way. Another would be to use: while ( /$pattern/g ) { $count++ ) Wags ;) -Original Message- From: Bradford Ritchie [mailto:[EMAIL PROTECTED]] Sent: Friday, June 22, 2001 12:48 To: [EMAIL PROTECTED] Subject: How do I determine number of matches in a regex? Does anyone

Re: Filehandles

2001-06-23 Thread David Monarres
quot;hello"; I hope that helps. David Monarres <[EMAIL PROTECTED]>

Variable scope

2001-06-26 Thread David Gilden
Quick question, I could not get the following sub to work until I had to move $emailLog inside the sub to get this to work on the server. What did I miss or not understand? Thanks Dave ## not seen by the sub, $emailLog = 'logs/email_log'; # Send E-Mail &send_mail; # Append email lo

RE: Variable scoop

2001-06-26 Thread David Gilden
Here's the latest revision, I don't know why it was not working earlier when emailLog = 'logs/email_log'; was out of the sub block. This script is contained in one file, with on 'use' or 'require' statements. The next revision I see is to move the regrex up to top of the sub where the append t

removing white space

2001-06-26 Thread David Gilden
Is the following regrex the correct way to remove leading or trailing white space from a string? $data = "[EMAIL PROTECTED] (mike smith)" $data =~ s/(^\s+)|(\s+$)//g; or would it be more efficient to it thus: # two passes $data =~ s/^\s+)//; $data =~ s/\s+$)//; Final comment when I am

Gzip on Win32

2001-06-28 Thread David Simcik
Hey, I'm hoping this will be a straighforward question...I'm assuming I need a command-line interface GZip utility to work with the MCPAN installation utility??? Where can I find one? Thanks. DTS

RE: Matching strings

2001-06-28 Thread Wagner-David
First you would need to do a string compare vs numeric compare(ie, eq vs == ). If they can never enter the same response or value and you don't care about capitalization, then you could use a hash and either lower/upper case the input. If key exists and/or is defined, then would have to r

Format & Sprintf

2001-07-02 Thread David Gilden
Hello, The following is based on the first example in Programming Perl, and have a question about some of the syntax (and or why it was doen this way) $grades{$student} .= $grade . " "; Why not $grades{$student} = $grade; Why the concatenation and the extra space? $average = sprintf ("%3d",

RE: Agnostic clear command...

2001-07-02 Thread Wagner-David
You are correct. I believe that the backticks work on the shell, so I replace `cls` with system("cls") and at least my screen cleared as it was suppose to. Wags ;) -Original Message- From: Craig S Monroe [mailto:[EMAIL PROTECTED]] Sent: Monday, July 02, 2001 12:13 To: Beginners@P

RE: Format & Sprintf

2001-07-02 Thread Wagner-David
The reason the cat is that there are mulitple grades per line. So if you do assignment only, then you will have only the last grade. To get 2.5, etc then you could use %4.1f to get to one decimal point. Wags ;) ps Unknown about formats. Sorry. -Original Message- From: David Gilden

Executing Script from Sendmail

2001-07-03 Thread David Rankin
Hello, I am trying to write a script that is run by piping email to it from an alias. The script is running on Red Hat Linux 7.0, and the MTA's sendmail. I'm also using smrsh. I'm not sure if the problem is with the script or something else, but here's the code I'm using (just for testing righ

Executing Script from Sendmail

2001-07-05 Thread David Rankin
Hello, I am trying to write a script that is run by piping email to it from an alias. The script is running on Red Hat Linux 7.0, and the MTA's sendmail. I'm also using smrsh. I'm not sure if the problem is with the script or something else, but here's the code I'm using (just for testing righ

modules & path to perl

2001-07-05 Thread David Gilden
How do I list what my ISP has on there server in terms of Modules? And what is the command (at the command line) to tell me what version The server has on it / and or the path to perl. Thanks Dave G. Looking for Web Talent, You found it! portfolio: w

RE: -d & other file tests

2001-07-05 Thread Wagner-David
You are passing the source diretory and file, yet when doing the test you are only doing the source file and not combining the directory and file. Without seeing what you are passing, this would be my first guess. I say this becuase you always pring the two together when you print. Wags ;

Re: Mail Send problems 1.6 CVS

2001-07-05 Thread David Monarres
I have had the same two problems with 1.16 and cvs (same day). The problem with sending mail seemed to be solved when I ran my MTA as a deamon, not through inetd. (do not know if that will help) The address thing I really haven't found a work around for. David Monarres <[EMAIL PROTECTED]

Re: redirect how to?

2001-07-07 Thread David Rankin
g. It is really >infuriating not being able to do such a seemingly simple task! I'm not sure if you're really putting pound sign at the beginning of each line in your code (like in your email) but that's telling perl those lines are just comments, so it's not gonna try

Re: redirect how to?

2001-07-07 Thread David Rankin
xample, the following prints some html including the refresh header and redirects the user's browser. #!/usr/bin/perl -w print "Content-type: text/html\n\n"; print < http://www.perl.org";> This is the html message part. MSG -Dave -- David Rankin President, Sur

Re: foreach examples/usage

2001-07-09 Thread David Wood
and make a @new_array, use map - a bit more convenient than a foreach ... { push } my @new_array = map #do something with $_ here#, @array; eg: my @new_array = map $_*2 , @array; Would give 0,2,4,6,8,10,12,14,16.42,44 -- David Wood, Web Developer [a] Clickmusic Ltd, 99c Talbo

RE: Simple

2001-07-09 Thread Wagner-David
last; This will move you out of the while loop. Wags ;) -Original Message- From: Bill Pierson [mailto:[EMAIL PROTECTED]] Sent: Monday, July 09, 2001 11:20 To: [EMAIL PROTECTED] Subject: Simple Easy question. open(IN,"something.txt"); while($line = ) { chomp($line);

RE: newbie whitespace question

2001-07-09 Thread Wagner-David
Change:if ( /^Kilobytes:(.*)$/ ) to if ( /^Kilobytes:\s*(\d*)$/ ) where $1 will have your count without leading spaces. You may want a test to verify that you did get a hit on digits. Wags ;) -Original Message- From: Nat Durbin [mailto:[EMAIL PROTECTED]] Sent: Monday, July 09

RE: Re[2]: Net::ftp

2001-07-09 Thread Wagner-David
It is part of libnet and usually installed as part of core Perl install. Wags ;) -Original Message- From: Tim Musson [mailto:[EMAIL PROTECTED]] Sent: Monday, July 09, 2001 16:09 To: [EMAIL PROTECTED] Subject: Re[2]: Net::ftp Hey Jorge, Monday, July 09, 2001, 5:36:33 AM, my MUA

RE: timer/display-DISPLAY WORKING;THANKS

2001-07-09 Thread Wagner-David
In this case you are just using the select for the time out and not concerned about the other actions of select. Wags ;) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Monday, July 09, 2001 16:27 To: [EMAIL PROTECTED] Subject: Re: timer/display-DISPLA

RE: open FILE problem

2001-07-12 Thread Wagner-David
Here is one way: open X, ">>output.txt"; while (<>) { s/^\s*//; print X "$_"; } close X; Since it looks like you are coming from unix environment, you could do: format.pl *.txt which will read in all files one after the other automatically. Now if you want some breakout, then

RE: date

2001-07-13 Thread Wagner-David
There are a number of different modules (Date::Calc or Date::Manip as two possiblities) which you might use, but really depends on the format of the dates coming in. If you know they are pretty constant, then you could use Time::Local: use Time::Local; my $Dates = '07/13/01 - 07/12/01';

Re: Regarding Internal Server Error

2001-07-16 Thread David Wood
l server error.i have not done much in search_results.cgi >so basically i feel there is no syntax error. > > What are the possible reasons of error..Please Help! -- David Wood, Web Developer [a] Clickmusic Ltd, 99c Talbot Road, London W11 2AT [t] 020 7727 7500 [w] www.c

Re: Perl Filters

2001-07-16 Thread David Wood
e, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] -- David Wood, Web Developer [a] Clickmusic Ltd, 99c Talbot Road, London W11 2AT [t] 020 7727 7500 [w] www.clickmusic.co.uk "There are three types of people in the world; those who can count, and

upper-casing the first char & hashs of hashs

2001-07-16 Thread David Gilden
Hello, The following uppercase'S the whole string, when all I want is the first letter. &uppercase($bears->{"rec$n"}{name}), uc($bears->{"rec$n"}{type}) # works but caps the whole string } u\$bears->{"rec$n"}{type} # does not work... sub uppercase{ ($s) = @_; \u$s = scalar $s; ## does n

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

2001-07-16 Thread Wagner-David
replace uc with ucfirst. Wags ;) -Original Message- From: David Gilden [mailto:[EMAIL PROTECTED]] Sent: Monday, July 16, 2001 10:28 To: [EMAIL PROTECTED] Subject: upper-casing the first char & hashs of hashs Hello, The following uppercase'S the whole string, when a

Cmd Line args

2001-07-16 Thread David Gilden
if I invoke this script as follows: perl bears.pl ARGV[0] never seems to be false even though there are no args.. What did I do wrong here? Thanks Dave #!/usr/bin/perl -w $sort_order = $ARGV[0] || $usage; # grab command line args $usage =" # Type a number after the script name to choose the

Re: Regex giving me fits!! :-(

2001-07-17 Thread David Wood
ary Luther.vcf > Type: Plain Text (text/plain) > > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] -- David Wood, Web Developer [a] Cl

RE: Lame question

2001-07-17 Thread Wagner-David
if ( $ARGV[0] =~ /^\d+$/ ) {# Simple number # If minus sign, decimal point, etc, then would need to add # Following checks for negative number and decimal point

Re: regex self taught, not fun...

2001-07-18 Thread David Wood
. the <> characters. > > Is this so hard because I'm trying to row with a fork or what ? > > Michael Carmody > MDU, Public Health Lab > Dept. of Microbiology and Immunology > The University of Melbourne, Parkville > > -- > To unsubscribe, e

Re: Think there is something DBI

2001-07-18 Thread David Wood
ors that there are unclosed apostrophes in the fields. I >am looking for a way to escape these apostrophes as simply as possible. Can someone >help? > > Judd Borakove -- David Wood, Web Developer [a] Clickmusic Ltd, 99c Talbot Road, London W11 2AT [t] 020 7727 7500 [w] www.clic

Re: Think there is something DBI

2001-07-18 Thread David Wood
em, I am running a script to take a pipe > > delimited flat file and pump the data into a database. Due to the users > > putting extraneous apostrophes I am getting errors that there are unclosed > > apostrophes in the fields. I am looking for a way to escape these > >

Dynamic Data structures

2001-07-18 Thread David Gilden
Take this Data structure (which is an anonymous hash) # # $bears = { # # # rec0 => { # name => 'sweaterie', # type => 'sweater', # color => 'golden brown', # food => 'mixed berries', # }, # ect # }; I am

Re: Think there is something DBI

2001-07-18 Thread David Wood
%hash, values %hash; local $" = ","; my $SQL_UP = "INSERT INTO $DB_Table (@columns) VALUES (@values)"; # $dbh->do($SQL_UP), or whatever } Dave borakovej wrote: > > Hey David > i tryed to pass the entire SQL statement through the > dbh->quote like this

RE: Text::Wrap for perl 5.6.0

2001-07-20 Thread Wagner-David
You might try Damian Conway's Text::Autoformat. Wags ;) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, July 20, 2001 07:06 To: Perl Discuss Subject: Text::Wrap for perl 5.6.0 After searching on cpan, i found http://search.cpan.org/search?

RE: PDF's on the fly...

2001-07-20 Thread Wagner-David
There a number of modules Text::PDF being one, but one I tried for our business was from www.sanface.com which seemed quite slick. The cost for txt2pdf was single license of $99. The one I ended up looking at was txt2pdfPro which could do compression ( single cpu $850). This seems like

RE: Repost Form data for user validation / change -- how?

2001-07-20 Thread Kuchler, David
ute of the tags. Now, as far as talking to Frontpage forms, I agree with the sentiment expressed by Guilherme Pinto: "Change to Dreamweaver ;o)" I understand this isn't always an option, but if you can, I strongly recommend Dreamweaver. Dave K. David T. Kuchler Technical

RE: Repost Form data for user validation / change -- how?

2001-07-20 Thread Kuchler, David
That's odd. Are you using cgi.pm to generate your HTML or are you doing it with a series of print statements? I just tried it and it works fine for me. If you post at least the relevant code snippet, maybe I can see where my explanation went awry. David T. Kuchler Technical Configu

RE: Repost Form data for user validation / change -- how?

2001-07-20 Thread Kuchler, David
Ah, I see the misunderstanding. You have the $userbody still inside the opening textarea tag, whereas it needs to be between the two tags, like this: $user_body instead of the way you had it, like this: Give that a try and let us know David T. Kuchler Technical Configurator Pioneer

RE: pattern matching

2001-07-22 Thread Wagner-David
If truly must have a digit to start with to do other processing, then you could do: #one form could be: if ( ! /^\d/ ) { # print the headers }else { # do other processing } # or another form: if ( ! /^\d/ ) { print

RE: pattern matching

2001-07-23 Thread Wagner-David
ever you have $line replace with $_ and it should do what you want. Wags ;) -Original Message- From: Greg [mailto:[EMAIL PROTECTED]] Sent: Sunday, July 22, 2001 16:02 To: [EMAIL PROTECTED] Cc: Wagner-David Subject: RE: pattern matching I have tried your example, but perhaps I have

RE: Cleanest way to split this

2001-07-24 Thread Wagner-David
Here are some modules( ActiveState ): DBD-CSV [0.1025] DBI driver for CSV files Text-CSV[0.01 ] comma-separated values manipulation routines Text-CSV_XS [0.22 ] comma-separated values manipulation routines XML-CSV [0.10 ] Perl extension converting CSV files to XML

RE: Sort an array of arrays?

2001-07-24 Thread Wagner-David
Here is a reply to an email on another list regarding sorting of array of arrays. Cut and run(I did it on AS 5.6.0 build 623). From this you should be able to do what you want. Wags ;) = P

RE: basename ?

2001-07-24 Thread Wagner-David
Here is one using rindex to get what you want: #!perl -w $_ = '15P4aa-U5-00.log:>>> Virus \'W32/Apology-B\' found in file \ /var/spool/exim/qtine/15P4aa-U5-00.exp/qi_test.exe'; my $MyPtr = rindex($_,'/'); my $MyFileName ; if ( $MyPtr < 0 ) { print "No slash found in $_"; }e

RE: reading a text file

2001-07-24 Thread Wagner-David
Here is one way(I changed file to use __DATA__). I sed a hash and then sorted on the data within the hash on the fly. HTH. Wags ;) == #!perl -w my %States = (); while () { chomp

RE: reading a text file

2001-07-24 Thread Wagner-David
But it is a flame. She stated that she was on chapter 4 and now the boss wants something. Depending on her background(ie, number of years programming ,etc) this can be overwhelming. Yes, she probably could have done more, but if she is truly a newbie, how does she know what to ask or ev

RE: I have an array ... @effort

2001-07-24 Thread Wagner-David
Do you have what data looks like or some code? It is unclear to me what you are doing with the ZyX test. Wags ;) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 24, 2001 15:16 To: [EMAIL PROTECTED] Subject: I have an array ... @effort

How can I reinstall CGI?

2001-07-25 Thread David Scott
undefined subroutine &CGI::Object::Html::start_html at /usr/local/lib/perl5/5.00502/autoload.pm line 17. /usr/local/lib/perl5/5.00502/CGI/Object/Html.pm exists and the sub start_html is in it. Does anyone know what I need to do to get this working? Thanks, David Scott [EMAIL PROTECTED] -- To

RE: Date problem

2001-07-25 Thread Wagner-David
Here is a shot taking in mmddyy and giving mmdd: Code starts on next line(Lines with #Use are what is needed): #!perl -w use Time::Local;#Use my $Dates = '010201'; my @DateUse = (); while ( $Dates =~ /(\d{2}){1}/g ) { printf "%-s\n",$1; push(@Dat

fetchrow_array problem with DBI

2001-07-25 Thread David Rankin
data[1]; my $clientname=$data[2]; print "NAME: $clientname\nID: $clientid\n\n"; } $sth->finish; $dbh->disconnect; Thanks in advance! -Dave -- David Rankin Tel: 401.277.9966/877.528.5213 Fax: 603.590.4925 Email: [EMAIL PROTECTED] http://www.surfthisdesign.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

First Script Question

2001-07-25 Thread David Freeman
n; } close NAMES; while(1){ print "Look for what domain in spam filter? "; chomp($email=); last unless $email; print $newarray{$email},"\n"; } if <> $email open(APPEND, ">>/etc/mail/access1") || die "can't open ac

RE: fetchrow_array problem with DBI

2001-07-25 Thread David Rankin
'SELECT * FROM tbl_clients') >or die "Couldn't prepare statement: " . $dbh; > >$sth->execute() or die "Execute Failed"; > >my @data; >while(@data=$sth->fetchrow_array()) { ## The offending line >

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