RE: Text wrapping

2002-01-29 Thread David Blevins
7:59 PM > To: David Blevins > Cc: [EMAIL PROTECTED] > Subject: Re: Text wrapping > > > On Jan 29, David Blevins said: > > >What's the best way to approach text wrapping? > > Have you considered the Text::Wrap module? Or perhaps Text::AutoFormat? >

Text wrapping

2002-01-29 Thread David Blevins
What's the best way to approach text wrapping? I have a line in the email that isn't wrapped. There must be a simpler way to do this other than splitting it by spaces and printing back each word one at a time. -David -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mai

RE: Strange scalar behavior

2002-01-29 Thread David Blevins
ld you consider this a bug in the cygwin port or desired behavior? David > -Original Message- > From: David Blevins [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, January 29, 2002 6:17 PM > To: [EMAIL PROTECTED] > Subject: Strange scalar behavior > > > Hi All, > > Yo

Strange scalar behavior

2002-01-29 Thread David Blevins
Hi All, You'll have to bare with me on this one as I can post code to repeat the problem. I hope I can give enough details so that the cause of the "problem" is clear. Background: I get automated emails that contain information about project tasks (this is a sourceforge project). As I am the pr

RE: Deleting Duplicate Lines one-liner

2001-07-30 Thread David Blevins
Truly astounding. From: Paul [mailto:[EMAIL PROTECTED]] > > --- David Blevins <[EMAIL PROTECTED]> wrote: > > > perl -nle 'print if !$seen{$_}++' > > > > $seen{$_} > > > > Tries to lookup the line in the hash of lines we've already s

RE: Deleting Duplicate Lines one-liner

2001-07-30 Thread David Blevins
Yikes! This is what I was talking about. Amazing. Let me take a crack at the first one -- should be entertaining for everyone ;) From: Jeff 'japhy/Marillion' Pinyan > > Here's a one-liner: > > perl -nle 'print if !$seen{$_}++' The dash n (-n) puts the command 'print if !$seen{$_}++' in a wh

Deleting Duplicate Lines one-liner

2001-07-30 Thread David Blevins
Here is a one-liner I just wrote to delete duplicate lines in a file. perl -ni.bak -e 'unless ($last eq $_){print $_};$last=$_;' theFile Going with the TMTOWTDI credo, I was just curious if anyone knew of a better way. Thanks, David -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

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,

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

grep and regular exp.

2001-06-06 Thread David Blevins
For some reason when I am grepping a list like this one, the regular expression doesn't seem to be working. The $year and $month seem to be ignored. The following code prints: 1999_12_stats_log_01.txt1998_07_stats_log_01a.txt It should print only: 1998_07_stats_log_01a.txt #---

RE: Modifying/Deleting lines in a file

2001-05-24 Thread David Blevins
othy Kimball wrote: > > David Blevins wrote: > : There has to be a better way to modify/delete lines in a file than this. > > Time for a one-liner: > > perl -ni -e 'print unless /I'm a bad line, delete me\./' thefile > > -n loops through the lines of thefile, but

Modifying/Deleting lines in a file

2001-05-24 Thread David Blevins
Thanks to everyone for the great input on my last question. Here's another. There has to be a better way to modify/delete lines in a file than this. my $filename = "thefile"; my $lineToDelete = "I'm a bad line, delete me."; open(FILE, "< $filename"); open(FILE_TMP, "> $filename

RE: Why can't $I = chop $array[1]

2001-05-23 Thread David Blevins
TED]] > > > --- David Blevins <[EMAIL PROTECTED]> wrote: > > local @fileList = reverse sort `ls $list*.list`; > > local $current = $fileList[0]; > > local $previous = $fileList[1]; > > Local is great for a few things, but almost universally you should b

Why can't $I = chop $array[1]

2001-05-23 Thread David Blevins
$current,$previous) = (reverse sort `ls $list*.list`)[0,1]; chop $current; chop $previous; Of course, I know there has to be a better way to do this: reverse sort `ls $list*.list` I just get tired of looking everything up in my Perl book. David Blevins