From roberthpike at yahoo.com Mon Mar 15 11:27:05 2010 From: roberthpike at yahoo.com (Robert Pike) Date: Mon, 15 Mar 2010 11:27:05 -0700 (PDT) Subject: [kw-pm] Executing commands using tics Message-ID: <655174.41723.qm@web58707.mail.re1.yahoo.com> Has anyone run commands using tics from a Perl CGI application? I'm trying to run gunzip command and other commands using tics but it's not working. If I wrap the statement in an eval statement the $! gets set to "Inappropriate I/O control operation" after the attempt to execute it occurs. Any ideas on how I can get this up and running? A very similar script I had seemed to work fine from command line. Thanks, in advance, for any help. __________________________________________________________________ The new Internet Explorer? 8 - Faster, safer, easier. Optimized for Yahoo! Get it Now for Free! at http://downloads.yahoo.com/ca/internetexplorer/ From eric at uc.org Mon Mar 15 17:08:54 2010 From: eric at uc.org (Eric Maki) Date: Mon, 15 Mar 2010 20:08:54 -0400 (EDT) Subject: [kw-pm] Executing commands using tics In-Reply-To: <655174.41723.qm@web58707.mail.re1.yahoo.com> References: <655174.41723.qm@web58707.mail.re1.yahoo.com> Message-ID: You need to share your platform info (I assume Windows... but cygwin? ActiveState? Strawberry?) and the code. Actually, this would be useful too: print 0 + $!; I am -guessing- that $! is ENOTTY(25) because that is a lot like what the message for ENOTTY looks like for *nix. Which might also explain why you would see it in a context without a TTY, but don't see it on the command line. ---- original message : 2010-03-15 11:27am : Robert Pike ---- > Has anyone run commands using tics from a Perl CGI application? I'm > trying to run gunzip command and other commands using tics but it's > not working. If I wrap the statement in an eval statement the $! gets > set to "Inappropriate I/O control operation" after the attempt to > execute it occurs. Any ideas on how I can get this up and running? A > very similar script I had seemed to work fine from command line. > Thanks, in advance, for any help. From eric at uc.org Tue Mar 16 06:20:34 2010 From: eric at uc.org (fishbot) Date: Tue, 16 Mar 2010 09:20:34 -0400 (EDT) Subject: [kw-pm] Executing commands using tics In-Reply-To: <724860.95186.qm@web58705.mail.re1.yahoo.com> References: <724860.95186.qm@web58705.mail.re1.yahoo.com> Message-ID: If you have Perl 5.10, then is there a reason we are missing that you cannot just use Compress::Zlib or IO::Uncompress::Gunzip directly? Both are core modules from 5.9. Example: use IO::Uncompress::Gunzip qw{ gunzip $GunzipError }; my $payload; gunzip( $filename, \$payload ) or die( "Couldn't decompress '$filename': $GunzipError\n" ); print $payload; That looks like a lot more fun than trying to understand the nuances of IPC on Win32. If there is some reason this won't work for you, then I would suggest trying an Open3 with fully disassociated in/out/err descriptors. That is more tedious, but relatively simple. ---- original message : 2010-03-15 6:53pm : Robert Pike ---- > $result = `gunzip -cf > Windows 2003 Server it's running on. I compile the code using > activestate's PDK app which uses activestate's Perl version 5.10 build > 1007. > > --- On Mon, 3/15/10, fishbot wrote: > >> From: fishbot >> Subject: Re: [kw-pm] Executing commands using tics >> To: "Robert Pike" >> Cc: "KW Perl Mongers" >> Received: Monday, March 15, 2010, 8:08 PM >> >> You need to share your platform info (I assume Windows... >> but cygwin? ActiveState?? Strawberry?) and the code. >> >> Actually, this would be useful too: >> >> ???print 0 + $!; >> >> I am -guessing- that $! is ENOTTY(25) because that is a lot >> like what >> the message for ENOTTY looks like for *nix. >> >> Which might also explain why you would see it in a context >> without a >> TTY, but don't see it on the command line. >> >> ---- original message : 2010-03-15 11:27am : Robert Pike >> ---- >> >>> Has anyone run commands using tics from a Perl CGI >> application? I'm >>> trying to run gunzip command and other commands using >> tics but it's >>> not working. If I wrap the statement in an eval >> statement the $! gets >>> set to "Inappropriate I/O control operation" after the >> attempt to >>> execute it occurs. Any ideas on how I can get this up >> and running? A >>> very similar script I had seemed to work fine from >> command line. >>> Thanks, in advance, for any help. >> > > > __________________________________________________________________ > Looking for the perfect gift? Give the gift of Flickr! > > http://www.flickr.com/gift/ > From daniel at coder.com Tue Mar 16 11:39:00 2010 From: daniel at coder.com (Daniel R. Allen) Date: Tue, 16 Mar 2010 14:39:00 -0400 (EDT) Subject: [kw-pm] A Very Special kw-pm Meeting for March 18th Message-ID: This Thursday we're meeting on the UW campus... to go see theatre! Arcadia, by Tom Stoppard, is a play about Fermat's Last Theorem, population biology, chaos theory, love, truth, and sex. And landscape gardening. The current plan is to get tickets at the door, as they don't expect to come anywhere near selling out. Showtime is 8pm, tickets are $12 or $10 for students and seniors. (The plan came about in the IRC channel when we realized a number of us were interested in the show, and Raymond said he was also interested, instead of talking this month. So, we'll have to get him a future month!) Link for this production: http://www.drama.uwaterloo.ca/09-10%20season.html Longer description of the play: http://en.wikipedia.org/wiki/Arcadia_%28play%29 Location: "Theatre of the Arts" is labeled on this map: http://uwaterloo.ca/map/index.php Closest parking is "HV" lot, the first left on the Ring Road from University Ave. ($3 after 5pm). -Daniel From roberthpike at yahoo.com Fri Mar 19 07:44:13 2010 From: roberthpike at yahoo.com (Robert Pike) Date: Fri, 19 Mar 2010 07:44:13 -0700 (PDT) Subject: [kw-pm] Quick Question Message-ID: <364571.27674.qm@web58708.mail.re1.yahoo.com> I'm using the CGI module in one of my scripts but part way down the page I'm trying to add new name/value pairings to the CGI object I have. For example : our $query = new CGI(); ... ... ... $query->param(-name => "somestring", -value => "somevalue"); ... print join(" + ", $query->param); # this line doesn't show the new entry I made Is there something I need to do differently in order to add additional entries to the object? Later in the script I nee to loop through the query object and currently I can't because my new entries aren't being added. Any info would be appreciated. Thanks. __________________________________________________________________ Make your browsing faster, safer, and easier with the new Internet Explorer? 8. Optimized for Yahoo! Get it Now for Free! at http://downloads.yahoo.com/ca/internetexplorer/ From dada.da at gmail.com Fri Mar 19 10:19:57 2010 From: dada.da at gmail.com (Daniel Allen) Date: Fri, 19 Mar 2010 13:19:57 -0400 Subject: [kw-pm] Quick Question In-Reply-To: <364571.27674.qm@web58708.mail.re1.yahoo.com> References: <364571.27674.qm@web58708.mail.re1.yahoo.com> Message-ID: The sample you posted is OK; I just ran this, and got the expected result: use CGI; our $query = new CGI(); $query->param(-name => "somestring", -value => "somevalue"); $query->param(-name => "otherstring", -value => "somevalue"); print join(" + ", $query->param); # this line doesn't show the new entry I made # outputs somestring + otherstring On Fri, Mar 19, 2010 at 10:44 AM, Robert Pike wrote: > I'm using the CGI module in one of my scripts but part way down the page I'm trying to add new name/value pairings to the CGI object I have. > For example : > our $query = new CGI(); > ... > ... > ... > $query->param(-name => "somestring", -value => "somevalue"); > ... > print join(" + ", $query->param); ?# this line doesn't show the new entry I made > > Is there something I need to do differently in order to add additional entries to the object? Later in the script I nee to loop through the query object and currently I can't because my new entries aren't being added. Any info would be appreciated. Thanks. > > > ? ? ?__________________________________________________________________ > Make your browsing faster, safer, and easier with the new Internet Explorer? 8. Optimized for Yahoo! Get it Now for Free! at http://downloads.yahoo.com/ca/internetexplorer/ > _______________________________________________ > kw-pm mailing list > kw-pm at pm.org > http://mail.pm.org/mailman/listinfo/kw-pm >