From comdog at computerdog.com Wed Nov 11 20:25:40 1998 From: comdog at computerdog.com (brian d foy) Date: Thu Aug 5 00:28:59 2004 Subject: test 2 Message-ID: test 2 -- brian d foy NY.pm - the New York City Perl Mongers style guide From comdog at computerdog.com Wed Nov 11 20:40:16 1998 From: comdog at computerdog.com (brian d foy) Date: Thu Aug 5 00:28:59 2004 Subject: this is you Message-ID: this is another tet -- brian d foy NY.pm - the New York City Perl Mongers style guide From comdog at computerdog.com Wed Nov 11 20:52:25 1998 From: comdog at computerdog.com (brian d foy) Date: Thu Aug 5 00:28:59 2004 Subject: test Message-ID: test -- brian d foy NY.pm - the New York City Perl Mongers style guide From comdog at computerdog.com Wed Nov 11 21:01:04 1998 From: comdog at computerdog.com (brian d foy) Date: Thu Aug 5 00:28:59 2004 Subject: test2 Message-ID: testoroni -- brian d foy NY.pm - the New York City Perl Mongers style guide From comdog at computerdog.com Wed Nov 11 21:52:26 1998 From: comdog at computerdog.com (brian d foy) Date: Thu Aug 5 00:28:59 2004 Subject: test 3 Message-ID: test 4 -- brian d foy NY.pm - the New York City Perl Mongers style guide From comdog at computerdog.com Wed Nov 11 22:09:35 1998 From: comdog at computerdog.com (brian d foy) Date: Thu Aug 5 00:28:59 2004 Subject: this is you Message-ID: this is me -- brian d foy NY.pm - the New York City Perl Mongers style guide From comdog at computerdog.com Wed Nov 11 22:11:02 1998 From: comdog at computerdog.com (brian d foy) Date: Thu Aug 5 00:28:59 2004 Subject: test 6 Message-ID: test 6 -- brian d foy NY.pm - the New York City Perl Mongers style guide From comdog at computerdog.com Wed Nov 11 22:12:52 1998 From: comdog at computerdog.com (brian d foy) Date: Thu Aug 5 00:28:59 2004 Subject: text 7 Message-ID: test 7 -- brian d foy NY.pm - the New York City Perl Mongers style guide From comdog at computerdog.com Thu Nov 12 08:39:53 1998 From: comdog at computerdog.com (brian d foy) Date: Thu Aug 5 00:28:59 2004 Subject: test 7 Message-ID: test 7 -- brian d foy NY.pm - the New York City Perl Mongers style guide From tidbit at smithrenaud.com Thu Nov 12 09:51:18 1998 From: tidbit at smithrenaud.com (brian d foy) Date: Thu Aug 5 00:28:59 2004 Subject: test 7 In-Reply-To: Message-ID: On Thu, 12 Nov 1998, brian d foy wrote: > > test 7 this is another test -- brian d foy Director of Technology 875 Avenue of the Americas, 2510, New York, NY 10001 V: (212) 239-8985 From ptimmins at netserv.unmc.edu Thu Nov 12 11:13:25 1998 From: ptimmins at netserv.unmc.edu (ptimmins@netserv.unmc.edu) Date: Thu Aug 5 00:28:59 2004 Subject: Can an Ass Post From Dejanews? Message-ID: <199811121713.LAA07480@x5.dejanews.com> * * TESTING * * Well? Can spammers send from dejanews using a valid mailing list name? The message below was attached by dejanews automatically and sent to hfb@happyfunball.pm.org with the 'from' filled in as ptimmins@netserv.unmc.edu . Will it be passed on to the list? * * TESTING * * ------------------------------------------------------------------------------ This message was forwarded to you from Deja News by ptimmins@netserv.unmc.edu. Deja News, the discussion network, offers free web-based access to more than 50,000 high-quality discussion forums. Come and visit us on the web at http://www.dejanews.com/=zzz_maf/ ------------------------------------------------------------------------------ Sponsored by: Audio Book Club Join and get 4 bestselling audiobooks 1c http://www.audiobookclub.com/micro/home.asp?AID=S036L004B009 ------------------------------------------------------------------------------ (beginning of original message) Subject: Re: calling by reference From: ptimmins@netserv.unmc.edu (Patrick Timmins) Date: 1998/11/11 Newsgroups: comp.lang.perl.misc In article <72ch8j$mnm$1@cnn.cc.biu.ac.il>, "Avshi Avital" wrote: > hi guys (and gals), > the following sub excepts a string and returns the last word: > > sub get_word { > $_[0] =~ s/\b([^\s]*?)\s*$//; > return $1; > } > > obviously it doesn't change the value of the input string (though it > DOES change $_[0] - locally). > what if I wanted it to change it's value (that is: return the last word, > and shorten the input string by one word)? > i suppose it's some use of reference (\)? You could shift in the $input to sub get_word using the same variable name, thus overwriting it with the subroutine's transformation. Then just return the part you want as usual (note I changed your regex): $input = "Bill Clinton is Damned Good!"; print "Before : $input\n"; $trimmed = get_word($input); print "After: $input\n"; print "$trimmed\n"; sub get_word { $input = shift; $input =~ s/(.*)\s+([\S]+)\s*$/$1/; return $2; } __END__ gives: Before : Bill Clinton is Damned Good! After: Bill Clinton is Damned Good! Hope that helps. Patrick Timmins $monger{Omaha}[0] -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own (end of original message) ------------------------------------------------------------------------------ You can view this message and the related discussion by following this link: http://www.dejanews.com/=zzz_maf/dnquery.xp?search=thread&svcclass=dnserver&recnum=%3c72d7db$j39$1@nnrp1.dejanews.com%3e%231/1 We hope to see you soon at Deja News, the discussion network. http://www.dejanews.com/=zzz_maf/ From comdog at computerdog.com Mon Nov 16 19:50:07 1998 From: comdog at computerdog.com (brian d foy) Date: Thu Aug 5 00:28:59 2004 Subject: if this works, free lists for everyone! Message-ID: please reply to this message. i want to make sure people get it and replies are handled correctly. once that is settled, i start setting up lists! -- brian d foy NY.pm - the New York City Perl Mongers style guide