From tim at consultix-inc.com Mon Feb 7 10:06:27 2005 From: tim at consultix-inc.com (Tim Maher) Date: Mon Feb 7 10:06:51 2005 Subject: SPUG: Tim M. speaking on "Minimal Perl" to UNIX group 2/8 Message-ID: <20050207180627.GA180@jumpy.consultix-inc.com> Here's the announcement of my talk for tomorrow night; all are welcome! -Tim ============================================================== | Tim Maher, Ph.D. tim(AT)TeachMePerl.com | | SPUG Leader Emeritus spug(AT)TeachMePerl.com | | Seattle Perl Users Group http://www.SeattlePerl.com | ============================================================== Good day fellow SeaSLUG members, I invite each of you to the monthly Seattle Unix Users group this Tuesday, Jan. 11th at 7:00 PM. This meeting will be held at the TEK Systems at 1120 11th Ave. in Bellevue. The meeting room is on the 4th floor (Room number 420) of the East building. The building is located at the SE corner of NE 12 St. (E-W St.) and 112th Ave. NE (N-S Ave.). There are three buildings (West, East and South). Parking is available below the building, although it may be easier to park across the street in a large open parking lot (NE corner of the intersection). The February 2005 meeting for the Seattle Unix Group will have one main presentation. We welcome Dr. Tim Maher of Consultix, who will speak on "Minimal Perl for UNIX and Linux People" ABOUT THE TALK: Many UNIX and Linux people would like to learn Perl, but they've heard the language is "weird", and perhaps even "write-only", which gives them pause. Add to this the daunting proposition of grappling with a Camel book (1,092 pages) or even a relatively diminutive Llama book (316 pages), and many decide to make do with what they already know. But really, UNIX people don't have to learn much Perl to begin to reap its rewards. That's because Perl encompasses the functionality of certain core UNIX commands, including grep, sed, and awk, and can be easily approached as as an enhancement on those. This talk illustrates the core features of the Minimal Perl approach through one-liners and scripts that are of general interest and applicability to UNIX people. See http://TeachMePerl.com/publications/5perlcmds.pdf for sample one-liners. See http://teachmeperl.com for information about Tim's upcoming book that has the same title as this talk. ABOUT THE SPEAKER: Since 1982, Tim Maher of Seattle-based Consultix has taught many thousands of software professionals to program in Unix-related languages. He's the developer of the first Perl beautifier, the founder of the Seattle Perl Users Group (SPUG), the author of Manning's "Minimal Perl for UNIX and Linux People", a winner of the Perl community's White Camel award, and a frequent speaker at Perl conferences. We hope to see you at the meeting. Bring your Unix/Linux ideas, problems and experiences. Spread the word and bring a friend. *--------------------------------------------------------------------------* | Tim Maher, PhD (206) 781-UNIX (866) DOC-PERL (866) DOC-UNIX | | tim(AT)Consultix-Inc.Com http://TeachMePerl.Com http://TeachMeUnix.Com | *+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-* | Watch for my upcoming book: "Minimal Perl for UNIX/Linux People" | *--------------------------------------------------------------------------* From atomic at wyrdtech.com Wed Feb 9 12:52:47 2005 From: atomic at wyrdtech.com (Atom Powers) Date: Wed Feb 9 12:53:10 2005 Subject: SPUG: Inspired, broken. Message-ID: <420A781F.7040600@wyrdtech.com> Inspired by last night's presentation at the Seattle Unix Group I put together this perl one-liner to grab email addresses out of a file. It works, but I need to save the output to a file, "recipients.txt", and I'm having trouble. What is the best way to save the output to a file? #perl5 -wnl -e 'm/\w+@\w+\.\w{3}/ and print lc($&)." OK";' address_list.txt I've tried this: >perl5 -wnl -e 'm/\w+@\w+\.\w{3}/ and print lc($&)." OK";' address_list.txt > recipients.txt recipients.txt: Permission denied. And this: >perl5 -wnl -e 'm/\w+@\w+\.\w{3}/ and print { ">recipients" } lc($&)." OK";' address_list.txt print() on unopened filehandle >recipients at -e line 1, <> line 1225. print() on unopened filehandle >recipients at -e line 1, <> line 1227. print() on unopened filehandle >recipients at -e line 1, <> line 1228. print() on unopened filehandle >recipients at -e line 1, <> line 1229. print() on unopened filehandle >recipients at -e line 1, <> line 1232. -- -- Perfection is just a word I use occasionally with mustard. --Atom Powers-- From tim at consultix-inc.com Wed Feb 9 13:11:24 2005 From: tim at consultix-inc.com (Tim Maher) Date: Wed Feb 9 13:11:39 2005 Subject: SPUG: Inspired, broken. In-Reply-To: <420A781F.7040600@wyrdtech.com> References: <420A781F.7040600@wyrdtech.com> Message-ID: <20050209211124.GA24116@jumpy.consultix-inc.com> On Wed, Feb 09, 2005 at 12:52:47PM -0800, Atom Powers wrote: > Inspired by last night's presentation at the Seattle Unix Group I put Glad to hear that! 8-} > together this perl one-liner to grab email addresses out of a file. > It works, but I need to save the output to a file, "recipients.txt", and > I'm having trouble. > What is the best way to save the output to a file? > > #perl5 -wnl -e 'm/\w+@\w+\.\w{3}/ and print lc($&)." OK";' address_list.txt > > I've tried this: > >perl5 -wnl -e 'm/\w+@\w+\.\w{3}/ and print lc($&)." OK";' address_list.txt > recipients.txt > recipients.txt: Permission denied. That format /will/ work, assuming you're in a directory for which you have write permission when you issue the command. As a general rule, you should backslash the @ within the matching operator's // delimiters, because it will in some cases be taken for the start of an array name otherwise. And double-quotes make string construction easier: BEFORE: > #perl5 -wnl -e 'm/\w+@\w+\.\w{3}/ and print lc($&)." OK";' address_list.txt AFTER: > #perl5 -wnl -e 'm/\w+\@\w+\.\w{3}/ and print "\L$&\E OK";' address_list.txt By the way, does that #perl mean that you were running the command as root? I wouldn't recommend that until you are more sure about what you're doing! > And this: > >perl5 -wnl -e 'm/\w+@\w+\.\w{3}/ and print { ">recipients" } lc($&)." > OK";' address_list.txt That's a good guess for how Perl might work for a guy who knows AWK, but it doesn't work that way in Perl. The output redirection approach is by far the easiest, so cd to an appropriate directory, and use that first command format again. -Tim *--------------------------------------------------------------------------* | Tim Maher, PhD (206) 781-UNIX (866) DOC-PERL (866) DOC-UNIX | | tim(AT)Consultix-Inc.Com http://TeachMePerl.Com http://TeachMeUnix.Com | *+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-* | Watch for my upcoming book: "Minimal Perl for UNIX/Linux People" | *--------------------------------------------------------------------------* From atomic at wyrdtech.com Wed Feb 9 13:27:48 2005 From: atomic at wyrdtech.com (Atom Powers) Date: Wed Feb 9 13:28:10 2005 Subject: SPUG: Inspired, broken. In-Reply-To: <20050209211124.GA24116@jumpy.consultix-inc.com> References: <420A781F.7040600@wyrdtech.com> <20050209211124.GA24116@jumpy.consultix-inc.com> Message-ID: <420A8054.6010808@wyrdtech.com> > > AFTER: > >>#perl5 -wnl -e 'm/\w+\@\w+\.\w{3}/ and print "\L$&\E OK";' address_list.txt > > By the way, does that #perl mean that you were running the command > as root? I wouldn't recommend that until you are more sure about > what you're doing! Yes, that was to indicate that I had tried to run it as root (using sudo). Now I'm only slightly confused. This doesn't work: ( I apologize for the line breaks ) apowers@hermes0:/home/mailman> sudo -u mailman perl5 -wnl -e 'm/\w+\@\w+\.\w{3}/ and print "\L$&\E OK";' address_list.txt > recipients.txt recipients.txt: Permission denied. But this does: apowers@hermes0:/usr/home/apowers> perl5 -wnl -e 'm/\w+\@\w+\.\w{3}/ and print "\L$&\E OK";' /usr/home/mailman/address_list.txt > recipients.txt Is sudo dropping privileges back to 'apowers' when it sees the '>'? From tim at consultix-inc.com Wed Feb 9 13:36:01 2005 From: tim at consultix-inc.com (Tim Maher) Date: Wed Feb 9 13:36:17 2005 Subject: SPUG: Inspired, broken. In-Reply-To: <420A8054.6010808@wyrdtech.com> References: <420A781F.7040600@wyrdtech.com> <20050209211124.GA24116@jumpy.consultix-inc.com> <420A8054.6010808@wyrdtech.com> Message-ID: <20050209213601.GA24818@jumpy.consultix-inc.com> On Wed, Feb 09, 2005 at 01:27:48PM -0800, Atom Powers wrote: > > > This doesn't work: ( I apologize for the line breaks ) > > apowers@hermes0:/home/mailman> sudo -u mailman perl5 -wnl -e > 'm/\w+\@\w+\.\w{3}/ and print "\L$&\E OK";' address_list.txt > > recipients.txt > recipients.txt: Permission denied. Apparently the mailman ID is attempting a write to the current directory, and it doesn't have permission there, so use a directory it can write to; for example: sudo -u mailman perl5 -wnl -e 'command' infile > /tmp/outfile -- *--------------------------------------------------------------------------* | Tim Maher, PhD (206) 781-UNIX (866) DOC-PERL (866) DOC-UNIX | | tim(AT)Consultix-Inc.Com http://TeachMePerl.Com http://TeachMeUnix.Com | *+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-* | Watch for my upcoming book: "Minimal Perl for UNIX/Linux People" | *--------------------------------------------------------------------------* From atomic at wyrdtech.com Wed Feb 9 13:43:14 2005 From: atomic at wyrdtech.com (Atom Powers) Date: Wed Feb 9 13:43:34 2005 Subject: SPUG: Inspired, broken. In-Reply-To: <20050209213601.GA24818@jumpy.consultix-inc.com> References: <420A781F.7040600@wyrdtech.com> <20050209211124.GA24116@jumpy.consultix-inc.com> <420A8054.6010808@wyrdtech.com> <20050209213601.GA24818@jumpy.consultix-inc.com> Message-ID: <420A83F2.6010509@wyrdtech.com> Tim Maher wrote: > On Wed, Feb 09, 2005 at 01:27:48PM -0800, Atom Powers wrote: > >>This doesn't work: ( I apologize for the line breaks ) >> >>apowers@hermes0:/home/mailman> sudo -u mailman perl5 -wnl -e >>'m/\w+\@\w+\.\w{3}/ and print "\L$&\E OK";' address_list.txt > >>recipients.txt >>recipients.txt: Permission denied. > > > Apparently the mailman ID is attempting a write to the > current directory, and it doesn't have permission there, > so use a directory it can write to; for example: > > sudo -u mailman perl5 -wnl -e 'command' infile > /tmp/outfile > Nope. Mailman has write permission to it's home drive. apowers@hermes0:/home> ll total 5 drwxr-xr-x 3 apowers UnixAdmins 512 Feb 9 13:35 apowers drwxr-xr-x 7 mailman mail 1024 Feb 9 08:39 mailman apowers@hermes0:/home> ll mailman/ total 270 drwxrwxr-x 3 mailman wheel 512 Jan 19 12:39 .spamassassin drwxr-xr-x 2 mailman mail 512 Feb 1 12:59 .ssh -rw-r--r-- 1 root mail 64566 Feb 9 00:00 address_list.txt drwxrwxr-x 2 mailman wheel 512 Feb 9 11:00 bin drwxrwxr-x 2 mailman mail 5120 Feb 9 00:00 mail drwxr-xr-x 121 mailman mail 41984 Feb 9 13:39 quarantine -rw-rw-r-- 1 mailman mail 21284 Feb 9 00:05 recipients.txt -rw-rw-r-- 1 mailman mail 65536 Feb 9 00:05 recipients.db -rw-rw-r-- 1 mailman wheel 82 Jan 19 13:26 recipients.proto From jlb at io.com Wed Feb 9 13:44:18 2005 From: jlb at io.com (jlb) Date: Wed Feb 9 13:44:33 2005 Subject: SPUG: Inspired, broken. In-Reply-To: <20050209213601.GA24818@jumpy.consultix-inc.com> References: <420A781F.7040600@wyrdtech.com> <20050209211124.GA24116@jumpy.consultix-inc.com> <420A8054.6010808@wyrdtech.com> <20050209213601.GA24818@jumpy.consultix-inc.com> Message-ID: <20050209153903.Y96063@eris.io.com> On Wed, 9 Feb 2005, Tim Maher wrote: > On Wed, Feb 09, 2005 at 01:27:48PM -0800, Atom Powers wrote: >>> >> This doesn't work: ( I apologize for the line breaks ) >> >> apowers@hermes0:/home/mailman> sudo -u mailman perl5 -wnl -e >> 'm/\w+\@\w+\.\w{3}/ and print "\L$&\E OK";' address_list.txt > >> recipients.txt >> recipients.txt: Permission denied. > > Apparently the mailman ID is attempting a write to the > current directory, and it doesn't have permission there, > so use a directory it can write to; for example: Actually, he's not writing the file as mailman. The redirection happens in his currently running shell, I'm pretty sure, not underneath sudo. It's the output of sudo he's redirecting, which happens as his current user. Example: jburdge@qadev ewa $ sudo /bin/bash -c '/bin/echo foo' > bar jburdge@qadev ewa $ sudo /bin/bash -c '/bin/echo foo > foo' jburdge@qadev ewa $ ls -al foo bar -rw-r--r-- 1 jburdge users 4 Feb 9 13:35 bar -rw-r--r-- 1 root root 4 Feb 9 13:35 foo jburdge@qadev ewa $ Properly quoted, he could probably do what he's trying to do now, or he could do what you suggested. From beldar at pobox.com Wed Feb 9 13:49:21 2005 From: beldar at pobox.com (Gardner Cohen) Date: Wed Feb 9 13:49:34 2005 Subject: SPUG: Inspired, broken. In-Reply-To: <420A8054.6010808@wyrdtech.com> References: <420A781F.7040600@wyrdtech.com> <20050209211124.GA24116@jumpy.consultix-inc.com> <420A8054.6010808@wyrdtech.com> Message-ID: <420A8561.8090005@pobox.com> Atom Powers wrote: > Is sudo dropping privileges back to 'apowers' when it sees the '>'? No. sudo has nothing to do with the ">". the shell sees "command" redirect file command happens to be sudo something, but the shell is running as you and does the redirect as you. There are several ugly and not so ugly workarounds. One is: yourcommand | sudo dd of=thatoutfile.txt (assuming yourcommand didn't need to run as root) another is to investigate sh -c "shell command with special characters". e.g. sudo /bin/sh -c "yourcommand > yourfile.txt" which will make the redirection happen in a shell running as root. Ah too late, someone already said mostly the same thing. From tim at consultix-inc.com Wed Feb 9 13:54:21 2005 From: tim at consultix-inc.com (Tim Maher) Date: Wed Feb 9 13:54:33 2005 Subject: SPUG: Inspired, broken. In-Reply-To: <420A83F2.6010509@wyrdtech.com> References: <420A781F.7040600@wyrdtech.com> <20050209211124.GA24116@jumpy.consultix-inc.com> <420A8054.6010808@wyrdtech.com> <20050209213601.GA24818@jumpy.consultix-inc.com> <420A83F2.6010509@wyrdtech.com> Message-ID: <20050209215421.GA25265@jumpy.consultix-inc.com> On Wed, Feb 09, 2005 at 01:43:14PM -0800, Atom Powers wrote: > > > >Apparently the mailman ID is attempting a write to the > >current directory, and it doesn't have permission there, > >so use a directory it can write to; for example: > > > >sudo -u mailman perl5 -wnl -e 'command' infile > /tmp/outfile > > > Nope. Mailman has write permission to it's home drive. Please confirm that mailmain ends up in its home directory and the permissions are okay by running: sudo -u mailman 'pwd; ls -ld . recipients.txt; touch newfile' I think you need to run sudo (which I rarely do) like this to make your command work: sudo -u mailman 'cd /home/mailman; pwd; ls -ld . recipients.txt; touch newfile' or else cd to ~mailman before running the command. -- *--------------------------------------------------------------------------* | Tim Maher, PhD (206) 781-UNIX (866) DOC-PERL (866) DOC-UNIX | | tim(AT)Consultix-Inc.Com http://TeachMePerl.Com http://TeachMeUnix.Com | *+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-* | Watch for my upcoming book: "Minimal Perl for UNIX/Linux People" | *--------------------------------------------------------------------------* From atomic at wyrdtech.com Wed Feb 9 14:00:53 2005 From: atomic at wyrdtech.com (Atom Powers) Date: Wed Feb 9 14:01:14 2005 Subject: SPUG: Inspired, broken. In-Reply-To: <420A8561.8090005@pobox.com> References: <420A781F.7040600@wyrdtech.com> <20050209211124.GA24116@jumpy.consultix-inc.com> <420A8054.6010808@wyrdtech.com> <420A8561.8090005@pobox.com> Message-ID: <420A8815.6010302@wyrdtech.com> Yes, that makes sense. Thank you. Incidently this is irrelevant, since the command will be run as part of a cron job which is run as mailman. -- Perfection is just a word I use occasionally with mustard. --Atom Powers-- Gardner Cohen wrote: > Atom Powers wrote: > >> Is sudo dropping privileges back to 'apowers' when it sees the '>'? > > > No. sudo has nothing to do with the ">". > > the shell sees "command" redirect file > > command happens to be sudo something, but the shell is running as you > and does the redirect as you. > > There are several ugly and not so ugly workarounds. One is: > > yourcommand | sudo dd of=thatoutfile.txt > > (assuming yourcommand didn't need to run as root) > > another is to investigate sh -c "shell command with special characters". > > e.g. > > sudo /bin/sh -c "yourcommand > yourfile.txt" > > which will make the redirection happen in a shell running as root. > > Ah too late, someone already said mostly the same thing. > From jlb at io.com Wed Feb 9 14:05:31 2005 From: jlb at io.com (jlb) Date: Wed Feb 9 14:05:40 2005 Subject: SPUG: Inspired, broken. In-Reply-To: <420A8561.8090005@pobox.com> References: <420A781F.7040600@wyrdtech.com> <20050209211124.GA24116@jumpy.consultix-inc.com> <420A8054.6010808@wyrdtech.com> <420A8561.8090005@pobox.com> Message-ID: <20050209160113.J970@eris.io.com> On Wed, 9 Feb 2005, Gardner Cohen wrote: > sudo /bin/sh -c "yourcommand > yourfile.txt" > > which will make the redirection happen in a shell running as root. Right, I was trying to avoid figuring out how to quote this properly because I hate messing with quotes but something like this is probably cleanest. sudo /bin/bash -c 'perl -wnl -e "m/\w+\@\w+\.\w{3}/ and print lc($&).q{ OK}" addresses.txt > outfile.txt' Although from the looks of your code, I think may be expecting that to potentially match more than one address per line, which it actually doesn't. If there is the possibility of two addresses being on one line, you'd want something like this. sudo /bin/bash -c 'perl -wnl -e "print lc($&).q{ OK} while m/\w+\@\w+\.\w{3}/g" addresses.txt > outfile.txt' I looked, but I didn't see a command line parameter to instruct perl to redirect stdout by default, to avoid all the /bin/bash nonsense. Anyone know of anything like that appropriate for one liners? The only thing close was -i, which isn't really waht you want. From atomic at wyrdtech.com Wed Feb 9 14:14:16 2005 From: atomic at wyrdtech.com (Atom Powers) Date: Wed Feb 9 14:14:37 2005 Subject: SPUG: Inspired, broken. In-Reply-To: <20050209160113.J970@eris.io.com> References: <420A781F.7040600@wyrdtech.com> <20050209211124.GA24116@jumpy.consultix-inc.com> <420A8054.6010808@wyrdtech.com> <420A8561.8090005@pobox.com> <20050209160113.J970@eris.io.com> Message-ID: <420A8B38.1010408@wyrdtech.com> > > Although from the looks of your code, I think may be expecting that to > potentially match more than one address per line, which it actually > doesn't. If there is the possibility of two addresses being on one > line, you'd want something like this. > > sudo /bin/bash -c 'perl -wnl -e "print lc($&).q{ OK} > while m/\w+\@\w+\.\w{3}/g" addresses.txt > outfile.txt' Nope, only one address per line. If there is more than one (or any country code domains either) then I don't want them. > I looked, but I didn't see a command line parameter to instruct perl to > redirect stdout by default, to avoid all the /bin/bash nonsense. Anyone > know of anything like that appropriate for one liners? > > The only thing close was -i, which isn't really waht you want. > I toyed with the idea of something like this: /usr/bin/perl5 -wnl -e 'm/\w+\@\w+\.\w{3}/ and open(DATA,">","recipients.txt") and print DATA "\L$&\E OK";' /usr/home/mailman/address_list.txt But I didn't know if reopening the file with every match would cause a problem. From jlb at io.com Wed Feb 9 14:17:38 2005 From: jlb at io.com (jlb) Date: Wed Feb 9 14:17:49 2005 Subject: SPUG: Inspired, broken. In-Reply-To: <420A8B38.1010408@wyrdtech.com> References: <420A781F.7040600@wyrdtech.com> <20050209211124.GA24116@jumpy.consultix-inc.com> <420A8054.6010808@wyrdtech.com> <420A8561.8090005@pobox.com> <20050209160113.J970@eris.io.com> <420A8B38.1010408@wyrdtech.com> Message-ID: <20050209161537.M970@eris.io.com> On Wed, 9 Feb 2005, Atom Powers wrote: >> The only thing close was -i, which isn't really waht you want. > > I toyed with the idea of something like this: > /usr/bin/perl5 -wnl -e 'm/\w+\@\w+\.\w{3}/ and > open(DATA,">","recipients.txt") and print DATA "\L$&\E OK";' > /usr/home/mailman/address_list.txt > > But I didn't know if reopening the file with every match would cause a > problem. It most likely wouldn't break, but it's certainly a bit ugly. Using -n, I believe you can use BEGIN and END blocks to open and close the file, (see the perldoc perlrun section about -n) but I was hoping there'd be something a little nicer or shorter to use in a "one-liner" format. Jon From jlb at io.com Wed Feb 9 14:20:17 2005 From: jlb at io.com (jlb) Date: Wed Feb 9 14:20:25 2005 Subject: SPUG: Inspired, broken. In-Reply-To: <20050209161537.M970@eris.io.com> References: <420A781F.7040600@wyrdtech.com> <20050209211124.GA24116@jumpy.consultix-inc.com> <420A8054.6010808@wyrdtech.com> <420A8561.8090005@pobox.com> <20050209160113.J970@eris.io.com> <420A8B38.1010408@wyrdtech.com> <20050209161537.M970@eris.io.com> Message-ID: <20050209161850.C970@eris.io.com> On Wed, 9 Feb 2005, jlb wrote: > On Wed, 9 Feb 2005, Atom Powers wrote: >> I toyed with the idea of something like this: >> /usr/bin/perl5 -wnl -e 'm/\w+\@\w+\.\w{3}/ and >> open(DATA,">","recipients.txt") and print DATA "\L$&\E OK";' >> /usr/home/mailman/address_list.txt > > It most likely wouldn't brek Actually, I didn't read through that all the way, I don't think the way you had it would work. I assumed you opened and closed the file each time through the loop, which would certainly work but would be a bit ugly, as I mentioned. From krahnj at telus.net Wed Feb 9 17:23:48 2005 From: krahnj at telus.net (John W. Krahn) Date: Wed Feb 9 17:24:15 2005 Subject: SPUG: Inspired, broken. In-Reply-To: <20050209211124.GA24116@jumpy.consultix-inc.com> References: <420A781F.7040600@wyrdtech.com> <20050209211124.GA24116@jumpy.consultix-inc.com> Message-ID: <420AB7A4.4080008@telus.net> Tim Maher wrote: > On Wed, Feb 09, 2005 at 12:52:47PM -0800, Atom Powers wrote: > >>Inspired by last night's presentation at the Seattle Unix Group I put > > > Glad to hear that! 8-} > > >>together this perl one-liner to grab email addresses out of a file. >>It works, but I need to save the output to a file, "recipients.txt", and >>I'm having trouble. >>What is the best way to save the output to a file? >> >>#perl5 -wnl -e 'm/\w+@\w+\.\w{3}/ and print lc($&)." OK";' address_list.txt >> >>I've tried this: >> >>>perl5 -wnl -e 'm/\w+@\w+\.\w{3}/ and print lc($&)." OK";' address_list.txt > recipients.txt >> >>recipients.txt: Permission denied. > > > That format /will/ work, assuming you're in a directory for which > you have write permission when you issue the command. > > As a general rule, you should backslash the @ within the matching > operator's // delimiters, because it will in some cases be taken > for the start of an array name otherwise. And double-quotes make > string construction easier: Of course it won't work if there are any \W characters in the user name or if the TLD isn't exactly three characters. This may work better: perl5 -nl -e'print"\L$_\E OK"for/(\S+\@[\w.-]+\.\w{2,})\b/g' address_list.txt > recipients.txt John -- use Perl; program fulfillment From mathin at mathin.com Fri Feb 11 09:23:16 2005 From: mathin at mathin.com (Dan Ebert) Date: Fri Feb 11 09:23:37 2005 Subject: SPUG: exec question Message-ID: I have a script which manages a bunch of other scripts. Basically it kicks off a specific script depending on the situation it sees when it runs. I want it to kick off the script then exit without waiting around for the other script to finish. I thought this would do it: # code to decide what script to use exec($script); but the manager script doesn't exit when it does the exec. Any ideas? Thanks, Dan. ---------------------------------------------------------- Immigration is the sincerest form of flattery. - Unknown ---------------------------------------------------------- From tim at consultix-inc.com Fri Feb 11 09:36:46 2005 From: tim at consultix-inc.com (Tim Maher) Date: Fri Feb 11 09:37:24 2005 Subject: SPUG: exec question In-Reply-To: References: Message-ID: <20050211173646.GA26153@jumpy.consultix-inc.com> On Fri, Feb 11, 2005 at 09:23:16AM -0800, Dan Ebert wrote: > I have a script which manages a bunch of other scripts. Basically it > kicks off a specific script depending on the situation it sees when it > runs. > > I want it to kick off the script then exit without waiting around for the > other script to finish. I thought this would do it: > > # code to decide what script to use > exec($script); > but the manager script doesn't exit when it does the exec. Any ideas? > Thanks, > > Dan. If $script contains the name of a file with a proper shebang line, and you're on UNIX or Linux, and $PATH is set to the directory $script is in or $script contains the pathname directory itself, then something like this might be what you're after: system "nohup $script > /tmp/output.$$ 2>&1 &" ; That command runs $script in the background (so the parent won't wait for it to complete), with STDOUT and STDERR redirected to a unique filename. -Tim *--------------------------------------------------------------------------* | Tim Maher, PhD (206) 781-UNIX (866) DOC-PERL (866) DOC-UNIX | | tim(AT)Consultix-Inc.Com http://TeachMePerl.Com http://TeachMeUnix.Com | *+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-* | Watch for my upcoming book: "Minimal Perl for UNIX/Linux People" | *--------------------------------------------------------------------------* From mathin at mathin.com Fri Feb 11 09:46:17 2005 From: mathin at mathin.com (Dan Ebert) Date: Fri Feb 11 09:46:34 2005 Subject: SPUG: exec question In-Reply-To: <20050211173646.GA26153@jumpy.consultix-inc.com> Message-ID: Here are some more details ... this is what I have: $script = '/home/dan/script.pl'; $config = '/home/dan/config.cfg'; $file_to_process = '/path/to/file'; exec($script,$config,$file_to_process); (The $script expects 2 commandline args, the config file and the file to process.) I don't need to capture STDOUT or STDERR (the script executed has logging built in to it). The solution you suggest will probably work, I'm just curious why exec isn't returning immediately and the script exiting. I thought that was what exec was supposed to do? Dan. ---------------------------------------------------------- Immigration is the sincerest form of flattery. - Unknown ---------------------------------------------------------- On Fri, 11 Feb 2005, Tim Maher wrote: > On Fri, Feb 11, 2005 at 09:23:16AM -0800, Dan Ebert wrote: > > I have a script which manages a bunch of other scripts. Basically it > > kicks off a specific script depending on the situation it sees when it > > runs. > > > > I want it to kick off the script then exit without waiting around for the > > other script to finish. I thought this would do it: > > > > # code to decide what script to use > > exec($script); > > but the manager script doesn't exit when it does the exec. Any ideas? > > Thanks, > > > > Dan. > > If $script contains the name of a file with a proper shebang line, > and you're on UNIX or Linux, and $PATH is set to the directory $script > is in or $script contains the pathname directory itself, then > something like this might be what you're after: > > system "nohup $script > /tmp/output.$$ 2>&1 &" ; > > That command runs $script in the background (so the parent won't > wait for it to complete), with STDOUT and STDERR redirected to > a unique filename. > > -Tim > *--------------------------------------------------------------------------* > | Tim Maher, PhD (206) 781-UNIX (866) DOC-PERL (866) DOC-UNIX | > | tim(AT)Consultix-Inc.Com http://TeachMePerl.Com http://TeachMeUnix.Com | > *+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-* > | Watch for my upcoming book: "Minimal Perl for UNIX/Linux People" | > *--------------------------------------------------------------------------* > From tim at consultix-inc.com Fri Feb 11 09:57:44 2005 From: tim at consultix-inc.com (Tim Maher) Date: Fri Feb 11 09:58:02 2005 Subject: SPUG: exec question In-Reply-To: References: <20050211173646.GA26153@jumpy.consultix-inc.com> Message-ID: <20050211175744.GA27159@jumpy.consultix-inc.com> On Fri, Feb 11, 2005 at 09:46:17AM -0800, Dan Ebert wrote: > > Here are some more details ... this is what I have: > > $script = '/home/dan/script.pl'; > $config = '/home/dan/config.cfg'; > $file_to_process = '/path/to/file'; > > exec($script,$config,$file_to_process); The problem is that exec blows away your current Perl process, and runs $script in its place. That's why your original Perl process is never heard from again! > (The $script expects 2 commandline args, the config file and the file to > process.) > > I don't need to capture STDOUT or STDERR (the script executed has logging > built in to it). > > The solution you suggest will probably work, I'm just curious why exec > isn't returning immediately and the script exiting. I thought that was > what exec was supposed to do? Nope! Exec overwrites the memory image of the current process with that of the named program. You either want to use "system", which uses the OS to start a new process for the script, or use "fork" before the "exec", which will do what system does, but takes a bit more coding and know-how to get right. *--------------------------------------------------------------------------* | Tim Maher, PhD (206) 781-UNIX (866) DOC-PERL (866) DOC-UNIX | | tim(AT)Consultix-Inc.Com http://TeachMePerl.Com http://TeachMeUnix.Com | *+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-* | Watch for my upcoming book: "Minimal Perl for UNIX/Linux People" | *--------------------------------------------------------------------------* From charles.e.derykus at boeing.com Fri Feb 11 09:58:28 2005 From: charles.e.derykus at boeing.com (DeRykus, Charles E) Date: Fri Feb 11 09:58:56 2005 Subject: SPUG: exec question Message-ID: <5DF8FDE8DFE8744388602480FDCC0E3106CF10A8@xch-nw-23.nw.nos.boeing.com> You might check for an error: exec($script,$config,$file_to_process) or warn "exec failed: $!"; -- Charles DeRykus -----Original Message----- From: Dan Ebert [mailto:mathin@mathin.com] Sent: Friday, February 11, 2005 9:46 AM Cc: spug-list@mail.pm.org Subject: Re: SPUG: exec question Here are some more details ... this is what I have: $script = '/home/dan/script.pl'; $config = '/home/dan/config.cfg'; $file_to_process = '/path/to/file'; exec($script,$config,$file_to_process); (The $script expects 2 commandline args, the config file and the file to process.) I don't need to capture STDOUT or STDERR (the script executed has logging built in to it). The solution you suggest will probably work, I'm just curious why exec isn't returning immediately and the script exiting. I thought that was what exec was supposed to do? Dan. ---------------------------------------------------------- Immigration is the sincerest form of flattery. - Unknown ---------------------------------------------------------- On Fri, 11 Feb 2005, Tim Maher wrote: > On Fri, Feb 11, 2005 at 09:23:16AM -0800, Dan Ebert wrote: > > I have a script which manages a bunch of other scripts. Basically > > it kicks off a specific script depending on the situation it sees > > when it runs. > > > > I want it to kick off the script then exit without waiting around > > for the other script to finish. I thought this would do it: > > > > # code to decide what script to use > > exec($script); > > but the manager script doesn't exit when it does the exec. Any > > ideas? Thanks, > > > > Dan. > > If $script contains the name of a file with a proper shebang line, and > you're on UNIX or Linux, and $PATH is set to the directory $script is > in or $script contains the pathname directory itself, then something > like this might be what you're after: > > system "nohup $script > /tmp/output.$$ 2>&1 &" ; > > That command runs $script in the background (so the parent won't wait > for it to complete), with STDOUT and STDERR redirected to a unique > filename. > > -Tim > *--------------------------------------------------------------------- > -----* > | Tim Maher, PhD (206) 781-UNIX (866) DOC-PERL (866) DOC-UNIX | > | tim(AT)Consultix-Inc.Com http://TeachMePerl.Com > | http://TeachMeUnix.Com | > *+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ > -+-+-* > | Watch for my upcoming book: "Minimal Perl for UNIX/Linux People" | > *--------------------------------------------------------------------- > -----* > _____________________________________________________________ Seattle Perl Users Group Mailing List POST TO: spug-list@pm.org SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list MEETINGS: 3rd Tuesdays, Location: Amazon.com Pac-Med WEB PAGE: http://seattleperl.org/ From ben at reser.org Fri Feb 11 10:10:15 2005 From: ben at reser.org (Ben Reser) Date: Fri Feb 11 10:10:37 2005 Subject: SPUG: exec question In-Reply-To: <20050211173646.GA26153@jumpy.consultix-inc.com> References: <20050211173646.GA26153@jumpy.consultix-inc.com> Message-ID: <20050211181015.GW2721@synapse.brain.org> On Fri, Feb 11, 2005 at 09:36:46AM -0800, Tim Maher wrote: > If $script contains the name of a file with a proper shebang line, > and you're on UNIX or Linux, and $PATH is set to the directory $script > is in or $script contains the pathname directory itself, then > something like this might be what you're after: > > system "nohup $script > /tmp/output.$$ 2>&1 &" ; > > That command runs $script in the background (so the parent won't > wait for it to complete), with STDOUT and STDERR redirected to > a unique filename. Ugh that's just ugly. And runs a shell in the process. Surely that's not what he really wants. From what it sounds like exec is what he wants, I'm not sure why it's not working right. Perhaps he's misunderstanding what it does. But someone else in the thread already mentioned it. Anyway, from a security standpoint, don't ever do stuff like what Tim showed you above. If you're passing arguments, then you have to worry about those arguments having shell meta characters in them... -- Ben Reser http://ben.reser.org "Conscience is the inner voice which warns us somebody may be looking." - H.L. Mencken From charles.e.derykus at boeing.com Fri Feb 11 10:24:23 2005 From: charles.e.derykus at boeing.com (DeRykus, Charles E) Date: Fri Feb 11 10:24:50 2005 Subject: SPUG: exec question Message-ID: <5DF8FDE8DFE8744388602480FDCC0E3106CF10A9@xch-nw-23.nw.nos.boeing.com> Never mind... I exec'ed a dumb answer. It is good form to check for errors BTW but see Tim's answer. -- Charles -----Original Message----- From: DeRykus, Charles E Sent: Friday, February 11, 2005 9:58 AM To: Dan Ebert Cc: spug-list@mail.pm.org Subject: RE: SPUG: exec question You might check for an error: exec($script,$config,$file_to_process) or warn "exec failed: $!"; -- Charles DeRykus -----Original Message----- From: Dan Ebert [mailto:mathin@mathin.com] Sent: Friday, February 11, 2005 9:46 AM Cc: spug-list@mail.pm.org Subject: Re: SPUG: exec question Here are some more details ... this is what I have: $script = '/home/dan/script.pl'; $config = '/home/dan/config.cfg'; $file_to_process = '/path/to/file'; exec($script,$config,$file_to_process); (The $script expects 2 commandline args, the config file and the file to process.) I don't need to capture STDOUT or STDERR (the script executed has logging built in to it). The solution you suggest will probably work, I'm just curious why exec isn't returning immediately and the script exiting. I thought that was what exec was supposed to do? Dan. ---------------------------------------------------------- Immigration is the sincerest form of flattery. - Unknown ---------------------------------------------------------- On Fri, 11 Feb 2005, Tim Maher wrote: > On Fri, Feb 11, 2005 at 09:23:16AM -0800, Dan Ebert wrote: > > I have a script which manages a bunch of other scripts. Basically > > it kicks off a specific script depending on the situation it sees > > when it runs. > > > > I want it to kick off the script then exit without waiting around > > for the other script to finish. I thought this would do it: > > > > # code to decide what script to use > > exec($script); > > but the manager script doesn't exit when it does the exec. Any > > ideas? Thanks, > > > > Dan. > > If $script contains the name of a file with a proper shebang line, and > you're on UNIX or Linux, and $PATH is set to the directory $script is > in or $script contains the pathname directory itself, then something > like this might be what you're after: > > system "nohup $script > /tmp/output.$$ 2>&1 &" ; > > That command runs $script in the background (so the parent won't wait > for it to complete), with STDOUT and STDERR redirected to a unique > filename. > > -Tim > *--------------------------------------------------------------------- > -----* > | Tim Maher, PhD (206) 781-UNIX (866) DOC-PERL (866) DOC-UNIX | > | tim(AT)Consultix-Inc.Com http://TeachMePerl.Com > | http://TeachMeUnix.Com | > *+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ > -+-+-* > | Watch for my upcoming book: "Minimal Perl for UNIX/Linux People" | > *--------------------------------------------------------------------- > -----* > _____________________________________________________________ Seattle Perl Users Group Mailing List POST TO: spug-list@pm.org SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list MEETINGS: 3rd Tuesdays, Location: Amazon.com Pac-Med WEB PAGE: http://seattleperl.org/ _____________________________________________________________ Seattle Perl Users Group Mailing List POST TO: spug-list@pm.org SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list MEETINGS: 3rd Tuesdays, Location: Amazon.com Pac-Med WEB PAGE: http://seattleperl.org/ From tim at consultix-inc.com Fri Feb 11 10:54:43 2005 From: tim at consultix-inc.com (Tim Maher) Date: Fri Feb 11 10:55:01 2005 Subject: SPUG: exec question In-Reply-To: <20050211181015.GW2721@synapse.brain.org> References: <20050211173646.GA26153@jumpy.consultix-inc.com> <20050211181015.GW2721@synapse.brain.org> Message-ID: <20050211185443.GA28281@jumpy.consultix-inc.com> On Fri, Feb 11, 2005 at 10:10:15AM -0800, Ben Reser wrote: > > Anyway, from a security standpoint, don't ever do stuff like > what Tim showed you above. If you're passing arguments, then > you have to worry about those arguments having shell meta > characters in them... > Ben Reser Ben, Regarding the difference in interpretation between the single-argument vs. multi-argument version of system, in the example I showed, metacharacter interpretation was /desired/, which is precisely why I showed the single-argument version. The metacharacters that needed interpretation included the ">" for output redirection, which I thought the original poster might need, and the "&" for background execution, which he definitely needs if he wants his script not to wait for the shell command to exit before continuing (unless he wants to do the fork/exec himself). Your statement "don't ever do stuff like what Tim showed you" is really uncalled for, and may discourage people from using features that can benefit them! There's no need to be afraid of the shell if you take appropriate precautions, which comes down to quoting funny characters that you want taken literally. See http://www.TeachMeUnix.com/quoting.html for a detailed discussion of the proper use of shell quoting techniques. -Tim *--------------------------------------------------------------------------* | Tim Maher, PhD (206) 781-UNIX (866) DOC-PERL (866) DOC-UNIX | | tim(AT)Consultix-Inc.Com http://TeachMePerl.Com http://TeachMeUnix.Com | *+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-* | Watch for my upcoming book: "Minimal Perl for UNIX/Linux People" | *--------------------------------------------------------------------------* From tim at consultix-inc.com Fri Feb 11 10:57:30 2005 From: tim at consultix-inc.com (Tim Maher) Date: Fri Feb 11 10:57:58 2005 Subject: SPUG: exec question In-Reply-To: <20050211181015.GW2721@synapse.brain.org> References: <20050211173646.GA26153@jumpy.consultix-inc.com> <20050211181015.GW2721@synapse.brain.org> Message-ID: <20050211185730.GB28281@jumpy.consultix-inc.com> On Fri, Feb 11, 2005 at 10:10:15AM -0800, Ben Reser wrote: > Ugh that's just ugly. And runs a shell in the process. Surely that's > not what he really wants. From what it sounds like exec is what he > wants, I'm not sure why it's not working right. Perhaps he's > misunderstanding what it does. But someone else in the thread already > mentioned it. > Ben Reser > http://ben.reser.org Exec is working properly, but it seems most of the posters in this thread are expecting it to provide different services than it really does: $ perldoc -tf exec exec LIST exec PROGRAM LIST The "exec" function executes a system command *and never returns*-- use "system" instead of "exec" if you want it to return. It fails and returns false only if the command does not exist *and* it is executed directly instead of via your system's command shell (see below). Since it's a common mistake to use "exec" instead of "system", Perl warns you if there is a following statement which isn't "die", "warn", or "exit" (if "-w" is set - but you always do that). If you *really* want to follow an "exec" with some other statement, you can use one of these styles to avoid the warning: ... -Tim *--------------------------------------------------------------------------* | Tim Maher, PhD (206) 781-UNIX (866) DOC-PERL (866) DOC-UNIX | | tim(AT)Consultix-Inc.Com http://TeachMePerl.Com http://TeachMeUnix.Com | *+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-* | Watch for my upcoming book: "Minimal Perl for UNIX/Linux People" | *--------------------------------------------------------------------------* From mathin at mathin.com Fri Feb 11 11:32:55 2005 From: mathin at mathin.com (Dan Ebert) Date: Fri Feb 11 11:33:15 2005 Subject: SPUG: exec question In-Reply-To: <20050211185443.GA28281@jumpy.consultix-inc.com> Message-ID: Tim, I tried out your solution and it is working fine. Thanks for the help. My understanding of what exec did was wrong ... which is what led to my confusion. I appreciate the help! Dan. ---------------------------------------------------------- Immigration is the sincerest form of flattery. - Unknown ---------------------------------------------------------- On Fri, 11 Feb 2005, Tim Maher wrote: > On Fri, Feb 11, 2005 at 10:10:15AM -0800, Ben Reser wrote: > > > > Anyway, from a security standpoint, don't ever do stuff like > > what Tim showed you above. If you're passing arguments, then > > you have to worry about those arguments having shell meta > > characters in them... > > Ben Reser > > Ben, > > Regarding the difference in interpretation between the single-argument > vs. multi-argument version of system, in the example I showed, > metacharacter interpretation was /desired/, which is precisely why > I showed the single-argument version. > > The metacharacters that needed interpretation included the ">" > for output redirection, which I thought the original poster might > need, and the "&" for background execution, which he definitely > needs if he wants his script not to wait for the shell command to > exit before continuing (unless he wants to do the fork/exec himself). > > Your statement "don't ever do stuff like what Tim showed you" is > really uncalled for, and may discourage people from using > features that can benefit them! > > There's no need to be afraid of the shell if you take appropriate > precautions, which comes down to quoting funny characters that you > want taken literally. > > See http://www.TeachMeUnix.com/quoting.html for a detailed > discussion of the proper use of shell quoting techniques. > > -Tim > *--------------------------------------------------------------------------* > | Tim Maher, PhD (206) 781-UNIX (866) DOC-PERL (866) DOC-UNIX | > | tim(AT)Consultix-Inc.Com http://TeachMePerl.Com http://TeachMeUnix.Com | > *+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-* > | Watch for my upcoming book: "Minimal Perl for UNIX/Linux People" | > *--------------------------------------------------------------------------* > _____________________________________________________________ > Seattle Perl Users Group Mailing List > POST TO: spug-list@pm.org > SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list > MEETINGS: 3rd Tuesdays, Location: Amazon.com Pac-Med > WEB PAGE: http://seattleperl.org/ > From ben at reser.org Fri Feb 11 11:39:49 2005 From: ben at reser.org (Ben Reser) Date: Fri Feb 11 11:40:06 2005 Subject: SPUG: exec question In-Reply-To: <20050211185443.GA28281@jumpy.consultix-inc.com> References: <20050211173646.GA26153@jumpy.consultix-inc.com> <20050211181015.GW2721@synapse.brain.org> <20050211185443.GA28281@jumpy.consultix-inc.com> Message-ID: <20050211193949.GX2721@synapse.brain.org> On Fri, Feb 11, 2005 at 10:54:43AM -0800, Tim Maher wrote: > Regarding the difference in interpretation between the single-argument > vs. multi-argument version of system, in the example I showed, > metacharacter interpretation was /desired/, which is precisely why > I showed the single-argument version. > > The metacharacters that needed interpretation included the ">" > for output redirection, which I thought the original poster might > need, and the "&" for background execution, which he definitely > needs if he wants his script not to wait for the shell command to > exit before continuing (unless he wants to do the fork/exec himself). I perfectly understood why you did what you did. Using the shell for that is completely wrong IMHO. It is unnecessary to achieve the desired result and opens you up to security issues. The little bit of effort to code a fork/exec is offset by simply not having to worry about shell meta-characters. Additionally, he seemed to not want any extra processes hanging around. Your use of the shell just trade a perl script for a shell. Sure the shell is smaller, but you're ultimately not giving him what he wanted. > Your statement "don't ever do stuff like what Tim showed you" is > really uncalled for, and may discourage people from using > features that can benefit them! No I'm discouraging people from using features that I see create security problems over and over and over again. What usually happens is someone uses such a feature understanding (or maybe not) the security implications. They know they aren't passing any arguments along and don't bother to include quoting. Then someone else comes along and adds an argument to be passed along from some external output... They didn't realize the implication and have now just introduced a vulnerability. One simple way to avoid this is to do the fork yourself and use exec. Sure it takes a few more minutes to code but it's long term much safer. For those wanting to see how to do it with fork/exec see: http://www.perl.com/doc/manual/html/pod/perlfunc/fork.html However, I still don't think that's what he really wanted. I think he actually wanted just exec and was possibly confused about how it worked. > There's no need to be afraid of the shell if you take appropriate > precautions, which comes down to quoting funny characters that you > want taken literally. > > See http://www.TeachMeUnix.com/quoting.html for a detailed > discussion of the proper use of shell quoting techniques. Yeah and you: a) Didn't mention that. b) Many people don't bother to use these techniques. -- Ben Reser http://ben.reser.org "Conscience is the inner voice which warns us somebody may be looking." - H.L. Mencken From tim at consultix-inc.com Fri Feb 11 13:33:43 2005 From: tim at consultix-inc.com (Tim Maher) Date: Fri Feb 11 13:33:55 2005 Subject: SPUG: exec question In-Reply-To: <20050211193949.GX2721@synapse.brain.org> References: <20050211173646.GA26153@jumpy.consultix-inc.com> <20050211181015.GW2721@synapse.brain.org> <20050211185443.GA28281@jumpy.consultix-inc.com> <20050211193949.GX2721@synapse.brain.org> Message-ID: <20050211213343.GA32708@jumpy.consultix-inc.com> On Fri, Feb 11, 2005 at 11:39:49AM -0800, Ben Reser wrote: > > I perfectly understood why you did what you did. Using the shell for > that is completely wrong IMHO. It is unnecessary to achieve the desired > result and opens you up to security issues. The little bit of effort to > code a fork/exec is offset by simply not having to worry about shell > meta-characters. > > Additionally, he seemed to not want any extra processes hanging around. On the contrary, he complained that his Perl script wasn't continuing to run after he launched the new command with exec, which indicated that he was indeed trying to create a new process, but he was going about it incorrectly. Anyway, we've raised some good points here and the original poster reports that his problem got solved along the way, so this thread has run its course, IMHO. *--------------------------------------------------------------------------* | Tim Maher, PhD (206) 781-UNIX (866) DOC-PERL (866) DOC-UNIX | | tim(AT)Consultix-Inc.Com http://TeachMePerl.Com http://TeachMeUnix.Com | *+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-* | Watch for my upcoming book: "Minimal Perl for UNIX/Linux People" | *--------------------------------------------------------------------------* From mathin at mathin.com Fri Feb 11 14:40:46 2005 From: mathin at mathin.com (Dan Ebert) Date: Fri Feb 11 14:40:55 2005 Subject: SPUG: exec question In-Reply-To: <20050211213343.GA32708@jumpy.consultix-inc.com> Message-ID: What I wanted to happen was for script A to launch script B then for script A to exit while script B went on with its job. With exec() script A (when launched from the command line) didn't return the prompt after it exec'ed script B. By using the system() command Tim suggested I get two good things: 1. the prompt back :) 2. capture of errors generated by the script B if it can't run. Anyway, it works now which is the main thing. Dan. ---------------------------------------------------------- Immigration is the sincerest form of flattery. - Unknown ---------------------------------------------------------- On Fri, 11 Feb 2005, Tim Maher wrote: > On Fri, Feb 11, 2005 at 11:39:49AM -0800, Ben Reser wrote: > > > > I perfectly understood why you did what you did. Using the shell for > > that is completely wrong IMHO. It is unnecessary to achieve the desired > > result and opens you up to security issues. The little bit of effort to > > code a fork/exec is offset by simply not having to worry about shell > > meta-characters. > > > > Additionally, he seemed to not want any extra processes hanging around. > > On the contrary, he complained that his Perl script wasn't > continuing to run after he launched the new command with exec, > which indicated that he was indeed trying to create a new process, > but he was going about it incorrectly. > > Anyway, we've raised some good points here and the original poster > reports that his problem got solved along the way, so this thread > has run its course, IMHO. > > *--------------------------------------------------------------------------* > | Tim Maher, PhD (206) 781-UNIX (866) DOC-PERL (866) DOC-UNIX | > | tim(AT)Consultix-Inc.Com http://TeachMePerl.Com http://TeachMeUnix.Com | > *+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-* > | Watch for my upcoming book: "Minimal Perl for UNIX/Linux People" | > *--------------------------------------------------------------------------* > _____________________________________________________________ > Seattle Perl Users Group Mailing List > POST TO: spug-list@pm.org > SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list > MEETINGS: 3rd Tuesdays, Location: Amazon.com Pac-Med > WEB PAGE: http://seattleperl.org/ > From andrew at sweger.net Fri Feb 11 16:26:28 2005 From: andrew at sweger.net (Andrew Sweger) Date: Fri Feb 11 16:26:38 2005 Subject: SPUG: When's the next meeting? Message-ID: Uh, oops. The next SPUG meeting is this coming Tuesday. I kinda goofed on getting a presentation together. Flame away. My bad. Aside from that, I think we could still have a productive meeting. Ideas? -- Andrew B. Sweger -- The great thing about multitasking is that several things can go wrong at once. From tim at consultix-inc.com Fri Feb 11 16:51:01 2005 From: tim at consultix-inc.com (Tim Maher) Date: Fri Feb 11 16:51:14 2005 Subject: SPUG: When's the next meeting? In-Reply-To: References: Message-ID: <20050212005101.GA4265@jumpy.consultix-inc.com> On Fri, Feb 11, 2005 at 04:26:28PM -0800, Andrew Sweger wrote: > Uh, oops. > > The next SPUG meeting is this coming Tuesday. I kinda goofed on getting a > presentation together. Flame away. My bad. Here's one topical idea: The deadline for OSCON proposals is Sunday, so those folks who have submitted proposals could tell us what they proposed, and get constructive feedback from the audience on their ideas. (I'm a submitter, but I don't think I'll make it to the meeting myself.) -Tim *--------------------------------------------------------------------------* | Tim Maher, PhD (206) 781-UNIX (866) DOC-PERL (866) DOC-UNIX | | tim(AT)Consultix-Inc.Com http://TeachMePerl.Com http://TeachMeUnix.Com | *+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-* | Watch for my upcoming book: "Minimal Perl for UNIX/Linux People" | *--------------------------------------------------------------------------* From cjcollier at colliertech.org Sat Feb 12 16:01:04 2005 From: cjcollier at colliertech.org (C.J. Collier) Date: Sat Feb 12 16:01:19 2005 Subject: SPUG: When's the next meeting? In-Reply-To: References: Message-ID: <046f4fa1face76e6b74e1a2188dc1e58@colliertech.org> The Seattle Mono Users' Group and Seattle Wireless Network both focus more on hacking on code when they meet. Perhaps we could try a night of coding projects. Anyone have an interesting perl project they're working on that they could use some smart folks to help bang out code for? C.J. On Feb 11, 2005, at 4:26 PM, Andrew Sweger wrote: > Uh, oops. > > The next SPUG meeting is this coming Tuesday. I kinda goofed on > getting a > presentation together. Flame away. My bad. > > Aside from that, I think we could still have a productive meeting. > Ideas? > > -- > Andrew B. Sweger -- The great thing about multitasking is that several > things can go wrong at once. > > _____________________________________________________________ > Seattle Perl Users Group Mailing List > POST TO: spug-list@pm.org > SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list > MEETINGS: 3rd Tuesdays, Location: Amazon.com Pac-Med > WEB PAGE: http://seattleperl.org/ > From andrew at sweger.net Mon Feb 14 10:37:35 2005 From: andrew at sweger.net (Andrew Sweger) Date: Mon Feb 14 10:37:50 2005 Subject: SPUG: Meeting Announcement -- Hackers Night - 15 February 2005 Message-ID: February 2005 Seattle Perl Users Group (SPUG) Meeting ===================================================== Title: Hackers Night & OSCON Preview Speaker: n/a Meeting Date: Tuesday, February 15, 2005 Meeting Time: 7:00 - 9:00 p.m. (networking 6:30 - 7:00) Location: Amazon.com Pac-Med Building Cost: Admission is free and open to the general public Info: http://seattleperl.org/ =========================================== My apologies for the lateness of this announcement. Life is all over me like a monkey on my back (but I'm enjoying it). Tim and C.J. had great ideas. We'll have a hackers night and OSCON preview. To start out the meeting, anyone who submitted a proposal to present at this year's OSCON (they were due this last Sunday), you are invited to tell us about your proposal and get constructive feedback from the audience. Next will be a chance for everyone to participate. For folks that are new to Perl, this is a great chance to ask other Perlers what is up with those crazy references or the real difference between an array and a hash. Or perhaps you've been using Perl for years and want to know more about objects. For artisans of the Perl, this is a chance to share your experience and help others over those humps you struggled with so many years ago. We'll work out a way to connect people at the meeting. Just bring yourself, your questions, your brain, your laptop, your favorite code, etc. See below for more information on... - RSVP - Pre-meeting Dinner - Internet Access at Meeting - PGP/GnuPG Key Exchange - Directions to Meeting - Directions from Meeting RSVP ==== If you've signed up and RSVP'd on Meetup.com, great. If you emailed me, great. If you emailed C.J., great. If you haven't done any of that, great. Just show up. But it would be really nice if you took a couple minutes to sign-up on Meetup.com and indicate if you'll be attending. It's not required, but it is immensely helpful to planning and makes things move slicker 'an grass through a goose. If you personally feel that you have a 50% or better chance of showing up at the meeting, please RSVP. Toward that end, I have setup a Perl Meetup.com group, http://perl.meetup.com/86/ Please consider signing up and joining the SPUG meetup.com group. Through the website, you may manage your RSVP for the meeting and request automatic reminders be emailed to you personally. Pre-meeting Dinner ================== I'm swamped this month at won't be able to attend a pre-meeting dinner. For those that are interested, please feel free to start a new thread on the mailing list to discuss logistics. Internet Access at Meeting ========================== A link to the Internet will be provided at the meeting (provided you have suitable equipment). Tables, power strips, and Ethernet hubs will be available in limited quantity. 802.11g WiFi will be available. Please use the SSID: SPUG. The beacon will be broadcasting. No WEP/WPA. Please note that the provided network services are _not_ secure. As I'm sure most of you know, it is a trivial matter to "sniff" network traffic. Please use a secure application encryption protocol or other secure VPN solution to protect sensitive information. Use of the the provided network services is at your own risk. Be a good network citizen. The network services are provided gratis by our hosts. Access can be revoked at any time without prior notification. PGP/GnuPG Key Exchange ====================== If you want to exchange PGP/GnuPG signatures, please contact me directly with your public key (now!) and I'll bring fingerprint checklists for participants. Contact me if you want to know more. Oh, and you have to show up at the meeting to exchange ID's and all that, please. Otherwise this whole key exchange thing doesn't work. Directions to Meeting ===================== Our meeting will take place at the Amazon.com headquarters at 1200 12th Ave S, Seattle, Washington. Please let me know if you find errors or a better route. Thanks. I-5 (from North or South) ------------------------- On I-5, take the S Dearborn St exit and turn West on Dearborn (I-5 Southbound: turn right; I-5 Northbound: turn left) and proceed approximately one or two blocks. Turn right on 8th Ave S (the first light) and proceed North for three blocks. Turn right on S King St and proceed East for approximately five blocks. You will pass under I-5. Turn right on 12th Ave S and proceed South for approximately five blocks. Along this way, you will cross over the Dr. Jose P. Rizal bridge and you should see the Pac-Med tower directly ahead. At this point, notice that you have been going in a circle. Skip to Pac-Med Building below. I-90 (from East) ---------------- On I-90, take the Rainier Ave S (hwy 900) exit Northbound and proceed approximately six blocks. Turn left on S King St and proceed West for approximately two blocks. Turn left on 12th Ave S and proceed South for approximately five blocks. Along this way, you will cross over the Dr. Jose P. Rizal bridge and you should see the Pac-Med tower directly ahead. Pac-Med Building ---------------- Turn right at Charles St (the light after the bridge). The Amazon.com Pac-Med building is visible ahead and on the left as you make the turn and proceed South on Charles (Charles borders the West side of the building). The North parking lot entrance will be the second drive way on the left (the first has a Do Not Enter sign). The parking lot is on the left just past the parking attendant booth. The "carpool only" spaces should be okay to park in after 6:30. Walk to the South entrance of the tower. There is stair next to the parking garage structure that leads to a convenient path that goes around the building to the main entrance on the South side of the building. Enter building and go to the security desk. Sign in and wait to be escorted to the meeting room (just like when we met at Safeco in the U-district, more or less). Google Maps: http://maps.google.com/maps?q=1200%2012th%20ave%20s%2C%20seattle%2C%20wa&spn=0.017365%2C0.032945 (I just love these Google Map links!) Yahoo! Maps: http://us.rd.yahoo.com/maps//maps/extmap/*-http://maps.yahoo.com//maps_result?csz=Seattle%2C+WA+98144-2712&state=WA&uzip=98144&ds=n&name=&desc=&ed=uVHuJep_0TqNClJbk4iFOtDnYtddbn81hKmaNuXswR2pUy1qXnoKfGK_rtqkypGYq5f_zb5ghVDwhYc8gzs3td4sOl73q3BVDyr7btbB3VI4IrVR&zoomin=yes&BFKey=&mag=9 MapQuest: http://www.mapquest.com/maps/map.adp?country=US&countryid=US&addtohistory=&searchtab=address&searchtype=address&address=1200+12th+ave+s&city=&state=&zipcode=98144&search=++Search++ Directions from Meeting ======================= Getting Back Onto I-5 Southbound -------------------------------- (Thanks to member Ron Pero for this helpful information.) Although there is an I-5 northbound exit at S Dearborn St, there is no entrance back onto southbound I-5 at Dearborn. So don't bother trying to simply go back the same way you came. Exit the Pac-Med parking lot on the East side of building (this is Golf Dr S) and turn right. Bear left onto 15th Ave S (the right fork is 14th Ave S. Proceed approximately 1.5 miles. Turn right on S Spokane St and go down steep hill. Turn right at light and follow signs to I-5 southbound. If you exit the Pac-Med parking lot on the West side of the building, turn right on 12th Ave S and then right again on Golf Dr S (the light is the one at the South end of the Dr. Jose P. Rizal bridge). Continue as above. Technically, there's another way onto I-5 SB, but it involves some other crazy route that I'm not going to provide here. From andrew at sweger.net Mon Feb 14 10:38:23 2005 From: andrew at sweger.net (Andrew Sweger) Date: Mon Feb 14 10:38:34 2005 Subject: SPUG: SPUG website Message-ID: Yeah. It sucks and I still haven't done anything about it. And it's out of date. -- Andrew B. Sweger -- The great thing about multitasking is that several things can go wrong at once. From cjcollier at colliertech.org Mon Feb 14 11:41:39 2005 From: cjcollier at colliertech.org (CJ Collier) Date: Mon Feb 14 11:42:33 2005 Subject: SPUG: When's the next meeting? In-Reply-To: References: Message-ID: <1108410099.3669.31.camel@cjcoll.desktop.amazon.com> Yes! Bring it to the meeting, I'm sure plenty of folks would be happy to help you package you work. I'll definitely sit down and hack on it with you for a while. C.J. On Mon, 2005-02-14 at 19:15 +0000, Steve Cartoon wrote: > G'day! > I've been working on a lot of Perl-based modules for astronomical and > astrological purposes. These have been converted from BASIC, Java, Lisp, and > C (these modules are the best-working from the three books Astronomy With > Your PC (1990), Calendrical Calculations (2000), Astronomical Algorithms > (1st ed), and complete VSOP87 data). I've got a number of them to work > together, but I think I need to learn something more on proper module > packaging in order to keep from defining things three or four times during > the scope of the subroutine and resultant calls to other modules. Passing > arrays to functions seems to be a difficult thing for me as well. > I've been studying Perl for a little more than eight years, although most > of my knowledge is stuff a properly-educated first year would have learned, > and I've only been using command-line-oriented Perl for the last two years. > Through all of that, Perl has proven time and time again to be the most > flexible language I've used out there (though PHP is a close runner-up). > > Does this sound like the kind of stuff that would be found interesting by > the group? > > Thanks! > Steve Cartoon > Computer Resource Coordinator > Plymouth Housing Group > > > "Where am I?" > "Well, you can't get there from here." > "But I'm looking for the same old place!" > "Oh, you must mean the old Same place. It's right out back." > > > From michaelrwolf at att.net Tue Feb 15 11:07:02 2005 From: michaelrwolf at att.net (michaelrwolf@att.net) Date: Tue Feb 15 11:07:13 2005 Subject: SPUG: CPAN testing ... Hackers Night - 15 February 2005 Message-ID: <021520051907.21208.4212485600073DCE000052D82160280741000401999D040A0E080C0703@att.net> Start with a little bit of testing, add some XP-style pair-wise programming, throw it against the CPAN and see what sticks..... I started working on a SPUG-level project a while ago. There's a movement, in fits and jerks -- any fits interested in adjusting the status quo? :-) -- to help out some of the bigger module authors by adding some tests to their modules. It's kinda the Fred Brooks surgeon paradigm. There are a lot of prolific module writers that could use the community support to assist them where they can't do it all alone. I'll collect some more information about the project. This would be a great opportunity to practice some QA skills, learn a bit about the Test::* modules, especially Test::Simple, and to help out the quality of the CPAN repository. Since my computer's down, I'll definately be doing pair-wise programming -- on *your* computer! So even if you don't have some code to get creative with, bring your destructive minds, put on a QA hat and join in the fun. Come play! Michael Wolf All SPUGly mammals learn by playing with other people's code! From andrew at sweger.net Tue Feb 15 23:23:20 2005 From: andrew at sweger.net (Andrew Sweger) Date: Tue Feb 15 23:23:31 2005 Subject: SPUG: The SPUG Report, 15 February 2005 Message-ID: We had nine very experienced Perl programmers AND NOT EVEN A SINGLE PERL BEGINNER. My apologies for yelling. But come on! I'm sure there's got to be at least one beginner looking for help with some Perl. You just missed your chance to have nine people tell you fifty different ways to do whatever it is you're trying to do. Hmmm. Maybe that's a good thing. Okay, perhaps a little bit more lead time on the announcement will help. Bill Campbell gave us a review of his talk proposal to OSCON for the OpenPKG[1] system. It permits application and configuration deployment to just about any Unix-like OS and requires very little alteration of the base OS. This is great for managing heterogeneous Unix environments as well as Perl development (use the latest Perl distribution without mucking with the vendor's version). I asked if anyone has been using Class::DBI [2]. Looks grand. But I wanted to hear war stories. Then I showed off this crazy book library application that only works on Mac OS X and a cool Bluetooth barcode scanner and how I made my own barcode series and labels for tracking boxes of junk around my house. It'll use Perl someday. No, really. Then a discussion of King County Council erupted on how they've all come down with insanity. Too bad Chubby & Tubby is gone. We could get a great deal on pitchforks. C.J. talked about parsing C++ with Perl and how he's discovered the GCC-XML [3] converter. He's using it to generate unit tests for C++. He's interested in comments on XML parsers in Perl. Then we yacc'd about how to count how many times a regex matched. E.g., $foo = "lkjsdlfkjsdlfkjsd"; $foo =~ m/k/g; The answer will be posted RSN [4]. Thanks and good night. Next month we might have a presentation on debugging running mod_perl code in Apache. And check out Google Maps [5], yo! [1] - http://openpkg.org/ [2] - http://search.cpan.org/~tmtm/Class-DBI-0.96/lib/Class/DBI.pm [3] - http://gccxml.org/ [4] - http://regex.mainstreamlinux.com/ [5] - http://maps.google.com/ -- Andrew B. Sweger -- The great thing about multitasking is that several things can go wrong at once. From cos at indeterminate.net Wed Feb 16 09:16:45 2005 From: cos at indeterminate.net (John Costello) Date: Wed Feb 16 09:16:56 2005 Subject: SPUG: The SPUG Report, 15 February 2005 In-Reply-To: Message-ID: On Tue, 15 Feb 2005, Andrew Sweger wrote: [Andrew yells.] I am still newbie-ish enough that I would have loved to show, but wedding plans are sucking my time. Yes, the announcement was a bit late, but it was a great idea. I would be interested in this format popping up again, say after April. :^) > I asked if anyone has been using Class::DBI [2]. Looks grand. But I wanted > to hear war stories. Ick. > Then I showed off this crazy book library application that only works on > Mac OS X and a cool Bluetooth barcode scanner and how I made my own > barcode series and labels for tracking boxes of junk around my house. > It'll use Perl someday. No, really. AAUUUUGGGHHHH. Something like that has been in the back of my brain for a while, though I hadn't put Bluetooth in the mix. What is it written in? How do I persuade you to port it or recruit myself to put it in Perl? (Cripes, I haven't even looked to see if Bluetooth devices work under Linux.) > Then a discussion of King County Council erupted on how they've all come > down with insanity. Too bad Chubby & Tubby is gone. We could get a great > deal on pitchforks. > > Thanks and good night. Next month we might have a presentation on debugging > running mod_perl code in Apache. That sounds interesting. Thanks for posting the notes. > -- > Andrew B. Sweger -- The great thing about multitasking is that several > things can go wrong at once. John ----- John Costello - cos at indeterminate dot net "Better a witty fool, than a foolish wit."--Shakespeare, _Twelfth Night_ From cmeyer at helvella.org Wed Feb 16 12:04:04 2005 From: cmeyer at helvella.org (Colin Meyer) Date: Wed Feb 16 12:04:18 2005 Subject: SPUG: TPF asks for more money to fund Perl6 Message-ID: <20050216200404.GA32366@funpox.helvella.org> Spuggers, The TPF posted an announcement to use.perl.org two days ago, requesting donations for the Perl6 effort. The responses from the community vary greatly, and are quite interesting to read through. http://use.perl.org/news/05/02/14/1523219.shtml?tid=37&tid=42 Or, to see everything at once: http://use.perl.org/comments.pl?sid=25006&threshold=0&mode=nested&commentsort=0 Have fun, -Colin. From cmeyer at helvella.org Wed Feb 16 12:31:47 2005 From: cmeyer at helvella.org (Colin Meyer) Date: Wed Feb 16 12:31:56 2005 Subject: SPUG: The SPUG Report, 15 February 2005 In-Reply-To: References: Message-ID: <20050216203147.GB32366@funpox.helvella.org> On Tue, Feb 15, 2005 at 11:23:20PM -0800, Andrew Sweger wrote: > > I asked if anyone has been using Class::DBI [2]. Looks grand. But I wanted > to hear war stories. > I've been using Class::DBI for my own projects, but not in a "enterprise" environment yet. I love it. I've been following its email list for a while, and I can tell you that a number of Perl heavy-weights, such as Perrin Harkins and Tim Bunce are involved and active with the Class::DBI user community. -Colin. From m3047 at inwa.net Sat Feb 19 14:36:24 2005 From: m3047 at inwa.net (Fred Morris) Date: Sat Feb 19 14:40:55 2005 Subject: SPUG: weirdness with two perl -d sessions simultaneously under same account? Message-ID: I've been debugging a client-server thingy, and I've noticed what appears to be a weird line buffering problem when I have both parts running under perl -d in the same account. The server is not threaded, it uses a select to monitor multiple TCP/IP client connections (old school Perl Cookbook).. and I'm not in the select loop, I'm way down in the guts and trying to print stuff from the debug prompt and nothing comes out until I step. Thought I'd ask if anybody had experienced anything like this, or what else it might be. Perl 5.8.0 FWIW. -- Fred Morris fredm3047@inwa.net (I-ACK on subject line to reply) From cwilkes-spug at ladro.com Sat Feb 19 22:12:53 2005 From: cwilkes-spug at ladro.com (Chris Wilkes) Date: Sat Feb 19 22:10:31 2005 Subject: SPUG: weirdness with two perl -d sessions simultaneously under same account? In-Reply-To: References: Message-ID: <20050220061253.GA20597@mail> On Sat, Feb 19, 2005 at 02:36:02PM -0800, Fred Morris wrote: > I've been debugging a client-server thingy, and I've noticed what appears > to be a weird line buffering problem when I have both parts running under > perl -d in the same account. The server is not threaded, it uses a select > to monitor multiple TCP/IP client connections (old school Perl Cookbook).. > and I'm not in the select loop, I'm way down in the guts and trying to > print stuff from the debug prompt and nothing comes out until I step. > > Thought I'd ask if anybody had experienced anything like this, or what else > it might be. Perl 5.8.0 FWIW. Can you sniff the network to see if both clients received all the server's output, and that it is just the clients buffering? Can you post some minimal code to show the problem? Does it only happen when you run both under the debugger? What about one in the debugger, the other not? Chris From jobs-noreply at seattleperl.org Tue Feb 22 19:38:23 2005 From: jobs-noreply at seattleperl.org (SPUG Jobs) Date: Tue Feb 22 19:38:46 2005 Subject: SPUG: JOB: Software Design Engr II (contract/full-time) Message-ID: Please do not reply to this message. See contact information in body of message below. Bradson's Seattle client is looking for software developers for the following contract position. Skills : Perl , HTML, Unix/Linux and Java, JSP, ASP, PHP, Template language, scripting languages Contract (6-9 months) or Contract to Hire, W2 OR 1099, Estimated Pay Rate $40/Hour + for experience level. Locations: Down Town Seattle. Onsite only, No telecommuting. Title: Software Design Engineer II Project: This group is re-building an e-commerce site. Their team builds ONLY the front end of each customer's site. It's built on the current client platform. They will build in customized features and if enough customers want these features then they will change the backend platform (different group). Environment: They are currently using the Agile development approach to development. You will be one of 5 developers and 1 tester working on a team. Your team decides how much of the project will get coded every 3 weeks and then presented to the other teams. As a Perl Developer: You will work with software engineers, testers, program managers, and design team members. The project will be to re-design a front end e-commerce site. Documented delivery of your ability to effectively explain technical options and limitations to both technical and non-technical audiences is required. You will be responsible for real-time operational support of the team's functional areas as well as brainstorming features and ideas. You will design and implement scalable, flexible features using Perl, Mason, HTML and other Web technologies. Requirements: All candidates must have experience developing on UNIX (or LINUX). Candidates will have working experience of Perl, Java, JSP, ASP, PHP, Template language, scripting languages and current trends in Web technology, as well as the desire to learn new technologies. Must have C++ development background. Candidates must have experience developing in an Agile and Scrum environments. Candidates must be innovative, creative, flexible, self-directed, and understand how to design and write high-performance, reliable, maintainable code. Candidate's ability to quickly adapt to new development environments, changing business requirements and learning new systems is highly desired. A Bachelor's degree in Computer Science or a relevant area is highly desired. Experience with large database driven web sites or applications is highly desired. Interested candidates please apply to mike@bradsontech.com with a word doc of your resume. Sincerely, Michael Whalen Director of Professional Services Bradson Technology (425) 456-8900 Office (206) 852-7922 Cell mike@bradsontech.con www.bradsontech.com From coleman_dave at hotmail.com Wed Feb 23 08:07:05 2005 From: coleman_dave at hotmail.com (Dave Coleman) Date: Wed Feb 23 08:08:22 2005 Subject: SPUG: The SPUG Report, 15 February 2005 Message-ID: I'm sorry I missed the chance to be the only newbie hacking with 9 professional programmers. Oh, wait... I think I did that at the meeting before last, or maybe it was the one before that. While I do enjoy the challenge of trying to keep up with you guys, it gets a bit discouraging always chasing the years of experience and wisdom from far, far behind. The last few Spug meetings I have been to have been to gather terms I do not know that I can take home and research later. "So speak up and ask questions" you might say? I feel my questions are more suited for jeeves. I look forward to each months meetings and hope to see somebody there who hasn't been hacking with perl professionally for 6+ years, or presented at OSCON, or published a book, although these people are vital to the organization. I would ask my fellow newbies, to come out and play. If you need help finding a fellow noob, watch for the poor guy without a mac who's not saying much. I hope to see you there. From jobs-noreply at seattleperl.org Wed Feb 23 22:24:16 2005 From: jobs-noreply at seattleperl.org (SPUG Jobs) Date: Wed Feb 23 22:24:26 2005 Subject: SPUG: JOB: SDE/SDET/TPM positions in Seattle Message-ID: Please do not reply to this message. See contact information in body of message below. SDE, SDET, Technical PM positions available in Seattle area Hi, I recruit for the world's largest e-commerce merchandizing organization for a variety of senior level full time SDE/SDET/TPM positions in Seattle, WA. We are always looking for qualified candidates to fill these needs. If you have experience with the below technologies, please email me at liolson@volt.com and we can discuss these opportunities further. C++, Java, Perl, Oracle, Unix, Linux, Server-side programming, distributed systems, e-commerce, test automation Thanks and I look forward to hearing from you soon. Lisa Olson Professional Placement Recruiter Permanent position Placement through recruiter W-2 Seattle WA; no telecommuting e-commerce SDE/T Our client is currently looking for a person that has passion and experience in developing tools for their senior level SDET position. They are currently working on the next generation of the visual interface for databases. The software uses VQL rather than SQL. VQL is "Visualization Query Language" - a true breakthrough in database querying. It enables the user to see various data from a database visually that also has picture expressions embedded in it. Users can actually drag and drop subtables to analyze data with more complicated constraints. Skill requirement: * C++ * Perl or Python - intermediate/advanced level If you have experience with the above, please email me at liolson@volt.com and we can discuss this opportunity further. Thanks and I look forward to hearing from you soon. Lisa Olson Professional Placement Recruiter Permanent position, salary + stock options Placement through recruiter W-2 Seattle WA; no telecommuting Database company creating visualization software From florentin_ at hotmail.com Wed Feb 23 23:46:28 2005 From: florentin_ at hotmail.com (Florentin Ionescu) Date: Wed Feb 23 23:46:39 2005 Subject: SPUG: itm 60 in effective perl programming Message-ID: <421D8654.3060506@hotmail.com> perl -pe 's/\n/" " . <>/e' file is presented in Effective perl programming as program to join lines from a file. what does it mean <> in this context ? - I looked into perlop and perlre but can't figure out haw it works. Thank you. From tim at consultix-inc.com Thu Feb 24 00:02:38 2005 From: tim at consultix-inc.com (Tim Maher) Date: Thu Feb 24 00:02:53 2005 Subject: SPUG: itm 60 in effective perl programming In-Reply-To: <421D8654.3060506@hotmail.com> References: <421D8654.3060506@hotmail.com> Message-ID: <20050224080238.GA22554@jumpy.consultix-inc.com> On Wed, Feb 23, 2005 at 11:46:28PM -0800, Florentin Ionescu wrote: > perl -pe 's/\n/" " . <>/e' file > is presented in Effective perl programming as program to > join lines from a file. what does it mean <> in this context > ? - I looked into perlop and perlre but can't figure out haw > it works. Hi Florentin, <> is the "input operator" -- it's like the UNIX shell's "read" command, except it loads $_ with the next line of input rather than some other variable. But IMHO, that's a pretty inscrutable way to join lines. Here's a more "scrutable" way, based on the implicit loop (-p), assuming you really want a space between each pair of lines as shown above: perl -wpe 's/\n$/ /;' file # replace newline with space This is like a UNIX "sed" command, and it means "replace the newline at the end of the current line with a space, print it, and then repeat until all lines have been processed." -Tim *--------------------------------------------------------------------------* | Tim Maher, PhD (206) 781-UNIX (866) DOC-PERL (866) DOC-UNIX | | tim(AT)Consultix-Inc.Com http://TeachMePerl.Com http://TeachMeUnix.Com | *+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-* | Watch for my upcoming book: "Minimal Perl for UNIX/Linux People" | *--------------------------------------------------------------------------* From ben at reser.org Thu Feb 24 00:37:45 2005 From: ben at reser.org (Ben Reser) Date: Thu Feb 24 00:37:58 2005 Subject: SPUG: itm 60 in effective perl programming In-Reply-To: <421D8654.3060506@hotmail.com> References: <421D8654.3060506@hotmail.com> Message-ID: <20050224083745.GA2661@synapse.brain.org> On Wed, Feb 23, 2005 at 11:46:28PM -0800, Florentin Ionescu wrote: > perl -pe 's/\n/" " . <>/e' file > is presented in Effective perl programming as program to join lines from a > file. > what does it mean <> in this context ? - I looked into perlop and perlre > but can't figure out haw it works. <> is the null file handle. In this case it reads the next line from the files given on the command line. But I think their either is a typo in your example or in the book because that doesn't join the lines in the file: $ echo 'foo' > test $ echo 'bar' >> test $ echo 'baz' >> test $ wc -l test 3 test $ perl -pe 's/\n/" " . <>/e' test foo bar baz And in fact hangs until you Ctrl+D it if there is an odd number of lines in the file. It hangs because the -p creates an implicit loop which reads from <> and then a second Perhaps they meant this: perl -pe 's/\n/ /' file tr would probably be moderately better: perl -pe 'tr/\n/ /' But I'd prefer the following: perl -pe 'chomp; $_ .= " "' file which would be faster. Here's a quick and dirty comparision of execution times on a 4.2 GB file. regex version: 31.06user 10.43system 2:19.48elapsed 29%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (0major+676minor)pagefaults 0swaps tr version: 30.91user 7.45system 2:02.26elapsed 31%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (0major+651minor)pagefaults 0swaps chomp version: 20.97user 9.89system 1:45.98elapsed 29%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (0major+652minor)pagefaults 0swaps Be forwarned however, it might seem like you could get away with using chop instead of chomp here becuase you can count on every line having a line separater. However, this won't work on Windows where text files are usually using two characters to separate lines. chomp works because it will remove all of the characters that appear in $/ if the are at the end of the line. I can't imagine why anyone would want to use the regex version. So if what you gave was really what was printed in the book I'd say the book is wrong. -- Ben Reser http://ben.reser.org "Conscience is the inner voice which warns us somebody may be looking." - H.L. Mencken From ben at reser.org Thu Feb 24 00:40:23 2005 From: ben at reser.org (Ben Reser) Date: Thu Feb 24 00:43:32 2005 Subject: SPUG: itm 60 in effective perl programming In-Reply-To: <20050224083745.GA2661@synapse.brain.org> References: <421D8654.3060506@hotmail.com> <20050224083745.GA2661@synapse.brain.org> Message-ID: <20050224084023.GB2661@synapse.brain.org> On Thu, Feb 24, 2005 at 12:37:45AM -0800, Ben Reser wrote: > But I think their either is a typo in your example or in the book s/their/there/ and then a second <> is evaluated in the regex. This is what happens when I hit send on the email before I'm finished on accident. -- Ben Reser http://ben.reser.org "Conscience is the inner voice which warns us somebody may be looking." - H.L. Mencken From krahnj at telus.net Thu Feb 24 01:38:05 2005 From: krahnj at telus.net (John W. Krahn) Date: Thu Feb 24 01:38:36 2005 Subject: SPUG: itm 60 in effective perl programming In-Reply-To: <421D8654.3060506@hotmail.com> References: <421D8654.3060506@hotmail.com> Message-ID: <421DA07D.9030701@telus.net> Florentin Ionescu wrote: > perl -pe 's/\n/" " . <>/e' file > is presented in Effective perl programming as program to join lines from > a file. > what does it mean <> in this context ? - I looked into perlop and perlre > but can't figure out haw it works. <> is the readline operator. perldoc -f readline In this context (scalar) it means to read a single line from the current filehandle (either ARGV or STDIN). John -- use Perl; program fulfillment From krahnj at telus.net Thu Feb 24 01:53:45 2005 From: krahnj at telus.net (John W. Krahn) Date: Thu Feb 24 01:54:15 2005 Subject: SPUG: itm 60 in effective perl programming In-Reply-To: <20050224080238.GA22554@jumpy.consultix-inc.com> References: <421D8654.3060506@hotmail.com> <20050224080238.GA22554@jumpy.consultix-inc.com> Message-ID: <421DA429.5010707@telus.net> Tim Maher wrote: > On Wed, Feb 23, 2005 at 11:46:28PM -0800, Florentin Ionescu wrote: > >>perl -pe 's/\n/" " . <>/e' file >>is presented in Effective perl programming as program to >>join lines from a file. what does it mean <> in this context >>? - I looked into perlop and perlre but can't figure out haw >>it works. > > <> is the "input operator" ^^^^^^^^^^^^^^ readline operator > -- it's like the UNIX shell's "read" > command, except it loads $_ with the next line of input IIF it is used in a while loop conditional! > rather than some other variable. > > But IMHO, that's a pretty inscrutable way to join lines. Here's a more > "scrutable" way, based on the implicit loop (-p), assuming you really > want a space between each pair of lines as shown above: > > perl -wpe 's/\n$/ /;' file # replace newline with space That replaces *every* newline with a space unlike the OP's example which replaces every odd numbered newline with a space. Also, the end of line anchor ($) is superfluous as there is only one newline in every line (unless you change the Input Record Separator.) John -- use Perl; program fulfillment From sthoenna at efn.org Thu Feb 24 01:57:47 2005 From: sthoenna at efn.org (Yitzchak Scott-Thoennes) Date: Thu Feb 24 01:58:00 2005 Subject: SPUG: itm 60 in effective perl programming In-Reply-To: <20050224080238.GA22554@jumpy.consultix-inc.com> References: <421D8654.3060506@hotmail.com> <20050224080238.GA22554@jumpy.consultix-inc.com> Message-ID: <20050224095747.GC5708@efn.org> On Thu, Feb 24, 2005 at 12:02:38AM -0800, Tim Maher wrote: > On Wed, Feb 23, 2005 at 11:46:28PM -0800, Florentin Ionescu wrote: > > perl -pe 's/\n/" " . <>/e' file > > is presented in Effective perl programming as program to > > join lines from a file. what does it mean <> in this context > > ? - I looked into perlop and perlre but can't figure out haw > > it works. > > Hi Florentin, > > <> is the "input operator" -- it's like the UNIX shell's "read" > command, except it loads $_ with the next line of input rather > than some other variable. > > But IMHO, that's a pretty inscrutable way to join lines. Here's a more > "scrutable" way, based on the implicit loop (-p), assuming you really > want a space between each pair of lines as shown above: > > perl -wpe 's/\n$/ /;' file # replace newline with space I don't have the book, so can't check what the <> version is *supposed* to do, but what it *does* do is join every pair of lines into one (and presumably the file is known to have an even number of lines), while the proposed improvement makes one line out of the whole file. Anyway, surely you meant: perl -wpe'y/\n/ /' file From krahnj at telus.net Thu Feb 24 02:33:26 2005 From: krahnj at telus.net (John W. Krahn) Date: Thu Feb 24 02:33:57 2005 Subject: SPUG: itm 60 in effective perl programming In-Reply-To: <20050224083745.GA2661@synapse.brain.org> References: <421D8654.3060506@hotmail.com> <20050224083745.GA2661@synapse.brain.org> Message-ID: <421DAD76.7080709@telus.net> Ben Reser wrote: > On Wed, Feb 23, 2005 at 11:46:28PM -0800, Florentin Ionescu wrote: > >>perl -pe 's/\n/" " . <>/e' file >>is presented in Effective perl programming as program to join lines from a >>file. >>what does it mean <> in this context ? - I looked into perlop and perlre >>but can't figure out haw it works. > > <> is the null file handle. In this case it reads the next line from > the files given on the command line. > > But I think their either is a typo in your example or in the book > because that doesn't join the lines in the file: > > $ echo 'foo' > test > $ echo 'bar' >> test > $ echo 'baz' >> test > $ wc -l test > 3 test > $ perl -pe 's/\n/" " . <>/e' test > foo bar The two lines 'foo' and 'bar' *are* joined together! > baz > > And in fact hangs until you Ctrl+D it if there is an odd number of lines > in the file. It didn't when I tried it and it shouldn't according to the documentation. > It hangs because the -p creates an implicit loop which > reads from <> and then a second A second what? > Perhaps they meant this: > perl -pe 's/\n/ /' file > > tr would probably be moderately better: > perl -pe 'tr/\n/ /' > > But I'd prefer the following: > perl -pe 'chomp; $_ .= " "' file Your examples replace *every* newline with a space which is not what the original does. > which would be faster. Here's a quick and dirty comparision of > execution times on a 4.2 GB file. > > regex version: > 31.06user 10.43system 2:19.48elapsed 29%CPU (0avgtext+0avgdata > 0maxresident)k > 0inputs+0outputs (0major+676minor)pagefaults 0swaps > > tr version: > 30.91user 7.45system 2:02.26elapsed 31%CPU (0avgtext+0avgdata > 0maxresident)k > 0inputs+0outputs (0major+651minor)pagefaults 0swaps > > chomp version: > 20.97user 9.89system 1:45.98elapsed 29%CPU (0avgtext+0avgdata > 0maxresident)k > 0inputs+0outputs (0major+652minor)pagefaults 0swaps > > Be forwarned however, it might seem like you could get away with using > chop instead of chomp here becuase you can count on every line having a > line separater. However, this won't work on Windows where text files > are usually using two characters to separate lines. chomp works because > it will remove all of the characters that appear in $/ if the are at the > end of the line. > > I can't imagine why anyone would want to use the regex version. Because the substitution operator allows you to _e_valuate the replacement string as a perl expression. > So if > what you gave was really what was printed in the book I'd say the book > is wrong. It looks fine to me. :-) John -- use Perl; program fulfillment From sthoenna at efn.org Thu Feb 24 03:06:10 2005 From: sthoenna at efn.org (Yitzchak Scott-Thoennes) Date: Thu Feb 24 03:06:51 2005 Subject: SPUG: itm 60 in effective perl programming In-Reply-To: <20050224083745.GA2661@synapse.brain.org> References: <421D8654.3060506@hotmail.com> <20050224083745.GA2661@synapse.brain.org> Message-ID: <20050224110609.GF5708@efn.org> On Thu, Feb 24, 2005 at 12:37:45AM -0800, Ben Reser wrote: > Perhaps they meant this: > perl -pe 's/\n/ /' file > > tr would probably be moderately better: > perl -pe 'tr/\n/ /' > > But I'd prefer the following: > perl -pe 'chomp; $_ .= " "' file For completeness: perl -pe'substr($_,-1,1," ")' file or perl -pe'substr($_,-1)=" "' file or perl -pe'/\n/;$_="$` "' file or perl -pe'/.*/;$_="$& "' file or even perl -pl40w010e0 file From krahnj at telus.net Thu Feb 24 04:34:16 2005 From: krahnj at telus.net (John W. Krahn) Date: Thu Feb 24 04:34:47 2005 Subject: SPUG: itm 60 in effective perl programming In-Reply-To: <20050224110609.GF5708@efn.org> References: <421D8654.3060506@hotmail.com> <20050224083745.GA2661@synapse.brain.org> <20050224110609.GF5708@efn.org> Message-ID: <421DC9C8.9020508@telus.net> Yitzchak Scott-Thoennes wrote: > On Thu, Feb 24, 2005 at 12:37:45AM -0800, Ben Reser wrote: > >>Perhaps they meant this: >>perl -pe 's/\n/ /' file >> >>tr would probably be moderately better: >>perl -pe 'tr/\n/ /' >> >>But I'd prefer the following: >>perl -pe 'chomp; $_ .= " "' file > > > For completeness: > > perl -pe'substr($_,-1,1," ")' file > > or > > perl -pe'substr($_,-1)=" "' file > > or > > perl -pe'/\n/;$_="$` "' file > > or > > perl -pe'/.*/;$_="$& "' file > > or even > > perl -pl40w010e0 file Octal 010 is the backspace character, it should be 012 for newline: perl -012l40pe0 perl -lpe'$,.=$_.$"}{$\=$,' or perl -pe'/.*/;$\.=$&.$"}{' John -- use Perl; program fulfillment From krahnj at telus.net Thu Feb 24 04:49:34 2005 From: krahnj at telus.net (John W. Krahn) Date: Thu Feb 24 04:50:05 2005 Subject: SPUG: itm 60 in effective perl programming In-Reply-To: <421DC9C8.9020508@telus.net> References: <421D8654.3060506@hotmail.com> <20050224083745.GA2661@synapse.brain.org> <20050224110609.GF5708@efn.org> <421DC9C8.9020508@telus.net> Message-ID: <421DCD5E.5050204@telus.net> John W. Krahn wrote: > Yitzchak Scott-Thoennes wrote: >> >> For completeness: >> >> perl -pe'substr($_,-1,1," ")' file >> >> or >> >> perl -pe'substr($_,-1)=" "' file >> >> or >> perl -pe'/\n/;$_="$` "' file >> >> or >> >> perl -pe'/.*/;$_="$& "' file >> >> or even >> >> perl -pl40w010e0 file > > Octal 010 is the backspace character, it should be 012 for newline: > > perl -012l40pe0 > > > perl -lpe'$,.=$_.$"}{$\=$,' > > or > > perl -pe'/.*/;$\.=$&.$"}{' Or to do what the original did without using a regular expression: perl -lpe'$;.=$_.(--$|?$":$/)}{$\=$;' or even perl -pe'/.*/;$\.=$&.(--$|?$":$/)}{' John -- use Perl; program fulfillment From krahnj at telus.net Thu Feb 24 04:56:51 2005 From: krahnj at telus.net (John W. Krahn) Date: Thu Feb 24 04:57:22 2005 Subject: SPUG: itm 60 in effective perl programming In-Reply-To: <421DCD5E.5050204@telus.net> References: <421D8654.3060506@hotmail.com> <20050224083745.GA2661@synapse.brain.org> <20050224110609.GF5708@efn.org> <421DC9C8.9020508@telus.net> <421DCD5E.5050204@telus.net> Message-ID: <421DCF13.1070206@telus.net> John W. Krahn wrote: > John W. Krahn wrote: > >> Yitzchak Scott-Thoennes wrote: >>> >>> For completeness: >>> >>> perl -pe'substr($_,-1,1," ")' file >>> >>> or >>> >>> perl -pe'substr($_,-1)=" "' file >>> >>> or >>> perl -pe'/\n/;$_="$` "' file >>> >>> or >>> >>> perl -pe'/.*/;$_="$& "' file >>> >>> or even >>> >>> perl -pl40w010e0 file >> >> Octal 010 is the backspace character, it should be 012 for newline: >> >> perl -012l40pe0 >> >> >> perl -lpe'$,.=$_.$"}{$\=$,' >> >> or >> >> perl -pe'/.*/;$\.=$&.$"}{' > > Or to do what the original did without using a regular expression: > > perl -lpe'$;.=$_.(--$|?$":$/)}{$\=$;' > > or even > > perl -pe'/.*/;$\.=$&.(--$|?$":$/)}{' or even perl -lpe'$\=--$|?$":$/' :-) John -- use Perl; program fulfillment From sthoenna at efn.org Thu Feb 24 05:40:28 2005 From: sthoenna at efn.org (Yitzchak Scott-Thoennes) Date: Thu Feb 24 05:40:50 2005 Subject: SPUG: itm 60 in effective perl programming In-Reply-To: <421DCD5E.5050204@telus.net> References: <421D8654.3060506@hotmail.com> <20050224083745.GA2661@synapse.brain.org> <20050224110609.GF5708@efn.org> <421DC9C8.9020508@telus.net> <421DCD5E.5050204@telus.net> Message-ID: <20050224134028.GG5708@efn.org> On Thu, Feb 24, 2005 at 04:49:34AM -0800, John W. Krahn wrote: > John W. Krahn wrote: > >Yitzchak Scott-Thoennes wrote: > >>perl -pl40w010e0 file > > > >Octal 010 is the backspace character, it should be 012 for newline: > > > >perl -012l40pe0 Urrgh. I hate octal. Thanks. > >perl -lpe'$,.=$_.$"}{$\=$,' > > > >or > > > >perl -pe'/.*/;$\.=$&.$"}{' > > Or to do what the original did without using a regular expression: > > perl -lpe'$;.=$_.(--$|?$":$/)}{$\=$;' > > or even > > perl -pe'/.*/;$\.=$&.(--$|?$":$/)}{' That last is my favorite. I've always been partial to code without any unsightly alphanumerics. From Eric.Peterson at wwireless.com Thu Feb 24 09:10:04 2005 From: Eric.Peterson at wwireless.com (Peterson, Eric D.) Date: Thu Feb 24 09:11:04 2005 Subject: SPUG: Module installation Message-ID: I've a question about installing Perl Modules on HPUX. On our dev box a module got installed as /opt/perl/lib/site_perl/5.6.1/PA-RISC2.0-thread-multi/Date/Calc.pm Whereas on the production box it got installed as /opt/perl5/lib/site_perl/5.6.1/Date-Calc-5.4/Calc.pm When I run code to use this module, it runs successfully in Dev but fails in Production. I'm not the root user and am not the person to do the make. What can I tell my SA that would help him? He seems to be at a loss on how to install Perl Modules. #!/usr/bin/perl -T use warnings; use strict; use Date::Calc qw/Today Add_Delta_Days/; Can't locate loadable object for module Date::Calc in @INC (@INC contains: /opt/perl5/lib/site_perl/5.6.1/Date-Calc-5.4 /opt/perl5/lib/5.6.1/PA-RISC2.0-thread-multi /opt/perl5/lib/5.6.1 /opt/perl5/lib/site_perl/5.6.1/PA-RISC2.0-thread-multi /opt/perl5/lib/site_perl/5.6.1 /opt/perl5/lib/site_perl) at ./d line 46 Compilation failed in require at ./d line 46. BEGIN failed--compilation aborted at ./d line 46. ________________________________________ Eric D. Peterson, Reporting Dreams that do come true can be as unsettling as those that don't. -Brett Butler, Keep Deep in Paradise -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/spug-list/attachments/20050224/522eaf1e/attachment.htm From tim at consultix-inc.com Thu Feb 24 09:14:23 2005 From: tim at consultix-inc.com (Tim Maher) Date: Thu Feb 24 09:14:34 2005 Subject: SPUG: itm 60 in effective perl programming In-Reply-To: <421DA429.5010707@telus.net> References: <421D8654.3060506@hotmail.com> <20050224080238.GA22554@jumpy.consultix-inc.com> <421DA429.5010707@telus.net> Message-ID: <20050224171423.GA32549@jumpy.consultix-inc.com> On Thu, Feb 24, 2005 at 01:53:45AM -0800, John W. Krahn wrote: > ><> is the "input operator" > ^^^^^^^^^^^^^^ > readline operator I follow Larry's lead; he calls it the "line input operator" on p. 80 of the 3rd ed. Camel, but I omit the "line" part because it doesn't necessarily read a line -- the setting of $/ actually dictates how much data it will read. > >-- it's like the UNIX shell's "read" > >command, except it loads $_ with the next line of input > >rather than some other variable. > > IIF it is used in a while loop conditional! Not IIF, because in addition to the while case it also loads $_ for for ($i; <>; $i++) and in the absence of some other specified loop variable, also for "foreach (<>)" and of course, it also loads $_ when the implicit loop of -n/-p is used. > >But IMHO, that's a pretty inscrutable way to join lines. Here's a more > >"scrutable" way, based on the implicit loop (-p), assuming you really > >want a space between each pair of lines as shown above: > > > >perl -wpe 's/\n$/ /;' file # replace newline with space > Also, the end of line anchor ($) is superfluous as there is > only one newline in every line (unless you change the Input > Record Separator.) > John Yes, but IMHO it's often worth adding a "superfluous" character or two to make a program more readable -- and the original poster was a confused newbie, after all, so I was going for "added scrutability" 8-} Tim *--------------------------------------------------------------------------* | Tim Maher, PhD (206) 781-UNIX (866) DOC-PERL (866) DOC-UNIX | | tim(AT)Consultix-Inc.Com http://TeachMePerl.Com http://TeachMeUnix.Com | *+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-* | Watch for my upcoming book: "Minimal Perl for UNIX/Linux People" | *--------------------------------------------------------------------------* From ben at reser.org Thu Feb 24 10:26:30 2005 From: ben at reser.org (Ben Reser) Date: Thu Feb 24 10:26:44 2005 Subject: SPUG: itm 60 in effective perl programming In-Reply-To: <421DAD76.7080709@telus.net> References: <421D8654.3060506@hotmail.com> <20050224083745.GA2661@synapse.brain.org> <421DAD76.7080709@telus.net> Message-ID: <20050224182630.GC2661@synapse.brain.org> On Thu, Feb 24, 2005 at 02:33:26AM -0800, John W. Krahn wrote: > >$ echo 'foo' > test > >$ echo 'bar' >> test > >$ echo 'baz' >> test > >$ wc -l test > > 3 test > >$ perl -pe 's/\n/" " . <>/e' test > >foo bar > > The two lines 'foo' and 'bar' *are* joined together! > > > >baz Umm but not baz. > >And in fact hangs until you Ctrl+D it if there is an odd number of lines > >in the file. > > It didn't when I tried it and it shouldn't according to the documentation. It doesn't if you have an even number of lines. An odd number and it does. The reason is because <> has some magical effects. Which is why most of the people on this thread are really oversimplyfing things... This script has two <>'s in it. One from the implicit loop introducted by the -p command line paramter, and one in the perl experssion on the rhs of the regex. This means every pass through the loop does two reads. Here's a simpler script to demonstrate what is happening: echo stdin | perl -pe '$_ .= <>' test First note that I'm putting the line "stdin" on the standard input to the program. So now let's run it with test containing three lines: foo bar baz $ echo stdin | perl -pe '$_ .= <>' test foo bar baz stdin So what's happening here is as follows. Every use of <> has it's own magic. foo and baz are read by the <> in the while loop test. bar and stdin are ready by the <> in the body of the loop. When it runs the first time it sees a file opened in the ARGV filehandle and reads a line from it. After baz is read the ARGV filehandle gets closed and the next <> would return nothing. But remember each <> has it's own magic. Since the one is inside the loop each call to it actually ends up having its own magic. So it opens stdin and starts reading it. Now let's try it with a file with an even number of lines: foo bar baz ack $ echo stdin | perl -pe '$_ .= <>' test foo bar baz ack Note it didn't read stdin this time. foo and bar were read by the loop test, bar and ack by the <> within the loop. However, stdin was never read because <> in the while test returned undef after it saw all the files had been consumed. Part of the problem with the documentation is they show you pseudo code for using it in a loop but never show how it behaves in other circumstances. They do say this: The <> symbol will return "undef" for end-of-file only once. If you call it again after this, it will assume you are processing another @ARGV list, and if you haven't set @ARGV, will read input from STDIN. But it's not clear about the fact that only the original <> in the code will return the undef, not other <>'s. > > It hangs because the -p creates an implicit loop which > >reads from <> and then a second > > A second what? See my followup email. > >Perhaps they meant this: > >perl -pe 's/\n/ /' file > > > >tr would probably be moderately better: > >perl -pe 'tr/\n/ /' > > > >But I'd prefer the following: > >perl -pe 'chomp; $_ .= " "' file > > Your examples replace *every* newline with a space which is not what the > original does. Umm yes I realize that. I even explained that. The original doesn't join every line. Which isn't what he said it did. It joins every other line. Which I suppose if that's what you want is fine but that's not what he said it did. > >I can't imagine why anyone would want to use the regex version. > > Because the substitution operator allows you to _e_valuate the replacement > string as a perl expression. I'm fully aware of what the original is doing. But if it's described as joining all the lines in a file it doesn't do that. Just because you can use the regex operator to do something doesn't mean it's the most efficient. And many times it's not the most readable. IMHO this script is seriously bugged. It's misusing the <> operator and I'm a bit suprised to hear that it was found in a book titled Effective Perl. -- Ben Reser http://ben.reser.org "Conscience is the inner voice which warns us somebody may be looking." - H.L. Mencken From cos at indeterminate.net Thu Feb 24 10:35:08 2005 From: cos at indeterminate.net (John Costello) Date: Thu Feb 24 10:35:14 2005 Subject: SPUG: itm 60 in effective perl programming In-Reply-To: <20050224182630.GC2661@synapse.brain.org> Message-ID: On Thu, 24 Feb 2005, Ben Reser wrote: > The reason is because <> has some magical effects. Which is why most of > the people on this thread are really oversimplyfing things... Speaking of <>, another option is to use perl -pi.orig -e 's/\n/ /g' filename That leaves a file named filename.orig in the directory, which may not be desirable. John From charles.e.derykus at boeing.com Thu Feb 24 10:52:45 2005 From: charles.e.derykus at boeing.com (DeRykus, Charles E) Date: Thu Feb 24 10:52:58 2005 Subject: SPUG: Module installation Message-ID: <5DF8FDE8DFE8744388602480FDCC0E3106F3D02B@xch-nw-23.nw.nos.boeing.com> Do you know if the same version and configure options of Date-Calc were used...? I don't know the recent version history of Date-Calc but it almost looks as if there might be a pure-perl version as well as an option for configuring a compiled component since the development box has the arch. specific PA-RISC2.0 in the path. -- Charles DeRykus -----Original Message----- From: Peterson, Eric D. [mailto:Eric.Peterson@wwireless.com] Sent: Thursday, February 24, 2005 9:10 AM To: 'spug-list@pm.org' Subject: SPUG: Module installation I've a question about installing Perl Modules on HPUX. On our dev box a module got installed as /opt/perl/lib/site_perl/5.6.1/PA-RISC2.0-thread-multi/Date/Calc.pm Whereas on the production box it got installed as /opt/perl5/lib/site_perl/5.6.1/Date-Calc-5.4/Calc.pm When I run code to use this module, it runs successfully in Dev but fails in Production. I'm not the root user and am not the person to do the make. What can I tell my SA that would help him? He seems to be at a loss on how to install Perl Modules. #!/usr/bin/perl -T use warnings; use strict; use Date::Calc qw/Today Add_Delta_Days/; Can't locate loadable object for module Date::Calc in @INC (@INC contains: /opt/perl5/lib/site_perl/5.6.1/Date-Calc-5.4 /opt/perl5/lib/5.6.1/PA-RISC2.0-thread-multi /opt/perl5/lib/5.6.1 /opt/perl5/lib/site_perl/5.6.1/PA-RISC2.0-thread-multi /opt/perl5/lib/site_perl/5.6.1 /opt/perl5/lib/site_perl) at ./d line 46 Compilation failed in require at ./d line 46. BEGIN failed--compilation aborted at ./d line 46. ________________________________________ Eric D. Peterson, Reporting Dreams that do come true can be as unsettling as those that don't. -Brett Butler, Keep Deep in Paradise -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/spug-list/attachments/20050224/18c2b319/attachment.htm From Eric.Peterson at wwireless.com Thu Feb 24 11:02:00 2005 From: Eric.Peterson at wwireless.com (Peterson, Eric D.) Date: Thu Feb 24 11:02:59 2005 Subject: SPUG: Module installation Message-ID: Yes, both are v.5.4. As for the configure options, the SA didn't tell/ask me about them. You think it might be an effect of how Perl itself was made on each machine? ________________________________________ Eric D. Peterson, Reporting Prediction is very difficult, especially about the future. -Niels Bohr -----Original Message----- From: DeRykus, Charles E [mailto:charles.e.derykus@boeing.com] Sent: Thursday, 24 February, 2005 10:53 To: Peterson, Eric D.; spug-list@pm.org Subject: RE: SPUG: Module installation Do you know if the same version and configure options of Date-Calc were used...? I don't know the recent version history of Date-Calc but it almost looks as if there might be a pure-perl version as well as an option for configuring a compiled component since the development box has the arch. specific PA-RISC2.0 in the path. -- Charles DeRykus -----Original Message----- From: Peterson, Eric D. [mailto:Eric.Peterson@wwireless.com] Sent: Thursday, February 24, 2005 9:10 AM To: 'spug-list@pm.org' Subject: SPUG: Module installation I've a question about installing Perl Modules on HPUX. On our dev box a module got installed as /opt/perl/lib/site_perl/5.6.1/PA-RISC2.0-thread-multi/Date/Calc.pm Whereas on the production box it got installed as /opt/perl5/lib/site_perl/5.6.1/Date-Calc-5.4/Calc.pm When I run code to use this module, it runs successfully in Dev but fails in Production. I'm not the root user and am not the person to do the make. What can I tell my SA that would help him? He seems to be at a loss on how to install Perl Modules. #!/usr/bin/perl -T use warnings; use strict; use Date::Calc qw/Today Add_Delta_Days/; Can't locate loadable object for module Date::Calc in @INC (@INC contains: /opt/perl5/lib/site_perl/5.6.1/Date-Calc-5.4 /opt/perl5/lib/5.6.1/PA-RISC2.0-thread-multi /opt/perl5/lib/5.6.1 /opt/perl5/lib/site_perl/5.6.1/PA-RISC2.0-thread-multi /opt/perl5/lib/site_perl/5.6.1 /opt/perl5/lib/site_perl) at ./d line 46 Compilation failed in require at ./d line 46. BEGIN failed--compilation aborted at ./d line 46. ________________________________________ Eric D. Peterson, Reporting Dreams that do come true can be as unsettling as those that don't. -Brett Butler, Keep Deep in Paradise -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/spug-list/attachments/20050224/ff2b9c8b/attachment.htm From rizvi at amazon.com Thu Feb 24 11:00:27 2005 From: rizvi at amazon.com (Rizvi, Ali) Date: Thu Feb 24 11:07:49 2005 Subject: SPUG: JOB: SDE/SDET/TPM positions in Seattle Message-ID: <55C0724D26281F40A605FB85F1104434046D7CA0@ex-mail-sea-04.ant.amazon.com> Our group has very similar requirements. I was not sure if sending job emails was OK to this list but this email gave me the courage to do this. Please send me resume of someone you know that have experience with: C++, Java, Perl, Oracle, Unix, Linux, Server-side programming, distributed systems, e-commerce, test automation for a direct referral. Thanks Ali -----Original Message----- From: spug-list-bounces@pm.org [mailto:spug-list-bounces@pm.org] On Behalf Of SPUG Jobs Sent: Wednesday, February 23, 2005 10:24 PM To: Seattle Perl Users Group Subject: SPUG: JOB: SDE/SDET/TPM positions in Seattle Please do not reply to this message. See contact information in body of message below. SDE, SDET, Technical PM positions available in Seattle area Hi, I recruit for the world's largest e-commerce merchandizing organization for a variety of senior level full time SDE/SDET/TPM positions in Seattle, WA. We are always looking for qualified candidates to fill these needs. If you have experience with the below technologies, please email me at liolson@volt.com and we can discuss these opportunities further. C++, Java, Perl, Oracle, Unix, Linux, Server-side programming, C++distributed systems, e-commerce, test automation Thanks and I look forward to hearing from you soon. Lisa Olson Professional Placement Recruiter Permanent position Placement through recruiter W-2 Seattle WA; no telecommuting e-commerce SDE/T Our client is currently looking for a person that has passion and experience in developing tools for their senior level SDET position. They are currently working on the next generation of the visual interface for databases. The software uses VQL rather than SQL. VQL is "Visualization Query Language" - a true breakthrough in database querying. It enables the user to see various data from a database visually that also has picture expressions embedded in it. Users can actually drag and drop subtables to analyze data with more complicated constraints. Skill requirement: * C++ * Perl or Python - intermediate/advanced level If you have experience with the above, please email me at liolson@volt.com and we can discuss this opportunity further. Thanks and I look forward to hearing from you soon. Lisa Olson Professional Placement Recruiter Permanent position, salary + stock options Placement through recruiter W-2 Seattle WA; no telecommuting Database company creating visualization software _____________________________________________________________ Seattle Perl Users Group Mailing List POST TO: spug-list@pm.org SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list MEETINGS: 3rd Tuesdays, Location: Amazon.com Pac-Med WEB PAGE: http://seattleperl.org/ From krahnj at telus.net Thu Feb 24 12:44:18 2005 From: krahnj at telus.net (John W. Krahn) Date: Thu Feb 24 12:44:53 2005 Subject: SPUG: itm 60 in effective perl programming In-Reply-To: <20050224171423.GA32549@jumpy.consultix-inc.com> References: <421D8654.3060506@hotmail.com> <20050224080238.GA22554@jumpy.consultix-inc.com> <421DA429.5010707@telus.net> <20050224171423.GA32549@jumpy.consultix-inc.com> Message-ID: <421E3CA2.3040107@telus.net> Tim Maher wrote: > On Thu, Feb 24, 2005 at 01:53:45AM -0800, John W. Krahn wrote: > >>>-- it's like the UNIX shell's "read" >>>command, except it loads $_ with the next line of input >>>rather than some other variable. >> >>IIF it is used in a while loop conditional! > > Not IIF, because in addition to the while case it also loads $_ for > for ($i; <>; $i++) I didn't mention the C style for loop because as any C or Perl programmer should know it is equivalent to a while loop. (See K&R 2nd ed. section 3.5 and the "For Loops" section of perlsyn.pod.) > and in the absence of some other specified loop variable, also for > "foreach (<>)" In a foreach loop the expression is expanded to a list and the loop variable is an *alias* to each member of that list in turn. This is usually very inefficient for reading from a file as the whole file has to exist in memory. > and of course, it also loads $_ when the implicit loop of -n/-p > is used. Because -n and -p use a while loop. $ perl -MO=Deparse -ne1 LINE: while (defined($_ = )) { '???'; } -e syntax OK >>>But IMHO, that's a pretty inscrutable way to join lines. Here's a more >>>"scrutable" way, based on the implicit loop (-p), assuming you really >>>want a space between each pair of lines as shown above: >>> >>>perl -wpe 's/\n$/ /;' file # replace newline with space > >>Also, the end of line anchor ($) is superfluous as there is >>only one newline in every line (unless you change the Input >>Record Separator.) > > Yes, but IMHO it's often worth adding a "superfluous" character or two to > make a program more readable -- and the original poster was a confused > newbie, after all, so I was going for "added scrutability" 8-} Yes, "more readable" is a laudable goal. Since $ can match before or after the last newline does /\n$/ match the last newline or the second-last newline? Perhaps you meant to use the end of string anchor \z instead? :-) John -- use Perl; program fulfillment From charles.e.derykus at boeing.com Thu Feb 24 13:16:28 2005 From: charles.e.derykus at boeing.com (DeRykus, Charles E) Date: Thu Feb 24 13:16:48 2005 Subject: SPUG: Module installation Message-ID: <5DF8FDE8DFE8744388602480FDCC0E3106F3D02C@xch-nw-23.nw.nos.boeing.com> Yes, something's clearly cattywampus in your prod. install. You might want to investigate variant Perl installs on the dev/prod hosts. Could the production box compiler have been upgraded or removed for instance...? Does it match the compiler version that Perl was built with...? Run perl -V on both boxes and look for the 'cc' settings. More imporant probably would be to reprise what occurred when the admin ran the Date::Calc module install...? Did he use CPAN to do it....? What failed, etc. It's hard to know without some more sleuthing. -- Charles DeRykus -----Original Message----- From: Peterson, Eric D. [mailto:Eric.Peterson@wwireless.com] Sent: Thursday, February 24, 2005 11:02 AM To: DeRykus, Charles E; spug-list@pm.org Subject: RE: SPUG: Module installation Yes, both are v.5.4. As for the configure options, the SA didn't tell/ask me about them. You think it might be an effect of how Perl itself was made on each machine? ________________________________________ Eric D. Peterson, Reporting Prediction is very difficult, especially about the future. -Niels Bohr -----Original Message----- From: DeRykus, Charles E [mailto:charles.e.derykus@boeing.com] Sent: Thursday, 24 February, 2005 10:53 To: Peterson, Eric D.; spug-list@pm.org Subject: RE: SPUG: Module installation Do you know if the same version and configure options of Date-Calc were used...? I don't know the recent version history of Date-Calc but it almost looks as if there might be a pure-perl version as well as an option for configuring a compiled component since the development box has the arch. specific PA-RISC2.0 in the path. -- Charles DeRykus -----Original Message----- From: Peterson, Eric D. [mailto:Eric.Peterson@wwireless.com] Sent: Thursday, February 24, 2005 9:10 AM To: 'spug-list@pm.org' Subject: SPUG: Module installation I've a question about installing Perl Modules on HPUX. On our dev box a module got installed as /opt/perl/lib/site_perl/5.6.1/PA-RISC2.0-thread-multi/Date/Calc.pm Whereas on the production box it got installed as /opt/perl5/lib/site_perl/5.6.1/Date-Calc-5.4/Calc.pm When I run code to use this module, it runs successfully in Dev but fails in Production. I'm not the root user and am not the person to do the make. What can I tell my SA that would help him? He seems to be at a loss on how to install Perl Modules. #!/usr/bin/perl -T use warnings; use strict; use Date::Calc qw/Today Add_Delta_Days/; Can't locate loadable object for module Date::Calc in @INC (@INC contains: /opt/perl5/lib/site_perl/5.6.1/Date-Calc-5.4 /opt/perl5/lib/5.6.1/PA-RISC2.0-thread-multi /opt/perl5/lib/5.6.1 /opt/perl5/lib/site_perl/5.6.1/PA-RISC2.0-thread-multi /opt/perl5/lib/site_perl/5.6.1 /opt/perl5/lib/site_perl) at ./d line 46 Compilation failed in require at ./d line 46. BEGIN failed--compilation aborted at ./d line 46. ________________________________________ Eric D. Peterson, Reporting Dreams that do come true can be as unsettling as those that don't. -Brett Butler, Keep Deep in Paradise -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/spug-list/attachments/20050224/670cf932/attachment.htm From sthoenna at efn.org Thu Feb 24 14:02:52 2005 From: sthoenna at efn.org (Yitzchak Scott-Thoennes) Date: Thu Feb 24 14:03:02 2005 Subject: SPUG: itm 60 in effective perl programming In-Reply-To: <20050224182630.GC2661@synapse.brain.org> References: <421D8654.3060506@hotmail.com> <20050224083745.GA2661@synapse.brain.org> <421DAD76.7080709@telus.net> <20050224182630.GC2661@synapse.brain.org> Message-ID: <20050224220252.GC3048@efn.org> On Thu, Feb 24, 2005 at 10:26:30AM -0800, Ben Reser wrote: > > I'm fully aware of what the original is doing. But if it's described as > joining all the lines in a file it doesn't do that. Just because you > can use the regex operator to do something doesn't mean it's the most > efficient. And many times it's not the most readable. > > IMHO this script is seriously bugged. It's misusing the <> operator and > I'm a bit suprised to hear that it was found in a book titled Effective > Perl. The description given by the original poster said "joins lines in a file", not *all* the lines in a file. The original code does in fact do that, and in a way that makes it reasonable to suppose that the input file is known to have an even number of lines. From krahnj at telus.net Thu Feb 24 14:09:32 2005 From: krahnj at telus.net (John W. Krahn) Date: Thu Feb 24 14:44:05 2005 Subject: SPUG: itm 60 in effective perl programming In-Reply-To: <20050224182630.GC2661@synapse.brain.org> References: <421D8654.3060506@hotmail.com> <20050224083745.GA2661@synapse.brain.org> <421DAD76.7080709@telus.net> <20050224182630.GC2661@synapse.brain.org> Message-ID: <421E509C.90505@telus.net> Ben Reser wrote: > On Thu, Feb 24, 2005 at 02:33:26AM -0800, John W. Krahn wrote: > >>>$ echo 'foo' > test >>>$ echo 'bar' >> test >>>$ echo 'baz' >> test >>>$ wc -l test >>> 3 test >>>$ perl -pe 's/\n/" " . <>/e' test >>>foo bar >> >>The two lines 'foo' and 'bar' *are* joined together! >> >>>baz > > Umm but not baz. > > >>>And in fact hangs until you Ctrl+D it if there is an odd number of lines >>>in the file. >> >>It didn't when I tried it and it shouldn't according to the documentation. > > It doesn't if you have an even number of lines. An odd number and it > does. I feel silly now. I was streaming the the input to the perl program instead of reading from a file so it worked. To get an odd number of lines from a file with an even number of lines I was using: head -n -1 file | perl -pe 's/\n/" " . <>/e' [big snip] >>>Perhaps they meant this: >>>perl -pe 's/\n/ /' file >>> >>>tr would probably be moderately better: >>>perl -pe 'tr/\n/ /' >>> >>>But I'd prefer the following: >>>perl -pe 'chomp; $_ .= " "' file >> >>Your examples replace *every* newline with a space which is not what the >>original does. > > Umm yes I realize that. I even explained that. The original doesn't > join every line. Which isn't what he said it did. It joins every other > line. Which I suppose if that's what you want is fine but that's not > what he said it did. > >>>I can't imagine why anyone would want to use the regex version. >> >>Because the substitution operator allows you to _e_valuate the replacement >>string as a perl expression. > > I'm fully aware of what the original is doing. But if it's described as > joining all the lines in a file it doesn't do that. Just because you > can use the regex operator to do something doesn't mean it's the most > efficient. And many times it's not the most readable. > > IMHO this script is seriously bugged. It's misusing the <> operator and > I'm a bit suprised to hear that it was found in a book titled Effective > Perl. I guess you don't have the book? From the chapter "Some interesting Perl one-liners." in "Effective Perl Programming" page 249: perl -pe 's/\n/" " . <>/e' data Randal posted something like this in response to a request for a program that would take lines from a file and join them together in pairs. For example, here's an input file: Testing one two three This one-liner turns the input into the following: Testing one Each line is two of the old lines two three joined together with a space. The -pe command line option used above (a combination of -p and -e) yields a program that acts like the following: while (<>) { s/\n/" " . <>/e; print; } I sputtered a bit when I saw this one-liner for the first time because I had never thought of using <> in a substitution. But it is fairly straightforward otherwise. Note that you have to substitute for \n. Nothing else--for exam- ple, the $ anchor--will work. John -- use Perl; program fulfillment From mhersant at comcast.net Thu Feb 24 23:11:34 2005 From: mhersant at comcast.net (Matt) Date: Thu Feb 24 23:11:38 2005 Subject: SPUG: some interesting jobs Message-ID: <421ECFA6.50101@comcast.net> Hello, Here is some job info for the SPUG community: Software Developer Engineer-2 in Java Scripting Redmond Software Design Engineer-3 Redmond 2-JOBS-Perl Build Engineer, Redmond Perl /VB scripting Builder Entry Level Perl Builder, Redmond 2-JOBS- Source Depot Builders Below are the open jobs that I am working on. If you see anything that you feel would be a good fit them please send me your updated resume and a brief paragraph on why you would be a good fit for this opportunity. The hiring managers are not the best at reading resume so if you could be very specific on the paragraph that you write to me, it would be very helpful. In return for this information I will do my best to get you in front of the right person and give you honest feedback at all times. Siemens Business Services, Inc., (www.sbs-usa.siemens.com) is a Tier-One provider of Information Technology services to Fortune 1000 companies and other large, information intensive businesses. Siemens Business Services, Inc. (SBS), plans, builds runs and manages the distributed computing information technology infrastructure for its customers. We provide the complete spectrum of integrated technology and process-related business services ranging from Infrastructure/Helpdesk Outsourcing Management, Consulting in the design and implementation of ERP, CRM, SCM solutions, to the management of IT infrastructures from the Data center to End-user devices. Both industry analysts and our many loyal customers have recognized Siemens Business Services as a leader in distributed computing management services and a leader in this space. With North American headquarters in Norwalk, CT., Siemens Business Services, Inc. provides coverage through over 50 locations in major metropolitan markets. SBS is a business unit of Siemens Business Services GmbH, a global e-business and IT solution provider employing more than 35,000 professionals. Our parent company, Siemens AG, is a global electronics and engineering powerhouse with more than $74 billion in annual sales and 460,000 employees in 193 countries and 70,000 in the USA. MA-90337463-C# Software Developer Engineer-2 in Java Scripting Redmond-30-40 an hour The Mobile PC business unit is hiring a Software Developer Engineer to help develop and ship User Assistance Content and Features for Longhorn. The ideal candidate will possess a thorough knowledge of Microsoft Help v.1.3 and v.2.0, as well as Microsoft User Assistance tools. One or more years experience preferred in producing online help, creating content using HTML, DHTML, Javascript, CSS and XML using typical tools. C++,C# Trident, and Win32 API knowledge is required. Strong familiarity with XML/XSL, schemas (XSD and DTD), and ASP.Net would be an additional benefit. Position Description: Develops software programs of a complex nature, including operating systems, applications, and/or network products for external customer use. Designs and performs analysis on moderately complex programs and systems. Contributes to the development of processes and methodology. Assists in the development of assignments and schedules. The Mobile PC business unit is hiring a Software Developer Engineer to help develop and ship User Assistance Content and Features for Longhorn. The ideal candidate will possess a thorough knowledge of Microsoft Help v.1.3 and v.2.0, as well as Microsoft User Assistance tools. One or more years experience preferred in producing online help, creating content using HTML, DHTML, Javascript, CSS and XML using typical tools. C++,C# Trident, and Win32 API knowledge is required. Strong familiarity with XML/XSL, schemas (XSD and DTD), and ASP.Net would be an additional benefit. Qualifications: 2 plus years work related experience required. Relevant technical skill required. Strong communication skills required. May require advanced knowledge of programming languages and/or development tools in one area, and moderate level skills in multiple areas. Bachelor's degree in Engineering, Computer Science or related technical field required. Master's degree is preferred and may substitute for a portion of the related experience. Please send your resume in MS word and a brief paragraph on why you are a good fit for this position. v-micsul@microsoft.com VC-90328173 Software Design Engineer-3 Redmond, WA $40 to 60 an hour. 6-12 Month Contract Group: Small Business Payroll Product development team for the Small Business Market. Requirements: Looking for an experienced candidate that has built and developed hosted / web service applications and has experience ensuring that the app was secure. Sequel background preferred. Must have prior knowledge in building client sever applications for windows platforms using C, C+,C# with a solid understanding of .Net and OOP implantations. We really do need someone that has experience with all of the above listed skills.. We are looking for a candidate who has experience designing, developing and deploying secure hosted applications. The ideal candidate should have 2-7 years experience in developing w/ technologies: C+,C#, networking, SQL, Web services (IIS/.Net), XML, distributed operating system (Windows XP/Server), system programming (threaded, queuing, networking, async i/o, etc), Passport authentication and encryption methods (SSL etc.). Has developed high scale/high performance systems; experience implementing monitoring/instrumentation at all levels of the design; knowledge of distributed / hosted systems, very solid coding/debugging skills (particularly live site issues); demonstrated success at dealing with ambiguous problems; Familiarity with building solutions to fit the MSN provisioning/sign up/billing model and hosting a solution in the MSN datacenter is desired not a requirement. They must have contributed to at least one released product throughout the full product-development cycle, preferably for a Web-based product including a strong track record of shipping secure, high quality software through all phases of the product cycle. SBP responsibilities: " Develop and deploy the integration between a win32 client application and a calculation web services hosted by MSN. This integration will require authentication and authorization via Passport 3.0 and the MSN Billing service. Also responsible for prototyping to ensure easy of use and to ensure performance criteria compliance. " Help ensure overall webservice security. " Lead effort to determine if SSL or XMLencryption should / can be used. " Implementation of monitoring integration with MSNops. " Lead effort to implement strategy to ensure that the client and is a valid licensed client authorized to utilize the calculation web service. " Lead effort to help identify and mitigate all threat analysis issues relating to hosting. " Please send your resume in MS word and a brief paragraph on why you are a good fit for this position. v-micsul@microsoft.com 2-JOBS-BH-BA- 90333748- Perl Build Engineer, Redmond Target rate 20 to 30 an hour 6-12 Month could go to a FTE Position Description: Works with development teams to build all components of a software product, including maintaining batch files and tools, to keep up with changes in the product. Sets up initial build trees, performs, debugs and fixes builds. Works closely with the members of the build team and proactively identifies and implements procedures to parallelize and streamline the build process. Qualifications: Knowledge of Perl is a MUST have skill. Someone that can own and build scripts. Dos batch files, Perl scripting, able to write scripts. Communicate with a group of 60 to 70 people. Full knowledge of build breaks is also a must have skill with debugging skills. Strong communication skills and the ability to work independently, and as part of a team required. Knowledge of source depot code with C+ and C#. There will be over time on this job. Good chance it will go to a FTE for the right person. " What is your group's function? Group is Web Platforms & Tools. We are responsible for the IIS, ASP.NET and Visual Web Developer products. " What are the 4-5 technical skills required? Managing build processes and build scripts - DOS batch files, java script and some Perl. Being able to look at and fix build breaks in C# and C++ code. Knowledge of Source Depot/Product Studio and Microsoft processes will be a big plus (though not a requirement since it can be picked up on the job). Capability to debug C# and C++ code is a nice to have. " Please outline skills that would be viewed as bonus areas and prioritize in order of importance including must have vs. nice to have) It is necessary to be able to juggle multiple high priority tasks at the same time. It is also necessary to work with a lot of different people - good communication and people skills are a must. " What are the daily/weekly tasks? Maintaining private branches and doing reverse/forward integrations to the main code branch. Daily builds and verification out of the private branch. Please send current resume in MS word and please send me a quick paragraph outlining how your skills fit this requirement. Thanks again for your time, Mike S v-micsul@microsoft.com CH- 90335982-Perl /VB scripting Builder, Redmond Target rate 20 to 30 an hour 6-12 Month Position Description: Mid level tester may work very well for this opportunity. Strong problem solving skills required. 15 to 20 people in group that you will need to work with on a daily basis. Strong Break fix background. Source depot, Perl, and VB. Works with development teams to build all components of a software product, including maintaining batch files and tools, to keep up with changes in the product. Sets up initial build trees, performs, debugs and fixes builds. Works closely with the members of the build team and proactively identifies and implements procedures to parallelize and streamline the build process. Qualifications: Knowledge of Perl is a MUST have skill. Dos batch files, Perl scripting, able to write scripts. Full knowledge of build breaks is also a must have skill with debugging skills. Strong communication skills and the ability to work independently, and as part of a team required. There will be over time on this job. Please send current resume in MS word and please send me a quick paragraph outlining how your skills fit this requirement. Thanks again for your time, Mike S v-micsul@microsoft.com 4-OPENINGS-SG- 90339303-Entry Level Perl Builder, Redmond Target rate 15 to 25 an hour 6-12 Month could turn into a FTE Position Description: Strong problem solving and trouble shooting skills required. 6 to 7 people in group that you will need to work with on a daily basis. Understanding of Break fix. Understanding of Source depot, Perl, and VB. Sets up initial build trees, performs debugs and fixes builds. Works closely with the members of the build team and proactively identifies and implements procedures to parallelize and streamline the build process. Qualifications: Knowledge of Perl is a MUST have skill. Dos batch files would be a nice to have skills, Perl scripting...nice to have skill, able to write scripts would be very useful. Knowledge of build breaks will alos be very helpful. Strong communication skills and the ability to work independently, and as part of a team required. There will be over time on this job. Could turn into a FTE. Please send current resume in MS word and please send me a quick paragraph outlining how your skills fit this requirement. Thanks again for your time, Mike S v-micsul@microsoft.com 2-JOBS-TE-MA- 90329698-4133-Source Depot Builder, Redmond Target rate 20 to 30 an hour 12 Month GroupsMoble PC Group/Media Center TEAM Perl scripting, Shell Scripting, VB script, MUST have prior knowledge of Source depot Position Description: Works with the Mobile PC Platforms User Research and User Assistance teams to build all components of a software product, including building the Help platform. This person will maintain batch files and tools, to keep up with changes in the product. Sets up initial build trees, performs, debugs, and works with developers to ensure that the available code can be turned into effective prototypes. Works with the UA team to create private help builds in addition to dropping help files to the product build. Responsible for implementing the help update mechanisms for the Mobile PC Platforms UA team. May drive the development and maintenance of build and test automation tools for the User Assistance team. Qualifications: 2 plus years work related experience required. Prior build experience is required for thes two jobs. Knowledge of applicable build processes and of Microsoft development tools required. Knowledge of Windows is required. Perl, Batch/Shell Scripting or VBScript knowledge is required. Strong communication skills, the ability to work independently and as part of a team required. Knowledge of source code control systems required; Source Depot, SourceSafe, and Product Studio preferred. Familiarity with product development cycle as well as knowledge of international issues is required. Shell scripting skill are required and software development test skills would be a definite bonus and help the candidate stand out. Mid level tester may work very well for this opportunity. Strong problem solving skills required. 15 to 20 people in group that you will need to work with on a daily basis. Strong Break fix background. Source depot, Perl, and VB. Works with development teams to build all components of a software product, including maintaining batch files and tools, to keep up with changes in the product. Sets up initial build trees, performs, debugs and fixes builds. Works closely with the members of the build team and proactively identifies and implements procedures to parallelize and streamline the build process. Please send current resume in MS word and please send me a quick paragraph outlining how your skills fit this requirement. Thanks again for your time, Mike S v-micsul@microsoft.com From florentin_ at hotmail.com Thu Feb 24 23:23:35 2005 From: florentin_ at hotmail.com (Florentin Ionescu) Date: Thu Feb 24 23:23:44 2005 Subject: SPUG: itm 60 in effective perl programming In-Reply-To: <20050224084023.GB2661@synapse.brain.org> References: <421D8654.3060506@hotmail.com> <20050224083745.GA2661@synapse.brain.org> <20050224084023.GB2661@synapse.brain.org> Message-ID: <421ED277.20407@hotmail.com> Sorry for my confusing question, it should have been "program to join 2 consecutive lines". Thank you everybody for answers. From andrew at sweger.net Thu Feb 24 23:34:51 2005 From: andrew at sweger.net (Andrew Sweger) Date: Thu Feb 24 23:35:00 2005 Subject: SPUG: job postings, please don't Message-ID: A gentle reminder to list members: Please do not post job announcements to the SPUG list. Despite your best intentions, we decided a long time ago that we would prefer that job postings be screened before going to the list. There's no censorship involved (other than stubby fingers, perhaps). Please review the instructions on the (otherwise hopelessly out-of-date) SPUG website: http://seattleperl.org/#Jobs Thanks! -- Andrew B. Sweger -- The great thing about multitasking is that several things can go wrong at once. From rcordek at cmp.com Fri Feb 25 01:01:18 2005 From: rcordek at cmp.com (rcordek@cmp.com) Date: Fri Feb 25 01:01:34 2005 Subject: SPUG: Ron Cordek/IRV/CMPNotes is out of the office. Message-ID: I will be out of the office starting 02/24/2005 and will not return until 03/01/2005. I will have marginal access to email so please contact me via cellular 714-305-7313 if you need immediate contact or I will respond to your message when I return. Thanks. From bill at celestial.com Fri Feb 25 09:19:40 2005 From: bill at celestial.com (Bill Campbell) Date: Fri Feb 25 09:19:44 2005 Subject: SPUG: job postings, please don't In-Reply-To: References: Message-ID: <20050225171940.GB86948@alexis.mi.celestial.com> On Thu, Feb 24, 2005, Andrew Sweger wrote: >A gentle reminder to list members: Please do not post job announcements to >the SPUG list. Despite your best intentions, we decided a long time ago >that we would prefer that job postings be screened before going to the >list. There's no censorship involved (other than stubby fingers, perhaps). >Please review the instructions on the (otherwise hopelessly out-of-date) >SPUG website: Unix related job postings may also go to slug-jobs@lists.seaslug.org, a moderated list ostensibly for members of the Seattle Unix Group, but anybody can subscribe through the web interface. http://lists.seaslug.org/mailman/listinfo/slug-jobs Bill -- INTERNET: bill@Celestial.COM Bill Campbell; Celestial Software LLC UUCP: camco!bill PO Box 820; 6641 E. Mercer Way FAX: (206) 232-9186 Mercer Island, WA 98040-0820; (206) 236-1676 URL: http://www.celestial.com/ ``Democracy Is Mob Rule with Income Taxes'' From jlb at io.com Fri Feb 25 09:39:21 2005 From: jlb at io.com (jlb) Date: Fri Feb 25 09:39:36 2005 Subject: SPUG: job postings, please don't In-Reply-To: <20050225171940.GB86948@alexis.mi.celestial.com> References: <20050225171940.GB86948@alexis.mi.celestial.com> Message-ID: <20050225113803.D69732@eris.io.com> > Unix related job postings may also go to slug-jobs@lists.seaslug.org, a > moderated list ostensibly for members of the Seattle Unix Group, but > anybody can subscribe through the web interface. > http://lists.seaslug.org/mailman/listinfo/slug-jobs There's also the perl jobs list, for those who don't know, but I think most of the listed jobs above were already posted there. Email jobs-help@perl.org for an automated response. Jon