Re: [Boston.pm] Damien's book OOP - OOP?

2003-10-12 Thread Erik Price
On Thursday, October 9, 2003, at 11:10  AM, Andrew M. Langmead wrote:

Even when it is the best book on the subject and all the information
in the book is relavent to the  current version of the language? I'll
never understand the book publishing business.
Though I haven't read Damian Conway's book, I have also heard that it's 
the best book on the subject.  In the meantime, I've been reading the 
sequel to "Learning Perl", which is "Learning Perl Objects, References, 
and Modules".  I'm not sure how it compares, given that it's thinner, 
but I like the book so far (I like Schwartz's writing style).

Erik

___
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm


Re: [Boston.pm] emacs discussion

2003-07-10 Thread Erik Price
On Wednesday, July 9, 2003, at 10:20  PM, Chris Devers wrote:

I wish I could think of better metaphors for this, because intuitively 
it
seems clear to me that there are plenty of examples of things that are
very complex and yet still not necessarily challenging.
Python?

]} dodges barrage of tomatoes {[



Erik

___
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm


Re: [Boston.pm] Komodo vs. emacs

2003-07-01 Thread Erik Price
On Tuesday, July 1, 2003, at 01:01  PM, David Cantrell wrote:

The way I want to edit - and the way emacs doesn't want to let me edit 
- is for the editor to not impose any indentation at all.  Rather, it 
should let me indent and then should automatically indent following 
lines by the same amount until I tell it to do otherwise.
That's BBEdit's indentation style.



Erik

___
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm


Re: [Boston.pm] Perl 6 has become too complex

2003-03-18 Thread Erik Price
On Tuesday, March 18, 2003, at 02:03  AM, Elaine -HFB- Ashton wrote:

400 hundred years ago Agricola codified Finnish yet today there are 
more
than 80 dialects not to mention the huge variation between the written 
and
spoken forms.
I'm not a linguistic scholar, but I read once that linguistic scholars 
have noticed that throughout human history, there has always been a 
trend of languages diverging, rather than converging (as one might 
expect).  As the amount of widespread-edness* of a language grows, the 
more likely that subgroups using the language are to evolve with their 
own dialects of that language, separating from the main "trunk" as it 
were.  I wonder sometimes about the grammars that people use to write 
software and how closely or not so closely it relates.

* case in point

Erik



--
Erik Price
email: [EMAIL PROTECTED]
jabber: [EMAIL PROTECTED]
___
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm


Re: [Boston.pm] Perl 6 has become too complex

2003-03-15 Thread Erik Price
On Saturday, March 15, 2003, at 10:11  AM, Mikey Smelto wrote:

You forgot to mention that we will all have to deal with suggesting 
perl5 to project managers/decision makers(read: people who don't 
understand anything) as a language of choice for projects of the 
future, and explain to them why we don't want to use the newest 
version of the language, and having the perl5 solution rejected 
because the company doesn't want to use old||legacy||non-cutting-edge 
software going forward.
Hm.  I think this can't be generalized upon.  Where I work, they are 
still using Perl 5.005 on the production servers (for our internal 
site)

Erik





--
Erik Price
email: [EMAIL PROTECTED]
jabber: [EMAIL PROTECTED]
___
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm


Re: [Boston.pm] cgi file permissions

2003-03-02 Thread Erik Price
On Sunday, March 2, 2003, at 09:18  AM, Wizard wrote:

I've got a script which reads a config file to get a database 
username and
password, among other things.  What should the permissions be so that 
the
cgi script running on the web server can read the file, but
random users on
the system can't?  Is this the best way for the script to get
sensitive info
like that?
I'd suggest that you store the password encrypted using crypt, and 
then when
the user enters the password, encrypt it and then compare the two. 
That way
you don't have any cleartext passwords lying around.
I think the OP meant a way to store the database connection password 
itself (which the CGI scripts must use in order to make database 
connections), so that the CGI can access the DB.

Erik





--
Erik Price
email: [EMAIL PROTECTED]
jabber: [EMAIL PROTECTED]
___
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm


Re: [Boston.pm] cgi file permissions

2003-03-02 Thread Erik Price
On Sunday, March 2, 2003, at 09:13  AM, Joel Gwynn wrote:

I've got a script which reads a config file to get a database username 
and
password, among other things.  What should the permissions be so that 
the
cgi script running on the web server can read the file, but random 
users on
the system can't?  Is this the best way for the script to get 
sensitive info
like that?

This is on pair.com, where the script runs as user nobody and group 
www.
The catch-22 is that even if other users on the system can't read the 
file directly, but the web server can (i.e., somehow you set the group 
association of the file to "www" of which *only* the web server is a 
member and the permissions are rw-r-), other users on the system 
who can create CGIs to be executed by the web server could write a CGI 
script which runs as "nobody" in group "www".  You can imagine where 
this leads.



Erik





--
Erik Price
email: [EMAIL PROTECTED]
jabber: [EMAIL PROTECTED]
___
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm


Re: [Boston.pm] Re: "Slightly" off topic from Hartford PM Group

2003-03-02 Thread Erik Price
On Thursday, February 27, 2003, at 10:55  AM, Gyepi SAM wrote:

I used the 'Content-Disposition' header [1] for a long time, but  
eventually gave
up and simply appended the filename to the url because some versions  
of IE ignore the
the headers altogether. I think it was a workaround to fix the IE  
content-disposition insecurity
problem, but I don't really know why.
Everyone seems to be having problems (with the Content-disposition  
header not working as expected).  Another one you may encounter using  
Content-disposition is the user is prompted twice for confirmation  
before the file is downloaded.  According to this post to the  
Tomcat-user mailing list, Microsoft is aware of this "problem" and  
reported that it was working as designed:

<http://www.mail-archive.com/[EMAIL PROTECTED]/ 
msg86869.html>

Erik





--
Erik Price
email: [EMAIL PROTECTED]
jabber: [EMAIL PROTECTED]
___
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm


Re: [Boston.pm] Perl v. Java...

2003-02-11 Thread Erik Price

On Tuesday, February 11, 2003, at 12:02  PM, Sherm Pendley wrote:


On Monday, February 10, 2003, at 11:04 PM, Erik Price wrote:


Java doesn't let you just bust out what's on your mind -- I've  
discovered that you really have to plan out your application's public 
 interface

You say that as if it's a bad thing, or as if it applies only to Java.


Sorry, didn't mean to give that impression.  I don't think it's a bad 
thing at all, nor do I think it only applies to Java, or even only 
programming.






Erik




--
Erik Price

email: [EMAIL PROTECTED]
jabber: [EMAIL PROTECTED]

___
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm


Re: [Boston.pm] damian talk

2003-01-13 Thread Erik Price

On Monday, January 13, 2003, at 08:46  PM, [EMAIL PROTECTED] wrote:


or the opening line of "The old man and the Sea"
by Hemingway (pound for pound, my favorite)


Mine be the one that includeth the line,

"Tu-whit, tu-who! a merry note. While greasy Joan doth keel the pot."

Not quite sure why.



Erik





--
Erik Price

email: [EMAIL PROTECTED]
jabber: [EMAIL PROTECTED]

___
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm



Re: [Boston.pm] OT: Favorite Mac OS X utilities

2003-01-02 Thread Erik Price

On Thursday, January 2, 2003, at 11:10  AM, Drew Taylor wrote:


I've recently gotten a Mac OS X (10.2.3) box up & running.


DREW TAYLOR WINS.  FLAWLESS VICTORY.


1. Are there any local Mac mailing lists? I'm subscribed to 
[EMAIL PROTECTED] already.
2. What are your favorite/must have utilities?

BBEdit, worth every penny.  This editor was designed with the Perl 
programmer in mind (though it also works nicely with AppleScript, and 
any shell-based scripting language like Python or Ruby).  If you know 
Perl, and perhaps a little AppleScript (just enough to call a Perl 
script), you can extend BBEdit in so many ways.  Download the free 
trial (not BBEdit Lite, rather the full-version trial) from 
http://www.barebones.com/ and put it through its paces, you get 24 days 
(I think).  I had a job last year programming in PHP, where I was 
fortunate enough to get to use a Mac, and I have to say that this text 
editor

3. Are you using Mail for email? Plusses & minuses are welcome.


Yes.  Pluses include the sweet control over quoting and the spam filter 
system (very smoothly integrated) in a nice Cocoa interface.  Minuses 
include slight slowness (perhaps more so on your more venerable 
machine), not very powerful feature set compared to Eudora and others 
-- for instance, you can't choose to download HTML images on a 
per-email basis which would be nice for those of us who leave this 
turned off but occasionally would like to view an email in HTML format.

I hated Mail when it first came out but Apple did improve it quite a 
bit.  I can't say it has any single feature that makes it a killer app, 
it's just the way that Mail integrates with everything that makes it 
feel like an extension of the OS, sort of.  Like right now I'm 
composing this email in Mail, and if I had you in my iChat buddy list 
then I'd see a little green dot if you were online right now.  This is 
really hardly worth switching over from Eudora if you know and love it, 
but if you just grow into using Mail, it becomes very comfortable.

Also, I appreciate that it is smoothly integrated with Address Book, 
which I keep iSynced to my Treo, though I'm sure you'll see lots more 
software that hooks into Address Book in the future.  I think Mozilla 
has a nice mail client too, and I use that at work (on Win32), but 
there are things that I find myself missing from Mail.app when I am at 
work.

4. More in-depth books than "Missing Manual". Hints on hardware 
especially helpful.

"MacOS X Unleashed" looked good (more in-depth and less introductory 
than "Missing Manual", but I didn't read it.  I'm reading "Learning 
Cocoa w/Obj-C" and I think it's a good book so far, but I don't think 
it's terribly in-depth.  It's an introductory book.

6. Any other tips for a windows convert.


Since you're on a Perl mailing list, I'll assume you're interested in 
development -- make sure you've installed the Developer Tools.  It's a 
hefty few hundred MB but it's well worth it.  You get gcc and also 
Project Builder, which is Apple's IDE for Cocoa and Java programming, 
plus the Java SDK (soon to support 1.4.1 IIRC) and other GUI/CLI 
utilities.

It's not Linux, so I think that those who approach it thinking that all 
Mac software is going to be open source/free are going to be 
disappointed.  But just about any open source Unix app should run on 
MacOS X.  Use Fink ( http://fink.sourceforge.net ) if you would like a 
package manager for historically-Unix software like XFree86 or the 
Gimp.  (But if you prefer to roll your own, gcc comes with the 
Developer Tools.)

More and more I'm becoming comfortable with the ways that the OS is 
well-integrated with the applications, and applications are 
well-integrated with each other.  Sometimes I wonder if I should be 
afraid (a la Windows' integration with Internet Explorer), but none of 
the integrations are "required", so it's a win/win situation.

Performance wise, it helps to have a lot of RAM.  I'm assuming that on 
your beige you'll experience similar.  It feels like the OS was 
designed to take advantage of the kind of hardware that will be rolling 
out over the next couple of years -- forward thinking, but a bit 
debilitating for those of us who are using the machines of today or 
yesterday. The JVM is dog slow.  I have a 500mHz G3 w/384MB and it's 
just not worth running most large Java apps (plus they kind of stand 
out against the "native" Cocoa/Carbon apps on MacOS X).  This is 
especially sore for me because I like Java and develop with it at work.

I really love MacOS X -- it's not completely faultless, but it gives me 
the power and features of Linux but without making me micromanage every 
little detail of the OS.  You can micromanage if you want -- but if you 
just want to get stuff done, the OS pretty much takes care of itself.



Erik



--
Erik Price

email: [EMAIL PROTECTED]
jabber: [EMAIL PROTECTED]




Re: [Boston.pm] for loop iterator variable -- !?

2002-11-22 Thread Erik Price

On Friday, November 22, 2002, at 12:54  AM, darren chamberlain wrote:


But
$#array scares away Python weenies ("too much punctuation"), so maybe
there's some value there... :)


I knew there was a reason I didn't like it!  :)


Erik





--
Erik Price   (zombies roam)

email: [EMAIL PROTECTED]
jabber: [EMAIL PROTECTED]

___
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm



Re: [Boston.pm] for loop iterator variable -- !?

2002-11-22 Thread Erik Price

On Thursday, November 21, 2002, at 11:47  PM, Andrew M. Langmead wrote:


quicker? Its the same number of opcodes. the pp_av2arylen that $#array
uses is a little bit bigger than the pp_scalar used by scalar@array,
but that is probably offset by the more convoluted path that
scalar@array takes through rv2av.

This would be an odd place to look to for efficiency. Anyone who wants
to disagree with me can discuss it over coffee tomorrow in
boston.com's kitchen. The usual time.


Quicker to write.  "I busted out a quick Perl script to grab those 
contacts out of LDAP."  Not referring to performance.


Erik




--
Erik Price   (zombies roam)

email: [EMAIL PROTECTED]
jabber: [EMAIL PROTECTED]

___
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm


Re: [Boston.pm] for loop iterator variable -- !?

2002-11-21 Thread Erik Price

On Thursday, November 21, 2002, at 10:26  PM, darren chamberlain wrote:


, note that

  $n <= $#array

and

  $i <= @array

are not equivalent:  @array == $#array + 1


Doht.


Erik





--
Erik Price   (zombies roam)

email: [EMAIL PROTECTED]
jabber: [EMAIL PROTECTED]

___
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm



Re: [Boston.pm] for loop iterator variable -- !?

2002-11-21 Thread Erik Price

On Sunday, December 8, 2002, at 11:56  PM, Komtanoo Pinpimai wrote:


you see? It is not elegant.. has perl this iterator variable ?


Man!  And I thought one of the nice things about Perl was you didn't 
have to use an Iterator to traverse a List!

Iterator it = myList.iterator();
while (it.hasNext()) {
	MyObject mo = (MyObject)it.next();
	// do something with mo
}

(In all honesty, I really do think [Java/Python-style] iterators are 
cool, for situations that need them.  But it's admittedly more work 
than using a counter variable, so when you want to bang out some quick 
Perl, it's nice not to have to bother with it.)



Erik





--
Erik Price   (zombies roam)

email: [EMAIL PROTECTED]
jabber: [EMAIL PROTECTED]

___
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm


Re: [Boston.pm] for loop iterator variable -- !?

2002-11-21 Thread Erik Price

On Wednesday, November 20, 2002, at 03:43  PM, Duane Bronson wrote:


Anyway, to put your mind at ease, use the for(;;) syntax.  The big
difference is that you have to pull $_ out of the array yourself.

for (my $counter=0;$counter<=$#array;$counter++)
{
$_=$array[$counter];
#do something

print $another_array[$counter];
}


Or don't even bother with $#array since "$n <= @array" forces scalar 
context to the array, which causes it to interpolate to the number of 
elements.

Terser, quicker, more seductive.  Such is the way of the dark side of 
Perl programming.  (Even if by only one char.)



Erik





--
Erik Price   (zombies roam)

email: [EMAIL PROTECTED]
jabber: [EMAIL PROTECTED]

___
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm


Re: [Boston.pm] perl and .net

2002-11-09 Thread Erik Price

On Tuesday, November 5, 2002, at 02:33  PM, Charles Reitzel wrote:


None of the .NET CLR languages are standard, either de facto or de  
jure.  If you really want a Unicode-based, byte-code interpreter with  
garbage collection and reflection (and many folks do), just use Java.


I like Java and I'm all for any non-M$-only tech, but ...

http://www2.theserverside.com/home/ 
thread.jsp?thread_id=16149_count=690




--
Erik Price   (zombies roam)

email: [EMAIL PROTECTED]
jabber: [EMAIL PROTECTED]

___
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm


Re: [Boston.pm] RE: New Bull Community

2002-11-01 Thread Erik Price

On Wednesday, October 30, 2002, at 05:20  PM, Wizard wrote:


As far as I can tell, this is spam. The board only has a 27 forums that
TOTAL 38 posts. It seems that this is just an effort to generate 
traffic,
which leads me to believe that this 'Jeff Kirkland' has something to 
do with
the site. He is also one of only three members that has posted more 
than
once.
Grant M.

Cross-posted to GNHLUG too.




--
Erik Price   (zombies roam)

email: [EMAIL PROTECTED]
jabber: [EMAIL PROTECTED]

___
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm



Re: [Boston.pm] my understanding of tr must be wrong

2002-10-09 Thread Erik Price


--- Stephen Reppucci <[EMAIL PROTECTED]> wrote:
> 
> From 'perldoc perlop':
> 
>   If the REPLACEMENTLIST is
>   empty, the SEARCHLIST is replicated.  This latter
>   is useful for counting characters in a class or
>   for squashing character sequences in a class.
> 
> As Ronald suggested, use the /d qualifier.

Right -- I feel kind of foolish because I read that page of
"Programming Perl" looking for a /g qualifier (I was wondering if that
would change the results), but instead of reading what was there I just
saw that there was no /g.  If I had actually looked at what /d does,
then I would never have had to ask... sorry all and thanks for pointing
the way.

> (Am I the only one who rolls their eyes and coughs when I come
> across something like this in someone else's code? :
> 
>s/([^a-zA-Z])//g;

I don't remember posting it like that... if I did then it was a typo
b/c the code doesn't try to capture the removed data (that's why I'm
using tr/// in the first place).



Erik

__
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More
http://faith.yahoo.com
___
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm



[Boston.pm] my understanding of tr must be wrong

2002-10-07 Thread Erik Price

Here is a snippet of a script I am working on.  It doesn't do what I
expect, which is simply to remove all of the occurrences of certain
characters from a string using the transliteration (tr///) operator.

However, it works perfectly when I put those characters into a
character class, change the "tr" to "s", and do a regular
expression-based substitution with the "/g" modifier.

(Like this: s/[''""$ ,]//g)

So I must be misusing the transliteration operator -- can someone
please explain why it doesn't work?  I thought that this would replace
any incidence of the characters in the first string with the characters
in the second string -- in this case, removing them altogether.

Thank you,

Erik

PS: the quotes in the first string are duplicated b/c jEdit's syntax
highlighting gets messed up if I don't.



#!/usr/bin/perl -w
use strict;

unit_test();

# strip out the dollar signs and quotes from currency fields
sub clean_currency {
my $money = shift(@_);

$money =~ tr/''""$ ,//;
return $money;
}

# unit testing
sub unit_test {
# test clean_currency
my @currencies = ('$3,000', '$$4000',
  "'\$2,,'", '"00300"');
my @transformed_currencies;
foreach my $currency (@currencies) {
push(@transformed_currencies,
 clean_currency($currency));
}
print("clean_currency: @transformed_currencies\n");
}

__
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More
http://faith.yahoo.com
___
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm



Re: [Boston.pm] file uploads w/Perl CGI

2002-10-04 Thread Erik Price


On Friday, October 4, 2002, at 07:12  AM, John Tobey wrote:

> Then he has the combination of
>
> "MS Excel spreadsheet"
> "parsed"
> "Solaris server"
>
> which, while I have not tried to do it recently, would certainly have
> been painful in the past.  I imagine it is still a pretty imprecise
> science, though I'll be happy to be proved wrong.
>
> Can you require users to save the spreadsheet in a non-Excel format
> such as tab-delimited for uploading?

I forgot to mention that this is exactly what I'm doing.  The script 
does this:

# sometimes there is a newline in the user data, if so
# then remove it
while () {
chomp($_) if ($_ !~ m/\t{20,}/);
print TEMPFILE $_;
}

# open and loop through TEMPFILE, parsing each line

The hard part is that I have zero control over the server 
configuration, so I can't use certain kinds of modules that have to be 
installed.  That's why I'm not using the Excel parse modules (though I 
thought about it).


Erik




--
Erik Price   (zombies roam)

email: [EMAIL PROTECTED]
jabber: [EMAIL PROTECTED]

___
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm



[Boston.pm] file uploads w/Perl CGI

2002-10-03 Thread Erik Price

A quick question --

Can anyone explain the "theory" of file uploads via browser to me?  I 
have a MS Excel spreadsheet that needs to get uploaded to a server 
periodically and parsed.  I've written a script to do this on the 
localhost.  But I've been asked to make this available as a 
browser-based upload, so that users can upload the spreadsheet and it 
will get parsed when it is uploaded.  The details I can research, but 
the underlying concept -- anyone have a rough outline of the process 
they can describe to me?

Thanks,

Erik

PS: I don't have any administrative privileges on this server, so I 
can't use any modules that need to be installed as root or which 
require additional tools ... this Solaris server doesn't even seem to 
have the bash shell.  :(





--
Erik Price   (zombies roam)

email: [EMAIL PROTECTED]
jabber: [EMAIL PROTECTED]

___
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm



Re: [Boston.pm] $/ and pattern matching

2002-09-24 Thread Erik Price


On Tuesday, September 24, 2002, at 08:18  AM, darren chamberlain wrote:

> I'd do it a little differently:
>
>   local $/;
>   my $mileage;
>   my @milage = split //, ; # <-- the string with your data
>
>   for (@milage) {
>   if (m/(\d+\.\d{1,2})$/) {
>   $mileage += $1;
>   }
>   }

Oho!  Good idea -- I had forgotten that  can be used in split() (it 
evaluates to a list, after all, right?).  That's a great way to do it.

But I'm curious why you use "local $/" at the top -- it doesn't seem to 
be needed in this version.


Thanks,

Erik

PS: I'm trying to think of an elegant and simple way to read  if 
there is any standard input and read  if not.  Yes, I could just 
test for  != "" or something and use "if" statements, but that 
would basically mean repeating the same chunk of code with a different 
file handle inside the <>.  Any good ideas that let me just use the 
same block in either case?






--
Erik Price   (zombies roam)

email: [EMAIL PROTECTED]
jabber: [EMAIL PROTECTED]

___
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm



Re: [Boston.pm] $/ and pattern matching

2002-09-23 Thread Erik Price


On Monday, September 23, 2002, at 05:50  PM, Ronald J Kimball wrote:

> One way would be to interpolate the record separator into the regex:
>
> if (m,(\d+\.\d{1,2})\Q$/,) {

Ah!  I hadn't even though of that.  Of course, you can read from (and 
not -just- assign to) Perl's special variables too.  Good idea.

> However, it might be preferable to remove the record separator with
> chomp(), and then just match the end of the string with \z.  That way 
> you
> won't have a problem at the end of the file.

Right, that solves the problem.  I didn't know about the \z 
metacharacter.  It matches the end of the string only -- I assume that 
it's there for situations like this (when the value of $ is being 
messed with)?


Thank you,

Erik





--
Erik Price   (zombies roam)

email: [EMAIL PROTECTED]
jabber: [EMAIL PROTECTED]

___
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm



[Boston.pm] $/ and pattern matching

2002-09-23 Thread Erik Price

Anyone know of a way to get a regular expression to respect the input 
record separator ( $/ ), so that "$" represents the end of a line as 
defined by $/ ?

Here's my code:

#!/usr/bin/perl -w
use strict;

$/ = '';# my input data is not newline separated,
 # rather, it appears to be separated by four 
spaces
 # per record
my $mileage;

while () {
if (m/(\d+\.\d{1,2})$/) {
$mileage += $1;
}
}

print "$mileage total miles\n";

__DATA__
1.  Start on MILL ST 0.02.  Bear Left on MAIN ST 3.23.  
Continue on KENDALL RD 0.34.  Take the US-3 SOUTH ramp towards 
BOSTON/LOWELL 0.45.  Merge on US-3 SOUTH 18.7


In the above scenario, the input record separator is reset to four 
spaces as per the requirements of the data.  But the regular 
expression's "$" is still trying to match a true end-of-line, not my 
new definition of what an end-of-line is (four spaces).

Anyone have any ideas?

Erik

PS: Yes, I realize that this will cause the match to fail on the last 
record



--
Erik Price   (zombies roam)

email: [EMAIL PROTECTED]
jabber: [EMAIL PROTECTED]

___
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm



Re: [Boston.pm] OS X Perl Dev

2002-09-17 Thread Erik Price


On Tuesday, September 17, 2002, at 03:36  PM, James Linden Rose, III 
wrote:

> ANyone out there know how to use apache server and Perl built into 
> Apple OS X to do offline CGI development in Perl?  I wouldn't know 
> even where to begin... spoon feed instructions requested.

Just turn your web sharing on in the Sharing system preferences.  Then 
read this file:

/Library/Documentation/Services/apache/howto/cgi.html.en

Basically you just have to write a Perl script, make it readable to the 
HTTP user (I think it might be "web" on Mac OS X, I forget) or 
"others", then write a web page that calls the Perl script as the 
"action" attribute of its form.

The document URL above will tell you what you need to know.





--
Erik Price  (zombies 
roam)

email: [EMAIL PROTECTED]
jabber: [EMAIL PROTECTED]

___
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm



Re: [Boston.pm] Prototypes for object methods?

2002-09-12 Thread Erik Price


On Thursday, September 12, 2002, at 11:45  AM, Drew Taylor wrote:

> I have always operated under the assumption that within a 
> module/object it's OK to access members directly. Outside the module I 
> always use accessors/mutators. What do others think?

Unless there's a coding standard, isn't it personal preference?




Erik





--
Erik Price  (zombies 
roam)

email: [EMAIL PROTECTED]
jabber: [EMAIL PROTECTED]

___
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm