From jay.kominek at colorado.edu Tue Aug 1 00:56:50 2000 From: jay.kominek at colorado.edu (Jay Kominek) Date: Wed Aug 4 23:58:23 2004 Subject: [boulder.pm] filehandle question In-Reply-To: Your message of "Fri, 28 Jul 2000 13:27:41 MDT." <3981DEAD.CF5D96BF@uswest.net> References: <3981DEAD.CF5D96BF@uswest.net> Message-ID: > I can do things like ls and pwd on the remote machine, but cannot seem > to figure out how to read & append the remote file. I have tried using > the filehandles IN & OUT as well as the actual filenames as shown above, > w/ no luck. Any suggestions will be greatly appreciated. > thanks Telnet simply does not work in the fashion you want it to. You could have your perl program execute a Perl oneliner on the other host which would dump the file out in some format you could easily detect and suck back up on your end. NFS or Coda or some other network filesystem sounds like it might be the most appropriate solution, however. - Jay Kominek The NSA is now hiring. Send your resume to Fort Meade, or speak into the thermostat. From walter at frii.com Tue Aug 1 16:04:36 2000 From: walter at frii.com (Walter Pienciak) Date: Wed Aug 4 23:58:23 2004 Subject: [boulder.pm] Available Perl Position ... (fwd) Message-ID: ---------- Forwarded message ---------- Date: Tue, 01 Aug 2000 16:44:57 -0400 From: Joshua K. Gurin To: [snipped a long list of perlfolk addresses] Subject: Available Perl Position ... Please feel free to forward this on to anyone you think might be interested: The Maxim Group in Sacramento, CA has a position available in mid August for a mid to senior level Perl Programmer to work at its client, a leading international hardware/software company. The day to day duties of this position would be to help support an existing application as well as assist in the re-development of the production tracking system application. The technical requirements for this position are strong experience with Perl developing various stages of the software life cycle. Experience with SQL is a must, preferably with Sybase but any strong SQL experience is fine. Experience with Unix Shell Scripting languages and tools (i.e. Korn, AWK, SED, and Business Objects v.3) are also important. Any exposure to web-based projects is also helpful. This position is scheduled for and requires a commitment of 5 months. There is the strong likelihood of extensions based on performance. A drug and background check is required. Immediate eligibility to work as a direct W-2 employee in the United States is required. Maxim Group has been a leader in the IT consulting industry since 1987 because we do what it takes to keep our consultants challenged and rewarded. At Maxim Group, we place an emphasis on building strong relationships with our consultants and clients. From the personal delivery of your weekly checks to our dedication to finding a placement or each of our consultants after the end of a project, you will find our service to be number one in the industry. At Maxim Group, your health and well-being matter to us. That's why we offer our team members a variety of benefits including health insurance, dental and vision, vacation, and personal days, holiday pay, 401k, and professional and technical training. If you are interested or would like more information, please contact Josh Gurin at (800) 834-6385 ext.3035 or (916) 561-3035 or jgurin@maximgroup.com You are also welcome to visit our website at www.maximgroup.com From amar.vattakandy at ia.nsc.com Wed Aug 2 17:21:57 2000 From: amar.vattakandy at ia.nsc.com (Amar Vattakandy) Date: Wed Aug 4 23:58:23 2004 Subject: [boulder.pm] unblocked pipes Message-ID: <39889F05.5D46416B@ia.nsc.com> Any help on this would be appreciated: | I have a parent and a child (thru forking) that needs to talk to each | other thru a | socket pair pipe. Communication works fine, but the problem happens when | I try | to read from a pipe that has no data in it. The read, which is like | $readline = ; | keeps waiting till the child has some data in it. I know that this is | how it is supposed | to work, but is there any way I could check whether there is some data | in the pipe | before I read the pipe ? | | Thanx | Amar -- ********************************* Amar Salaj V National Semiconductor Corporation 1351 S Sunset St. Longmont CO-80501 Ph : 303 774 5181 Fax : 303 774 5801 ********************************* From nagler at bivio.com Wed Aug 2 17:45:20 2000 From: nagler at bivio.com (Rob Nagler) Date: Wed Aug 4 23:58:23 2004 Subject: [boulder.pm] unblocked pipes References: <39889F05.5D46416B@ia.nsc.com> Message-ID: <3988A480.8E62E02F@bivio.com> Amar Vattakandy wrote: > | before I read the pipe ? http://www.perl.com/pub/doc/manual/html/pod/perlipc.html Look at "select". It allows you to "poll" the pipe. I wouldn't recommend polling. You might rather consider two processes: one for reading and one for writing. Really depends on the application, though. It might be problematic to use: $readline = ; This assumes that a newline is returned. If a newline isn't returned even if select returns true, the call won't return. Rob From asherman1 at uswest.net Wed Aug 2 19:17:47 2000 From: asherman1 at uswest.net (arnie) Date: Wed Aug 4 23:58:23 2004 Subject: [boulder.pm] filehandle question References: <3981DEAD.CF5D96BF@uswest.net> Message-ID: <3988BA2B.4782C765@uswest.net> Hi Jay, As suggested by a member of the Boulder LUG, I was able to do what I needed with rcp. Thanks for your suggestion though. arnie Jay Kominek wrote: > > I can do things like ls and pwd on the remote machine, but cannot seem > > to figure out how to read & append the remote file. I have tried using > > the filehandles IN & OUT as well as the actual filenames as shown above, > > w/ no luck. Any suggestions will be greatly appreciated. > > thanks > > Telnet simply does not work in the fashion you want it to. > > You could have your perl program execute a Perl oneliner on the other > host which would dump the file out in some format you could easily > detect and suck back up on your end. > > NFS or Coda or some other network filesystem sounds like it might be > the most appropriate solution, however. > > - Jay Kominek > The NSA is now hiring. Send your resume to > Fort Meade, or speak into the thermostat. -- arnie sherman frenomulax@bigfoot.com "I'm only Bob Dylan when I have to be." - Bob Dylan From asherman1 at uswest.net Wed Aug 2 19:18:01 2000 From: asherman1 at uswest.net (arnie) Date: Wed Aug 4 23:58:23 2004 Subject: [boulder.pm] filehandle question References: <3981DEAD.CF5D96BF@uswest.net> Message-ID: <3988BA39.B88CC6F2@uswest.net> Hi Jay, As suggested by a member of the Boulder LUG, I was able to do what I needed with rcp. Thanks for your suggestion though. arnie Jay Kominek wrote: > > I can do things like ls and pwd on the remote machine, but cannot seem > > to figure out how to read & append the remote file. I have tried using > > the filehandles IN & OUT as well as the actual filenames as shown above, > > w/ no luck. Any suggestions will be greatly appreciated. > > thanks > > Telnet simply does not work in the fashion you want it to. > > You could have your perl program execute a Perl oneliner on the other > host which would dump the file out in some format you could easily > detect and suck back up on your end. > > NFS or Coda or some other network filesystem sounds like it might be > the most appropriate solution, however. > > - Jay Kominek > The NSA is now hiring. Send your resume to > Fort Meade, or speak into the thermostat. -- arnie sherman frenomulax@bigfoot.com "I'm only Bob Dylan when I have to be." - Bob Dylan From walter at frii.com Thu Aug 3 12:06:28 2000 From: walter at frii.com (Walter Pienciak) Date: Wed Aug 4 23:58:23 2004 Subject: [boulder.pm] extracting images from a PDF file? Message-ID: I'm trying to figure out a way to extract images from PDF files and save them as separate files. Has anyone seen anything like this? Perl or otherwise? Any combination of kludges and glue that will let this be done programmatically will be gratefully accepted. =8^0 Walter From rise at ipopros.com Thu Aug 3 12:32:16 2000 From: rise at ipopros.com (rise) Date: Wed Aug 4 23:58:23 2004 Subject: [boulder.pm] extracting images from a PDF file? In-Reply-To: Message-ID: > I'm trying to figure out a way to extract images from > PDF files and save them as separate files. The xpdf (http://www.foolabs.com/xpdf/about.html) package contains pdfimages which extracts to PPM, PBM, and JPEG. It has a couple of useful options and a reasonably predictable image naming scheme. Jonathan Conway Senior DBA ipoPros.com From moore at xor.com Thu Aug 3 12:38:09 2000 From: moore at xor.com (Dan Moore) Date: Wed Aug 4 23:58:23 2004 Subject: [boulder.pm] extracting images from a PDF file? In-Reply-To: Message-ID: I've not tried this, but you may want to look at the Text-PDF module. In the readme.txt, it refers to a small example script thusly: pdfgetobj Extracts a particular object from a PDF file (debugging aid) This script has the following help message: PDFGETOBJ [-g gen] -n num [-o outfile] pdffile Gets the given object from the pdf file and unpacks it to either stdout or outfile. -g gen Generation number [0] -n num Object number -o outfile Output file Hope this helps. Dan On Thu, 3 Aug 2000, Walter Pienciak wrote: > I'm trying to figure out a way to extract images from > PDF files and save them as separate files. > > Has anyone seen anything like this? Perl or otherwise? > > Any combination of kludges and glue that will let this > be done programmatically will be gratefully accepted. =8^0 > > Walter > > -- Dan Moore Programmer XOR Inc. "No amount of sophistication is going to allay the fact that all your knowledge is about the past and all your decisions are about the future." -- Ian E. Wilson From walter at frii.com Thu Aug 3 13:25:50 2000 From: walter at frii.com (Walter Pienciak) Date: Wed Aug 4 23:58:23 2004 Subject: [boulder.pm] extracting images from a PDF file? In-Reply-To: Message-ID: On Thu, 3 Aug 2000, rise wrote: > > I'm trying to figure out a way to extract images from > > PDF files and save them as separate files. > > The xpdf (http://www.foolabs.com/xpdf/about.html) package contains > pdfimages which extracts to PPM, PBM, and JPEG. It has a couple of useful > options and a reasonably predictable image naming scheme. > > Jonathan Conway > Senior DBA > ipoPros.com This was painless and worked like a charm. You've saved me a fair bit of effort. Thanks. Walter From rise at ipopros.com Thu Aug 3 13:49:44 2000 From: rise at ipopros.com (rise) Date: Wed Aug 4 23:58:23 2004 Subject: [boulder.pm] extracting images from a PDF file? In-Reply-To: Message-ID: > On Thu, 3 Aug 2000, rise wrote: > > The xpdf (http://www.foolabs.com/xpdf/about.html) package contains > > pdfimages which extracts to PPM, PBM, and JPEG. It has a couple of useful > > options and a reasonably predictable image naming scheme. > > This was painless and worked like a charm. You've saved me a fair bit > of effort. Score one for SuSE Linux's 'provide scary amounts of software so you never have to download it approach'. I used 'man -k pdf' to find it. Of course updating the man/whatis cache on my machine takes a couple of hours in the background, so YMMV... Jonathan Conway Senior DBA ipoPros.com From amar.vattakandy at ia.nsc.com Thu Aug 3 15:44:20 2000 From: amar.vattakandy at ia.nsc.com (Amar Vattakandy) Date: Wed Aug 4 23:58:23 2004 Subject: [boulder.pm] unblocked pipes References: <39889F05.5D46416B@ia.nsc.com> Message-ID: <3989D9A3.F626D727@ia.nsc.com> Finally, found the solution. Thanx to you guys.. And the answer is in setting the non bocking flag on fctl. Here is a snippet of code, if any one fall into the same pit that I was in for the last couple of days. == use Tk ; use Socket ; use Fcntl ; use Tk::FileSelect ; use IO::Handle; require Tk::Dialog; # Open the pipes for communication between the background process # and the GUI socketpair(BKGROUND,GUI,AF_UNIX,SOCK_STREAM,PF_UNSPEC) or die "Bad Socketpair $!"; $SockFlags = ''; fcntl(BKGROUND,F_GETFL,$SockFlags) or die "Cant get Flags: $!"; $SockFlags |= O_NONBLOCK; fcntl(BKGROUND,F_SETFL,$SockFlags) or die "Cant set Flags: $!"; fcntl(GUI,F_GETFL,$SockFlags) or die "Cant get Flags: $!"; $SockFlags |= O_NONBLOCK; fcntl(GUI,F_SETFL,$SockFlags) or die "Cant set Flags: $!"; BKGROUND ->autoflush(1); GUI ->autoflush(1); == Now, the forked processes could talk to each other like $blahFromGUI = ; or printf (GUI "$blahToGUI \n"); etc... Call me stupid, but I had lost a lot of time debugging apps with no \n in their messages and expected the autoflush to work.. Anyway, the rest of the code from the background process while (1) { $blahFromGUI = ; if (defined $blahFromGUI) { chomp($blahFromGUI); printf("Child: Got $blahFromGUI\n"); } else { printf("Child Did Not Receive Anything \n"); } sleep 1 ; } Hoping someone would find it useful.. Amar Vattakandy wrote: > Any help on this would be appreciated: > > | I have a parent and a child (thru forking) that needs to talk to each > | other thru a > | socket pair pipe. Communication works fine, but the problem happens > when > | I try > | to read from a pipe that has no data in it. The read, which is like > | $readline = ; > | keeps waiting till the child has some data in it. I know that this is > > | how it is supposed > | to work, but is there any way I could check whether there is some > data > | in the pipe > | before I read the pipe ? > | > | Thanx > | Amar > > -- > > ********************************* > Amar Salaj V > National Semiconductor Corporation > 1351 S Sunset St. > Longmont CO-80501 > > Ph : 303 774 5181 > Fax : 303 774 5801 > > ********************************* -- ********************************* Amar Salaj V National Semiconductor Corporation 1351 S Sunset St. Longmont CO-80501 Ph : 303 774 5181 Fax : 303 774 5801 ********************************* From jay.kominek at colorado.edu Fri Aug 4 00:34:00 2000 From: jay.kominek at colorado.edu (Jay Kominek) Date: Wed Aug 4 23:58:23 2004 Subject: [boulder.pm] Catching incorrect subroutine calls Message-ID: I was playing with the AUTOLOAD subroutine earlier tonight, and then I decided that I should send something useful to the mailing list. So I decided to cross both things. When programming, one occasionally makes typos. As unpleasent as it is to admit our own imperfection, it can and does happen. :) When it happens with subroutines in Perl, you get the exceedingly useful message: [jkominek@nehwon /home/jkominek]$ perl -e '&foo;' Undefined subroutine &main::foo called at -e line 1. Spectacular. It tells us what subroutine doesn't exist, and what line it is on. What more could you possibly want? Not much for static subroutines. However, what if you're actually writing _interesting_ Perl and you're dynamically defining subroutines, or eval'ing code that you've constructed with strings that were originally Unicode cyrillic that you've turned into Perl with a regular expression? You're in trouble. AUTOLOAD to the rescue. AUTOLOAD automatically catches all invalid subroutine references and executes itself. All of the subroutine arguments are placed into @_, the standard place, while the name of the subroutine you tried to call is in $AUTOLOAD. AUTOLOAD { die "You tried to call $AUTOLOAD with arguments: @_\n"; } My. Thats pretty useful. Now you can see what you tried to call, what package it was in, and the arguments you passed to it. That'll do a pretty good job of narrowing it down. But wait, we can do better yet! With a little bit of magic, we can find out what called us! AUTOLOAD { my $i=0; my(@call,@stack); print "*** Wrong subroutine call auto-detector\n"; for(;;) { @call = caller($i++); # Goes back $i calls in the stack last unless @call; # once you go too far back it returns empty lists unshift @stack, [@call]; # stick them in backwards } print "* Stack trace\n"; foreach my $call (@stack) { my @call = @{$call}; print "File $call[1], package $call[0], line $call[2] called $call[3], $call[4] argument(s)\n"; } # die, because whatever subroutine you wanted to call didn't get called # so things are probably fairly hosed at this point. die "* You tried to call $AUTOLOAD with arguments: q\{@_\}\n"; # If you need more help, use Data::Dumper and then: # foreach my $structureref (@listofbigimportantdatastructureshere) { # print Dumper($structureref); # } } ^ My masterpiece for the evening. While debugging, you simply place a copy of that into every package you have. If you look up the caller function, you can also get it to print out the code which was eval'd for one of the call steps, assuming it was a string eval, not a block eval. An example program, and its output, assuming that the above subroutine is defined in package Magic: #!/usr/bin/perl sub foo { &bar; } sub bar { Magic::FlyingGerbil("frobinification", {'10am' => "softwareengineering", '2pm' => "astrophysics1", '3pm' => "algorithms"}); } &bar; This will produce output of: *** Wrong subroutine call auto-detector * Stack trace File foo.pl, package main, line 17 called main::bar, 0 argument(s) File foo.pl, package main, line 13 called Magic::AUTOLOAD, 1 argument(s) * You tried to call Magic::FlyingGerbil with arguments: q{frobinification HASH(0x80cb8fc)} You might consider replacing the die line with something that can also Data::Dumper references so you can see what was in them. Or just Data::Dumper \@_ I just realized that there is a way to get Perl to automatically do something like this with the debugging stuff. I'm going to pretend it isn't there, though, because if I admit to it, I'll have wasted all this time. But even if I do admit to it, this is more modifyable than the hardcoded dump thing, and it shows people how to use AUTOLOAD. All code was roughly tested, but I've never actually used it for the purpose described here in development code, just my test program. If it blows up and takes out part of Boulder.. well. I hope I don't live in that part, then. Code is public domain. If you make money off of it, feel free to buy me dr pepper. If you don't make money off of it, feel free to buy me dr pepper. There hasn't been a meeting in awhile, right? Lets see. I'd be up for sitting around in some public place in two or three weeks. I'm not keen on the entire meeting-in-a-restraunt since I'm too cheap to eat out. Maybe wait for school to start? We could stick up signs in the engineering center on campus then. - Jay Kominek If at first you don't succeed, Increase the amperage. From amar.vattakandy at ia.nsc.com Fri Aug 4 01:42:32 2000 From: amar.vattakandy at ia.nsc.com (Amar Vattakandy) Date: Wed Aug 4 23:58:23 2004 Subject: [boulder.pm] Perl/Tk send command References: Message-ID: <398A65D8.B9B23B12@ia.nsc.com> Has anyone got a Perl/Tk send command to work ? The man page comes with a warning, but my solaris just cannot find the other application. Any ideas ??? -- ********************************* Amar Salaj V National Semiconductor Corporation 1351 S Sunset St. Longmont CO-80501 Ph : 303 774 5181 Fax : 303 774 5801 ********************************* From nagler at bivio.com Fri Aug 4 07:31:44 2000 From: nagler at bivio.com (Rob Nagler) Date: Wed Aug 4 23:58:23 2004 Subject: [boulder.pm] Catching incorrect subroutine calls References: Message-ID: <398AB7B0.6459F108@bivio.com> > Not much for static subroutines. However, what if you're actually writing > _interesting_ Perl and you're dynamically defining subroutines, or eval'ing > code that you've constructed with strings that were originally Unicode > cyrillic that you've turned into Perl with a regular expression? We try to avoid cyrillic, but we do write lots of dynamic code. :-) However, since we always use the '->' form of calling, we know which object/class and method was not found. > Spectacular. It tells us what subroutine doesn't exist, and what line it > is on. What more could you possibly want? If you could do the same trick to tell us which variable was undefined when perl complains "use of undefined value", you'd get more than a Dr. Pepper from bivio. $-) One thing we've found to be really useful is to wrap "die" and "warn" to evaluate their arguments intelligently, i.e. if something is "undef", print undef, not another warning. :-) In addition, we can control whether stack traces are produced or not from a configuration file or the command line. Long arguments are truncated. Refences are unwrapped. And so on. I've attached a tar of some classes we developed. We'll be releasing our full neo-classical OLTP infrastructure in the Fall. I didn't fix these up. If you don't understand how to use them, send an email to this list or to me personally and I'll post an example. There are a couple of test programs. The other bits, e.g. die management and web infrastructure, are undergoing review this week and next. We're spending a chunk of August to clean them up for public use. The whole thing will be GPL'd. I didn't GPL the stuff in the tar, because it isn't ready for "release". If you really want to use them, let me know and we'll GPL the modules. > There hasn't been a meeting in awhile, right? Lets see. I'd be up for > sitting around in some public place in two or three weeks. I'm not keen > on the entire meeting-in-a-restraunt since I'm too cheap to eat out. > Maybe wait for school to start? We could stick up signs in the engineering > center on campus then. I'd be willing to sponsor the meeting place and some pizzas (sorry, ABOs only :) and soda. I just can't afford the time to organize the meeting. Send me an email if you want to organize and we can figure out a budget. Rob -------------- next part -------------- A non-text attachment was scrubbed... Name: Bivio.tgz Type: application/octet-stream Size: 12531 bytes Desc: not available Url : http://mail.pm.org/archives/boulder-pm/attachments/20000804/8163a2a0/Bivio.obj From Robert.L.Harris at rnd-consulting.com Wed Aug 9 10:33:30 2000 From: Robert.L.Harris at rnd-consulting.com (Robert L. Harris) Date: Wed Aug 4 23:58:23 2004 Subject: [boulder.pm] redirect stderr? Message-ID: <20000809093330.F24801@rnd-consulting.com> I'm doing an: open(CMD, "command -debug 2>&1 |"); while() { chomp; print OUTPUT "$Modified_\n"; } But apparantly, I'm not getting the standard error output. How do I capture this? :wq! --------------------------------------------------------------------------- Robert L. Harris | Micros~1 : Senior System Engineer | For when quality, reliability at RnD Consulting | and security just aren't \_ that important! DISCLAIMER: These are MY OPINIONS ALONE. I speak for no-one else. FYI: perl -e 'print $i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);' From walter at frii.com Wed Aug 9 12:12:07 2000 From: walter at frii.com (Walter Pienciak) Date: Wed Aug 4 23:58:23 2004 Subject: [boulder.pm] redirect stderr? In-Reply-To: <20000809093330.F24801@rnd-consulting.com> Message-ID: On Wed, 9 Aug 2000, Robert L. Harris wrote: > I'm doing an: > > open(CMD, "command -debug 2>&1 |"); > while() { > chomp; > > print OUTPUT "$Modified_\n"; > } > > > But apparantly, I'm not getting the standard error output. How do I > capture this? > > > :wq! > --------------------------------------------------------------------------- > Robert L. Harris | Micros~1 : > Senior System Engineer | For when quality, reliability > at RnD Consulting | and security just aren't > \_ that important! > DISCLAIMER: > These are MY OPINIONS ALONE. I speak for no-one else. > FYI: > perl -e 'print $i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);' Hi, Robert, This syntax looks right, so I can't think of an immediate answer. Does "command -debug 2>&1" at the command line give you any output? Does $foo = `command -debug 2>&1` put anything interesting in $foo? Walter From Robert.L.Harris at rnd-consulting.com Wed Aug 9 12:22:23 2000 From: Robert.L.Harris at rnd-consulting.com (Robert L. Harris) Date: Wed Aug 4 23:58:23 2004 Subject: [boulder.pm] redirect stderr? In-Reply-To: ; from walter@frii.com on Wed, Aug 09, 2000 at 11:12:07AM -0600 References: <20000809093330.F24801@rnd-consulting.com> Message-ID: <20000809112223.I24801@rnd-consulting.com> On the command line, it works right. And the output is definitel being put in StdErr... Robert Thus spake Walter Pienciak (walter@frii.com): > On Wed, 9 Aug 2000, Robert L. Harris wrote: > > > I'm doing an: > > > > open(CMD, "command -debug 2>&1 |"); > > while() { > > chomp; > > > > print OUTPUT "$Modified_\n"; > > } > > > > > > But apparantly, I'm not getting the standard error output. How do I > > capture this? > > > > > > :wq! > > --------------------------------------------------------------------------- > > Robert L. Harris | Micros~1 : > > Senior System Engineer | For when quality, reliability > > at RnD Consulting | and security just aren't > > \_ that important! > > DISCLAIMER: > > These are MY OPINIONS ALONE. I speak for no-one else. > > FYI: > > perl -e 'print $i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);' > > Hi, Robert, > > This syntax looks right, so I can't think of an immediate answer. > > Does "command -debug 2>&1" at the command line give you any output? > Does $foo = `command -debug 2>&1` put anything interesting in $foo? > > Walter :wq! --------------------------------------------------------------------------- Robert L. Harris | Micros~1 : Senior System Engineer | For when quality, reliability at RnD Consulting | and security just aren't \_ that important! DISCLAIMER: These are MY OPINIONS ALONE. I speak for no-one else. FYI: perl -e 'print $i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);' From walter at frii.com Wed Aug 9 12:26:14 2000 From: walter at frii.com (Walter Pienciak) Date: Wed Aug 4 23:58:23 2004 Subject: [boulder.pm] redirect stderr? In-Reply-To: <20000809112223.I24801@rnd-consulting.com> Message-ID: $|++; # Are you autoflushing the buffers? Walter From Robert.L.Harris at rnd-consulting.com Wed Aug 9 12:34:54 2000 From: Robert.L.Harris at rnd-consulting.com (Robert L. Harris) Date: Wed Aug 4 23:58:23 2004 Subject: [boulder.pm] redirect stderr? In-Reply-To: ; from walter@frii.com on Wed, Aug 09, 2000 at 11:26:14AM -0600 References: <20000809112223.I24801@rnd-consulting.com> Message-ID: <20000809113454.J24801@rnd-consulting.com> Nope. Take it that goes towards the head? Thus spake Walter Pienciak (walter@frii.com): > $|++; # Are you autoflushing the buffers? > > Walter > :wq! --------------------------------------------------------------------------- Robert L. Harris | Micros~1 : Senior System Engineer | For when quality, reliability at RnD Consulting | and security just aren't \_ that important! DISCLAIMER: These are MY OPINIONS ALONE. I speak for no-one else. FYI: perl -e 'print $i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);' From walter at frii.com Wed Aug 9 12:42:10 2000 From: walter at frii.com (Walter Pienciak) Date: Wed Aug 4 23:58:23 2004 Subject: [boulder.pm] redirect stderr? In-Reply-To: <20000809113454.J24801@rnd-consulting.com> Message-ID: On Wed, 9 Aug 2000, Robert L. Harris wrote: > Nope. Take it that goes towards the head? > > Thus spake Walter Pienciak (walter@frii.com): > > > $|++; # Are you autoflushing the buffers? > > > > Walter Nope, you're not autoflushing, or Nope, it didn't work? If you're not autoflushing, try it. Maybe you have unflushed data sitting in the pipe. (man perlfaq8) If you *are* autoflushing, and it's still not working, I'm about out of ideas without seeing the real code. Walter From Robert.L.Harris at rnd-consulting.com Wed Aug 9 12:52:19 2000 From: Robert.L.Harris at rnd-consulting.com (Robert L. Harris) Date: Wed Aug 4 23:58:23 2004 Subject: [boulder.pm] redirect stderr? In-Reply-To: ; from walter@frii.com on Wed, Aug 09, 2000 at 11:42:10AM -0600 References: <20000809113454.J24801@rnd-consulting.com> Message-ID: <20000809115219.L24801@rnd-consulting.com> Nope, I wasn't auto flushing. I won't know for a while whether or not it works. It is checking for some erattic behavior in my dns. Robert Thus spake Walter Pienciak (walter@frii.com): > > On Wed, 9 Aug 2000, Robert L. Harris wrote: > > > Nope. Take it that goes towards the head? > > > > Thus spake Walter Pienciak (walter@frii.com): > > > > > $|++; # Are you autoflushing the buffers? > > > > > > Walter > > Nope, you're not autoflushing, or Nope, it didn't work? > > If you're not autoflushing, try it. Maybe you have unflushed > data sitting in the pipe. (man perlfaq8) > > If you *are* autoflushing, and it's still not working, I'm about > out of ideas without seeing the real code. > > Walter :wq! --------------------------------------------------------------------------- Robert L. Harris | Micros~1 : Senior System Engineer | For when quality, reliability at RnD Consulting | and security just aren't \_ that important! DISCLAIMER: These are MY OPINIONS ALONE. I speak for no-one else. FYI: perl -e 'print $i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);' From walter at frii.com Wed Aug 9 15:08:30 2000 From: walter at frii.com (Walter Pienciak) Date: Wed Aug 4 23:58:23 2004 Subject: [boulder.pm] redirect stderr? In-Reply-To: <20000809115219.L24801@rnd-consulting.com> Message-ID: On Wed, 9 Aug 2000, Robert L. Harris wrote: > > > Nope, I wasn't auto flushing. I won't know for a while > whether or not it works. It is checking for some erattic > behavior in my dns. > > Robert Ah. Well, then, let us know how it goes. The DNS problem sounds interesting, but . . . I suppose if you use the word Perl in the message it would be okay ;^) On the other hand, there are at least 2 more-relevant Boulder technical lists with some high-powered admin types: Boulder Linux Users: http://lug.boulder.co.us/ (has a busy list) Colorado SAGE: http://www.co-sage.org/ (has a quiet list) Walter From Robert.L.Harris at rnd-consulting.com Wed Aug 9 15:31:03 2000 From: Robert.L.Harris at rnd-consulting.com (Robert L. Harris) Date: Wed Aug 4 23:58:23 2004 Subject: [boulder.pm] redirect stderr? In-Reply-To: ; from walter@frii.com on Wed, Aug 09, 2000 at 02:08:30PM -0600 References: <20000809115219.L24801@rnd-consulting.com> Message-ID: <20000809143103.P24801@rnd-consulting.com> I put together a very simple script to run out of cron to check the DNS to let me know when it goes nuts. I'm trying to chase down the DNS problem on another list (Silicon Valley LUG). No-one seems to know what's wrong with it. I'm on b-lugh. I believe I'm on sage. blug didn't have any help either so instead of constantly spamming the same list, i try to hit different sources. Robert Thus spake Walter Pienciak (walter@frii.com): > On Wed, 9 Aug 2000, Robert L. Harris wrote: > > > > > > > Nope, I wasn't auto flushing. I won't know for a while > > whether or not it works. It is checking for some erattic > > behavior in my dns. > > > > Robert > > Ah. > > Well, then, let us know how it goes. The DNS problem sounds > interesting, but . . . I suppose if you use the word Perl in > the message it would be okay ;^) > > On the other hand, there are at least 2 more-relevant Boulder > technical lists with some high-powered admin types: > > Boulder Linux Users: http://lug.boulder.co.us/ (has a busy list) > Colorado SAGE: http://www.co-sage.org/ (has a quiet list) > > Walter :wq! --------------------------------------------------------------------------- Robert L. Harris | Micros~1 : Senior System Engineer | For when quality, reliability at RnD Consulting | and security just aren't \_ that important! DISCLAIMER: These are MY OPINIONS ALONE. I speak for no-one else. FYI: perl -e 'print $i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);' From walter at frii.com Wed Aug 9 15:39:19 2000 From: walter at frii.com (Walter Pienciak) Date: Wed Aug 4 23:58:23 2004 Subject: [boulder.pm] redirect stderr? In-Reply-To: <20000809143103.P24801@rnd-consulting.com> Message-ID: On Wed, 9 Aug 2000, Robert L. Harris wrote: > I put together a very simple script to run out of cron to check the > DNS to let me know when it goes nuts. I'm trying to chase down the DNS > problem on another list (Silicon Valley LUG). No-one seems to know > what's wrong with it. > > I'm on b-lugh. I believe I'm on sage. blug didn't have any help either > so instead of constantly spamming the same list, i try to hit different > sources. > > Robert I don't remember seeing your problem on BLUG. Must've gone past in a crazy time. If you want to, summarize the problem again here . . . and if someone screams OT we can take it to e-mail. More than a few folks on this list wear admin hats. Walter From Robert.L.Harris at rnd-consulting.com Mon Aug 14 10:09:06 2000 From: Robert.L.Harris at rnd-consulting.com (Robert L. Harris) Date: Wed Aug 4 23:58:23 2004 Subject: [boulder.pm] IPC::Shareable examples? Message-ID: <20000814090906.C11931@rnd-consulting.com> Does anyone have any SIMPLE examples of using IPC::Shareable? I've used the one in PCB, which works at first, but then breaks. Basically what I'm trying to do: Parent gets a list of files and put the names in an array. A child is forked, reads the first entry in the array. It then modifies the file. When done modifying, it pops that entry of the array and pushes it on another. The child then goes on to the next entry in the first array, until they're all done. The parent, seeing the entry in the second array, forks a child to modify that file. This child does it work, does another pop/push combination and then exits. The first process is IO bound, the second is CPU bound, thus the desire to split them out and let them run at the same time. Doing this manually simultaneously is definitely faster than in series so I'm trying to do it with IPC. I had something kinda working with the parent just keeping track of the names, but there were times that got REAL ugly. Anyone have any examples that come close to something like this? This is just for fun, and not work so I don't have a company willing to pay anything for it. Robert :wq! --------------------------------------------------------------------------- Robert L. Harris | Micros~1 : Senior System Engineer | For when quality, reliability at RnD Consulting | and security just aren't \_ that important! DISCLAIMER: These are MY OPINIONS ALONE. I speak for no-one else. FYI: perl -e 'print $i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);' From Robert.L.Harris at rnd-consulting.com Thu Aug 17 10:07:20 2000 From: Robert.L.Harris at rnd-consulting.com (Robert L. Harris) Date: Wed Aug 4 23:58:23 2004 Subject: [boulder.pm] print/exit on error? Message-ID: <20000817090708.G12995@rnd-consulting.com> Every now and then some of the guys around here bring me scripts to look at. Currently I have one that reads through about 250 files with about 100k lines apiece. Somewhere int he middle, they're getting an error on a substr operation, line is too short. What is the cleanest way to make a perl script do something along the line or print out a variable (the file it's currently reading), $_, and then exit when it gets such an error? I could check $? or such for error condition and then exit, but is that the best way? Robert :wq! --------------------------------------------------------------------------- Robert L. Harris | Micros~1 : Senior System Engineer | For when quality, reliability at RnD Consulting | and security just aren't \_ that important! DISCLAIMER: These are MY OPINIONS ALONE. I speak for no-one else. FYI: perl -e 'print $i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);' From nagler at bivio.com Thu Aug 17 10:27:28 2000 From: nagler at bivio.com (Rob Nagler) Date: Wed Aug 4 23:58:23 2004 Subject: [boulder.pm] print/exit on error? References: <20000817090708.G12995@rnd-consulting.com> Message-ID: <399C0460.B82E9DFD@bivio.com> > What is the cleanest way to make a perl script do something along the line > or print out a variable (the file it's currently reading), $_, and then > exit when it gets such an error? There are a couple of ways, but probably the easiest is to: $SIG{__DIE__} = \&Carp::confess; I also like: $SIG{__WARN__} = \&Carp::cluck; You can always write your own sub and call Carp, e.g. $SIG{__DIE__} = sub { print STDERR "This is dollar underscore: ", $_; Carp::confess(@_); }; From walter at frii.com Thu Aug 17 10:35:20 2000 From: walter at frii.com (Walter Pienciak) Date: Wed Aug 4 23:58:23 2004 Subject: [boulder.pm] print/exit on error? In-Reply-To: <20000817090708.G12995@rnd-consulting.com> Message-ID: On Thu, 17 Aug 2000, Robert L. Harris wrote: > Every now and then some of the guys around here bring me scripts to look > at. Currently I have one that reads through about 250 files with about > 100k lines apiece. Somewhere int he middle, they're getting an error on > a substr operation, line is too short. > > What is the cleanest way to make a perl script do something along the line > or print out a variable (the file it's currently reading), $_, and then > exit when it gets such an error? I could check $? or such for error > condition and then exit, but is that the best way? > > Robert Most of the code I actually maintain is littered with debugging lines: BEGIN { *DB = sub () {1} } # debugging output 0=off 1=on 2=verbose and a bunch of stuff like print "DB: REDIRECT! new url is [$redirected_url]\n" if DB; or print "DB: [$u] = [$robots_txt]\n" if (DB > 1); or print "DB: now processing [$file]\n" if DB; which when I have it turned on lets me track what's what pretty easily. That's a general thing. As for how to exit when Wrong Things Happen, that varies with what your code is, but typical methods are die XML::Checker::error_string($code, @_) if ($code < 200); open( SENDMAIL, "| $SENDMAIL" ) or die "No sendmail?! $!"; &err_bad_multi_file( $@ ) if ( $@ ); # do some cleanup and die flock( SUMMARY, $LOCK_EX) or exeunt( __LINE__, "Can't flock SUMMARY: $!" ); Hope these ideas help. Walter From walter at frii.com Thu Aug 17 13:13:27 2000 From: walter at frii.com (Walter Pienciak) Date: Wed Aug 4 23:58:23 2004 Subject: [boulder.pm] Re: Heavy Perl Sr Sw Eng needed (fwd) Message-ID: FYI ---------- Forwarded message ---------- Date: Thu, 17 Aug 2000 12:02:27 -0600 From: John Affleck To: Walter Pienciak Subject: Re: Heavy Perl Sr Sw Eng needed I am also sorry for the delay in responding. I have cut and pasted the ad below, I,m sorry I am uncertain how to do the ASCII text. And I have attached a text file. [which was a duplicate, and I deleted -- Walter] Sr. Software Engineer-Cutting Edge Perl-1476 Imagine an environment in which your contribution is valued, your work has impact, and you are respected because of the unique perspective you bring. Imagine teams working on leading edge technology or groups partnering to create solutions to complex customer problems. In our dynamic, values-based culture, this future can be yours now at Xilinx. Job Responsibilities: Develop and maintain a large software test automation infrastructure using Object Oriented Perl. Develop new software tools and enhance existing tools to analyze various software technologies like Components and other client/server paradigms. Prior experience in architecting large software systems in perl with hundreds of classes is a requirement. The candidate should be self-motivated and proactive in identifying areas of process improvement. Participate, provide ideas, critically analyze and identify new ways to continually improve the test development and execution process. Understanding of creating software systems using perl for both centralized and decentralized development environments will be essential. Assuring efficiency, testability and usability and finding the right balance between them is critical for this position. The ideal candidate will have a good understanding of CAE tools development and the type of verification required for it. Job Requirements: 5-7 years of experience in Perl Programming essential. At least 3+ years of Perl5 and Object Oriented Perl experience. Should be comfortable working on both UNIX and WinNT environments. Experience in using ORACLE database/SQL with the DBI/DBD modules is required. Experience with System and Network programming in perl is required. Some experience in using Java is required since Java/Perl interfaces needs to be built for new generation infrastructure libraries. Good communication and negotiation skills are a must since this job requires interacting with different groups on a daily basis. Software development exposure to Corba, Enterprise Java Beans, Microsoft COM/DCOM, and MFC desired. Xilinx rewards talent and excellence with exceptional compensation and benefits packages, including, but not limited to, stock options, bonus programs, life balance resources, casual business attire and deep discounts on everything from health club memberships to PC?s. Visit our website: http://www.xilinx.com and respond to: john.affleck@xilinx.com or fax to: 303 442 5211. Very important: for consideration, please include the ?reg #? in the subject line. EOE. Walter Pienciak wrote: > Hi, > > Sorry for the delay in replying, but I've been away at a conference. > > If the job is clearly Perl-related, send the job description to me > as ASCII text -- not as a Microsoft Word attachment -- and I'll > forward it to the list. > > Walter > > On Tue, 18 Jul 2000, John Affleck wrote: > > > Hi, > > I'm not sure how to post an opening for my company on Perl.org or Perl > > Mongers, could you help? > > > > -- > > John F. Affleck > > HR Strategic Staffing > > XILINX > > 2300 55TH Street > > Boulder, Colorado 80301 > > 303 544 5528 direct > > 303 442 5211 fax > > email: john.affleck@xilinx.com > > > > -- John F. Affleck HR Strategic Staffing XILINX 2300 55TH Street Boulder, Colorado 80301 303 544 5528 direct 303 442 5211 fax email: john.affleck@xilinx.com From walter at frii.com Tue Aug 29 16:10:41 2000 From: walter at frii.com (Walter Pienciak) Date: Wed Aug 4 23:58:23 2004 Subject: [boulder.pm] Perl instructor (fwd) Message-ID: ---------- Forwarded message ---------- Date: Tue, 29 Aug 2000 10:59:00 -0400 From: M Labell To: "'walter@frii.com'" Subject: Perl instructor Walter, I was hoping you might be able to help me out with something. I am in need of an instructor to teach the CGI/Perl module of our Web Developer program at Regis University. We are looking for experienced Perl programmers with experience or an interest in teaching. I thought you might be able to pass this information along to the other members of the group. Anyone who is interested can contact me via email or at the number below. Thanks so much for your help, Melissa Labell College & University Partnerships Educational Resource Manager Linkage, Inc. (781)402-5576 MLabell@linkage-inc.com http://www.linkageinc.com The mediocre teacher tells The good teacher explains The superior teacher demonstrates The great teacher inspires William Arthur Ward From Robert.L.Harris at rnd-consulting.com Wed Aug 30 12:15:01 2000 From: Robert.L.Harris at rnd-consulting.com (Robert L. Harris) Date: Wed Aug 4 23:58:23 2004 Subject: [boulder.pm] perl script to open port? Message-ID: <20000830111501.F23200@rnd-consulting.com> I need a perl script that'll hit port 23 on a remote box. If it connects and gives text, good, if not, I need an external program executed. Anyone have anything handy? Don't wanna re-create the wheel if I don't have to. Robert :wq! --------------------------------------------------------------------------- Robert L. Harris | Micros~1 : Senior System Engineer | For when quality, reliability at RnD Consulting | and security just aren't \_ that important! DISCLAIMER: These are MY OPINIONS ALONE. I speak for no-one else. FYI: perl -e 'print $i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);'